Samchon Framework for CPP
1.0.0
|
An interface of file-tree. More...
#include <FTInstance.hpp>
Public Member Functions | |
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... | |
virtual auto | toXML () const -> std::shared_ptr< library::XML > |
Get an XML object represents the Entity. More... | |
![]() | |
Entity () | |
Default Constructor. More... | |
virtual void | construct (std::shared_ptr< library::XML >)=0 |
Construct data of the Entity from an XML object. More... | |
Protected Member Functions | |
virtual auto | TAG () const -> std::string |
A tag name when represented by XML. More... | |
Protected Attributes | |
FTFolder * | parent |
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... | |
An interface of file-tree.
An abstract class for folder and file instances.
Definition at line 22 of file FTInstance.hpp.
FTInstance::FTInstance | ( | FTFolder * | parent | ) |
|
protectedvirtual |
A tag name when represented by XML.
Implements samchon::protocol::Entity.
Definition at line 11 of file FTInstance.cpp.
|
virtual |
Get a key that can identify the Entity uniquely.
If identifier of the Entity is not atomic value, returns a string represents the composite identifier. If identifier of the Entity is not string, converts the identifier to string and returns the string.
Reimplemented from samchon::protocol::Entity.
Definition at line 25 of file FTInstance.cpp.
References uid.
Referenced by samchon::namtree::NTFile::toXML().
auto FTInstance::getUID | ( | ) | const -> int |
Get uid.
Definition at line 29 of file FTInstance.cpp.
References uid.
Referenced by samchon::library::FTFactory::registerInstance().
auto FTInstance::getParent | ( | ) | const -> FTFolder* |
auto FTInstance::getName | ( | ) | const -> std::string |
auto FTInstance::getComment | ( | ) | const -> std::string |
|
virtual |
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> |
Reimplemented from samchon::protocol::Entity.
Reimplemented in samchon::namtree::NTFile, samchon::library::FTFolder, and samchon::library::FTFile.
Definition at line 46 of file FTInstance.cpp.
References comment, name, samchon::protocol::Entity::toXML(), and uid.
Referenced by samchon::library::FTFile::toXML(), and samchon::library::FTFolder::toXML().
|
protected |
Parent folder containing the instance.
Definition at line 34 of file FTInstance.hpp.
Referenced by FTInstance(), and getParent().
|
protected |
Key, an unique id of file.
Definition at line 39 of file FTInstance.hpp.
Referenced by FTInstance(), getUID(), key(), and toXML().
|
protected |
Name of the file.
Definition at line 44 of file FTInstance.hpp.
Referenced by FTInstance(), getName(), and toXML().
|
protected |
Comment of the file.
Definition at line 49 of file FTInstance.hpp.
Referenced by FTInstance(), getComment(), and toXML().