Samchon Framework for CPP  1.0.0
NTParameterDetermined.cpp
1 #include <samchon/namtree/NTParameterDetermined.hpp>
2 
3 #include <samchon/library/XML.hpp>
4 
5 using namespace std;
6 
7 using namespace samchon;
8 using namespace samchon::library;
9 using namespace samchon::protocol;
10 using namespace samchon::namtree;
11 
12 auto NTParameterDetermined::TAG() const -> string { return "parameterDetermined"; }
13 
14 NTParameterDetermined::NTParameterDetermined()
15  : super()
16 {
17 }
18 void NTParameterDetermined::construct(shared_ptr<XML> xml)
19 {
20  label = xml->getProperty("label");
21  value = xml->hasProperty("value")
22  ? xml->getProperty<double>("value") : INT_MIN;
23 }
24 
25 auto NTParameterDetermined::key() const -> string
26 {
27  return label;
28 }
29 auto NTParameterDetermined::getLabel() const -> string
30 {
31  return label;
32 }
33 auto NTParameterDetermined::getValue() const -> double
34 {
35  return value;
36 }
37 
38 auto NTParameterDetermined::toXML() const -> shared_ptr<XML>
39 {
40  shared_ptr<XML> &xml = super::toXML();
41  xml->setProperty("label", label);
42  if(value != INT_MIN)
43  xml->setProperty("value", value);
44 
45  return xml;
46 }
An entity, a standard data class.
Definition: Entity.hpp:48
virtual auto key() const -> std::string override
Get a key that can identify the Entity uniquely.
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
Definition: Entity.cpp:30
std::string label
A label will be printed in a combo-box.
virtual void construct(std::shared_ptr< library::XML >) override
Construct data of the Entity from an XML object.
Definition: RWMutex.hpp:4
Package of libraries.
Definition: library.hpp:84
Package of network protocol and libraries.
Definition: protocol.hpp:185
Package of Nam-Tree.
Definition: namtree.hpp:93
virtual auto toXML() const -> std::shared_ptr< library::XML > override
Get an XML object represents the Entity.
XML is a class representing xml object.
Definition: XML.hpp:72
auto getValue() const -> double
Get value.
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7
auto getLabel() const -> std::string
Get label.