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

A metadata of a parameter in a function. More...

#include <NTParameter.hpp>

Collaboration diagram for samchon::namtree::NTParameter:

Public Member Functions

 NTParameter ()
 Default Constructor. More...
 
virtual void construct (std::shared_ptr< library::XML >) override
 Construct data of the Entity from an XML object. More...
 
virtual auto key () const -> std::string override
 Get a key that can identify the Entity uniquely. More...
 
auto getName () const -> std::string
 Get name. More...
 
auto getInitialValue () const -> double
 Get initial, default vlaue. More...
 
virtual auto TAG () const -> std::string override
 A tag name when represented by XML. More...
 
virtual auto CHILD_TAG () const -> std::string override
 A tag name of children. 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::protocol::EntityGroup< _Container, _ETy, T >
 EntityGroup ()
 Default Constructor. More...
 
auto has (const std::string &key) const -> bool
 Indicates whether a container has an object having the specified identifier. More...
 
auto get (const std::string &key) -> value_type &
 Access the element by specified identifier(key). More...
 
auto get (const std::string &key) const -> const value_type &
 Access the const element by specified identifier(key). More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IEntityGroup
 IEntityGroup ()
 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 Member Functions

virtual auto createChild (std::shared_ptr< library::XML >) -> NTParameterDetermined *override
 Factory method of a child Entity. More...
 

Protected Attributes

std::string name
 Name of a paremeter. More...
 
double initialValue
 An initial, default value. 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...
 

Detailed Description

A metadata of a parameter in a function.

NTParameter is a class containing metadata of a parameter which is belonged to a class, metadata of a function, NTFile. Between the NTFile and NTParameter(s), there's a associate relationship.

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

Definition at line 25 of file NTParameter.hpp.

Constructor & Destructor Documentation

NTParameter::NTParameter ( )

Default Constructor.

Definition at line 16 of file NTParameter.cpp.

References initialValue.

Member Function Documentation

void NTParameter::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 21 of file NTParameter.cpp.

References samchon::namtree::INTExplore::construct(), samchon::protocol::EntityGroup< _Container, _ETy, T >::construct(), initialValue, and name.

Here is the call graph for this function:

auto NTParameter::createChild ( std::shared_ptr< library::XML ) -> NTParameterDetermined *override
overrideprotectedvirtual

Factory method of a child Entity.

EntityGroup::createChild() is a factory method creating a new child Entity which is belonged to the EntityGroup. This method is called by EntityGroup::construct(). The children construction methods Entity::construct() will be called by abstract method of the EntityGroup::construct().

Returns
A new child Entity belongs to EntityGroup.

Implements samchon::protocol::EntityGroup< _Container, _ETy, T >.

Definition at line 32 of file NTParameter.cpp.

auto NTParameter::key ( ) const -> std::string
overridevirtual

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 37 of file NTParameter.cpp.

References name.

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

Get name.

Definition at line 41 of file NTParameter.cpp.

References name.

auto NTParameter::getInitialValue ( ) const -> double

Get initial, default vlaue.

Definition at line 45 of file NTParameter.cpp.

References initialValue.

auto NTParameter::TAG ( ) const -> std::string
overridevirtual

A tag name when represented by XML.

Returns
A tag name

Implements samchon::protocol::Entity.

Definition at line 13 of file NTParameter.cpp.

auto NTParameter::CHILD_TAG ( ) const -> std::string
overridevirtual

A tag name of children.

< TAG>
     <CHILD_TAG />
     <CHILD_TAG />
</TAG>

Implements samchon::protocol::IEntityGroup.

Definition at line 14 of file NTParameter.cpp.

auto NTParameter::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::namtree::INTExplore.

Definition at line 50 of file NTParameter.cpp.

References initialValue, name, samchon::namtree::INTExplore::toXML(), and samchon::protocol::EntityGroup< _Container, _ETy, T >::toXML().

Here is the call graph for this function:

Member Data Documentation

std::string samchon::namtree::NTParameter::name
protected

Name of a paremeter.

The string label is identifier of a NTParameter. It must be unique.

Definition at line 37 of file NTParameter.hpp.

Referenced by construct(), getName(), key(), and toXML().

double samchon::namtree::NTParameter::initialValue
protected

An initial, default value.

Definition at line 42 of file NTParameter.hpp.

Referenced by construct(), getInitialValue(), NTParameter(), and toXML().


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