Samchon Framework for CPP  1.0.0
samchon::namtree::NTFile Class Reference

A file archiving metadata of a function. More...

#include <NTFile.hpp>

Collaboration diagram for samchon::namtree::NTFile:

Public Member Functions

 NTFile (NTFactory *, library::FTFolder *)
 Construct from factory and parent folder. More...
 
virtual void construct (std::shared_ptr< library::XML >) override
 Construct data of the Entity from an XML object. More...
 
auto getParameterArray () const -> NTParameterArray *
 Get metadata of parameters. More...
 
auto getOtherside () const -> NTFile *
 Get otherside file. More...
 
auto getFunction () const -> SideFunction
 Get function pointer. More...
 
virtual auto toXML () const -> std::shared_ptr< library::XML > override
 Get an XML object represents the Entity. More...
 
- Public Member Functions inherited from samchon::library::FTFile
 FTFile (FTFolder *)
 Construct from parent folder. More...
 
auto getExtension () const -> std::string
 Get extension. More...
 
- Public Member Functions inherited from samchon::library::FTInstance
 FTInstance (FTFolder *)
 Construct from parent folder. More...
 
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 
auto getUID () const -> int
 Get uid. More...
 
auto getParent () const -> FTFolder *
 Get parent folder. More...
 
auto getName () const -> std::string
 Get name. More...
 
auto getComment () const -> std::string
 Get comment. More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::namtree::INTExplore
 INTExplore ()
 Default Constructor. More...
 
auto getMinimum () const -> double
 Get minimum. More...
 
auto getMaximum () const -> double
 Get maximum. More...
 
auto getSection () const -> unsigned int
 Get section. More...
 
auto getPrecision () const -> int
 Get precision. More...
 

Protected Attributes

NTFactoryfactory
 A factory and manager class for nam-tree. More...
 
NTParameterArrayparameterArray
 Metadata of parameters. More...
 
NTFileotherside
 A file of otherside. More...
 
SideFunction function
 A function pointer. More...
 
- Protected Attributes inherited from samchon::library::FTFile
std::string extension
 An extension of a file. More...
 
- Protected Attributes inherited from samchon::library::FTInstance
FTFolderparent
 Parent folder containing the instance. More...
 
int uid
 Key, an unique id of file. More...
 
std::string name
 Name of the file. More...
 
std::string comment
 Comment of the file. More...
 
- Protected Attributes inherited from samchon::namtree::INTExplore
double minimum
 Minimum value. More...
 
double maximum
 Maximum value. More...
 
unsigned int section
 Section number of exploration. More...
 
int precision
 Target precision: 10precision More...
 

Additional Inherited Members

- Protected Member Functions inherited from samchon::library::FTInstance
virtual auto TAG () const -> std::string
 A tag name when represented by XML. More...
 

Detailed Description

A file archiving metadata of a function.

namtree_nt_file.png

NTFile class is a FTFile archiving meta of a function which is used by a NTSide class. It may better to understand what NTFile is, if you consider the NTFile as a header of a function. Name, metadata of parameters and function pointer is archived on the NTFile.

namtree_file.png
Note

Previous version of the Samchon Framework, NTFile class had a function script on the NTFile and Nam-Tree module compiled the script like Nam-Tree moudle of Flex standalone that is keeping the compiling method.

However, modern Samchon Framework's C++ NTFile class doesn't have a function script and does not compile. I don't know a way to compile a script in lots of operating systems, so I dropped the compiling method. Until update, NTFactory has function pointers in a Dictionary and NTFile reference them. Users must put own methods into the Dictionary by their hands.

I will solve the problem sooon. Until next generation of Samchon Framework, put your own function pointers to a Dictionary in NTFactory by your hand please. Sorry for my unripe skill on programming.

See also
samchon::namtree
namtree::NTSide
Author
Jeongho Nam http://samchon.org

Definition at line 50 of file NTFile.hpp.

Constructor & Destructor Documentation

NTFile::NTFile ( NTFactory factory,
library::FTFolder parent 
)

Construct from factory and parent folder.

Parameters
factoryA factory class creating nam-tree objects.
folderA parent folder of the NTFile.

Definition at line 15 of file NTFile.cpp.

References factory, and otherside.

Member Function Documentation

void NTFile::construct ( std::shared_ptr< library::XML )
overridevirtual

Construct data of the Entity from an XML object.

Overrides the construct() method and fetch data of member variables from the XML.

By recommended guidance, data representing member variables are contained in properties of the put XML object.

Parameters
xmlAn xml used to construct data of entity

Reimplemented from samchon::namtree::INTExplore.

Definition at line 23 of file NTFile.cpp.

References samchon::protocol::EntityGroup< _Container, _ETy, T >::construct(), parameterArray, and samchon::namtree::NTParameterArray::TAG().

Here is the call graph for this function:

auto NTFile::getParameterArray ( ) const -> NTParameterArray*

Get metadata of parameters.

Definition at line 30 of file NTFile.cpp.

References parameterArray.

auto NTFile::getOtherside ( ) const -> NTFile*

Get otherside file.

Definition at line 34 of file NTFile.cpp.

References otherside.

auto NTFile::getFunction ( ) const -> SideFunction

Get function pointer.

Definition at line 38 of file NTFile.cpp.

auto NTFile::toXML ( ) const -> std::shared_ptr<library::XML>
overridevirtual

Get an XML object represents the Entity.

Returns an XML object that can represents the Entity containing member variables into properties.

A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.

Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).

Standard Usage Non-standard usage abusing value
<memberList>
     <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' />
     <member id='master' name='Administartor' birthdate='2011-07-28' />
</memberList>
<member>
     <id>jhnam88</id>
     <name>Jeongho+Nam</name>
     <birthdate>1988-03-11</birthdate>
</member>
Returns
An XML object representing the Entity.

Reimplemented from samchon::library::FTFile.

Definition at line 43 of file NTFile.cpp.

References samchon::library::FTInstance::key(), otherside, parameterArray, samchon::library::FTFile::toXML(), and samchon::protocol::EntityGroup< _Container, _ETy, T >::toXML().

Here is the call graph for this function:

Member Data Documentation

NTFactory* samchon::namtree::NTFile::factory
protected

A factory and manager class for nam-tree.

NTFile references NTFactory to find otherside file and function pointer.

Definition at line 65 of file NTFile.hpp.

Referenced by NTFile().

NTParameterArray* samchon::namtree::NTFile::parameterArray
protected

Metadata of parameters.

Definition at line 70 of file NTFile.hpp.

Referenced by construct(), getParameterArray(), and toXML().

NTFile* samchon::namtree::NTFile::otherside
protected

A file of otherside.

The variable otherside is a pair of file which is inserted to a criteria's opposite side.

When the otherside is specified and you determine the NTFile to be contained in a NTSide, the NTCriteria owning the NTSide will determine opposite side's NTSide to have the otherside NTFile forcibly.

Note

The determination will be automatic and unchangeble. Consider hardly when specifying an otherside.

Definition at line 86 of file NTFile.hpp.

Referenced by getOtherside(), NTFile(), and toXML().

SideFunction samchon::namtree::NTFile::function
protected

A function pointer.

Definition at line 91 of file NTFile.hpp.


The documentation for this class was generated from the following files: