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

A pre-determined value of a parameter. More...

#include <NTParameterDetermined.hpp>

Collaboration diagram for samchon::namtree::NTParameterDetermined:

Public Member Functions

 NTParameterDetermined ()
 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 getLabel () const -> std::string
 Get label. More...
 
auto getValue () const -> double
 Get value. More...
 
virtual auto TAG () const -> std::string override
 A tag name when represented by XML. 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::Entity
 Entity ()
 Default Constructor. More...
 

Protected Attributes

std::string label
 A label will be printed in a combo-box. More...
 
double value
 A value, pre-defined. More...
 

Detailed Description

A pre-determined value of a parameter.

namtree_nt_parameter_determined.png

NTParameterDetermined is a class belonged to a NTParameter object presents a pre-defined value. In UI module of Nam-Tree, the NTParameterDetermined is expressed by an item of a ComboBox.

When optimization of Nam-Tree, in a part of NTParameter, if the pre-determined value is defined optimizer does not explore with grid method from referencing INTExplore. Just selects a value between the pre-defineds. (One of NTParameterDetermined is selected in NTParameter).

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

Definition at line 30 of file NTParameterDetermined.hpp.

Constructor & Destructor Documentation

NTParameterDetermined::NTParameterDetermined ( )

Default Constructor.

Definition at line 14 of file NTParameterDetermined.cpp.

Member Function Documentation

void NTParameterDetermined::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

Implements samchon::protocol::Entity.

Definition at line 18 of file NTParameterDetermined.cpp.

References label, and value.

auto NTParameterDetermined::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 25 of file NTParameterDetermined.cpp.

References label.

auto NTParameterDetermined::getLabel ( ) const -> std::string

Get label.

Definition at line 29 of file NTParameterDetermined.cpp.

References label.

auto NTParameterDetermined::getValue ( ) const -> double

Get value.

Definition at line 33 of file NTParameterDetermined.cpp.

References value.

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

A tag name when represented by XML.

Returns
A tag name

Implements samchon::protocol::Entity.

Definition at line 12 of file NTParameterDetermined.cpp.

auto NTParameterDetermined::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::protocol::Entity.

Definition at line 38 of file NTParameterDetermined.cpp.

References label, samchon::protocol::Entity::toXML(), and value.

Here is the call graph for this function:

Member Data Documentation

std::string samchon::namtree::NTParameterDetermined::label
protected

A label will be printed in a combo-box.

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

Definition at line 41 of file NTParameterDetermined.hpp.

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

double samchon::namtree::NTParameterDetermined::value
protected

A value, pre-defined.

Definition at line 46 of file NTParameterDetermined.hpp.

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


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