Samchon Framework for CPP  1.0.0
samchon::library::FTInstance Class Reference

An interface of file-tree. More...

#include <FTInstance.hpp>

Collaboration diagram for samchon::library::FTInstance:

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...
 
- Public Member Functions inherited from samchon::protocol::Entity
 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

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...
 

Detailed Description

An interface of file-tree.

An abstract class for folder and file instances.

library_file_tree.png
See also
samchon::library
Author
Jeongho Nam http://samchon.org

Definition at line 22 of file FTInstance.hpp.

Constructor & Destructor Documentation

FTInstance::FTInstance ( FTFolder parent)

Construct from parent folder.

Parameters
parentParent folder that this instance is belonged to

Definition at line 13 of file FTInstance.cpp.

References comment, name, parent, and uid.

Member Function Documentation

auto FTInstance::TAG ( ) const -> std::string
protectedvirtual

A tag name when represented by XML.

Returns
A tag name

Implements samchon::protocol::Entity.

Definition at line 11 of file FTInstance.cpp.

auto FTInstance::key ( ) const -> std::string
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.

Returns
An identifier

Reimplemented from samchon::protocol::Entity.

Definition at line 25 of file FTInstance.cpp.

References uid.

Referenced by samchon::namtree::NTFile::toXML().

Here is the caller graph for this function:

auto FTInstance::getUID ( ) const -> int

Get uid.

Definition at line 29 of file FTInstance.cpp.

References uid.

Referenced by samchon::library::FTFactory::registerInstance().

Here is the caller graph for this function:

auto FTInstance::getParent ( ) const -> FTFolder*

Get parent folder.

Definition at line 33 of file FTInstance.cpp.

References parent.

auto FTInstance::getName ( ) const -> std::string

Get name.

Definition at line 37 of file FTInstance.cpp.

References name.

auto FTInstance::getComment ( ) const -> std::string

Get comment.

Definition at line 41 of file FTInstance.cpp.

References comment.

auto FTInstance::toXML ( ) const -> std::shared_ptr<library::XML>
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>
Returns
An XML object representing the Entity.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

FTFolder* samchon::library::FTInstance::parent
protected

Parent folder containing the instance.

Definition at line 34 of file FTInstance.hpp.

Referenced by FTInstance(), and getParent().

int samchon::library::FTInstance::uid
protected

Key, an unique id of file.

Definition at line 39 of file FTInstance.hpp.

Referenced by FTInstance(), getUID(), key(), and toXML().

std::string samchon::library::FTInstance::name
protected

Name of the file.

Definition at line 44 of file FTInstance.hpp.

Referenced by FTInstance(), getName(), and toXML().

std::string samchon::library::FTInstance::comment
protected

Comment of the file.

Definition at line 49 of file FTInstance.hpp.

Referenced by FTInstance(), getComment(), and toXML().


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