Samchon Framework for CPP  1.0.0
INTExplore.cpp
1 #include <samchon/namtree/INTExplore.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 INTExplore::INTExplore()
13  : super()
14 {
15  minimum = INT_MIN;
16  maximum = INT_MIN;
17  section = 0;
18  precision = INT_MIN;
19 }
20 void INTExplore::construct(shared_ptr<XML> xml)
21 {
22  minimum = xml->hasProperty("minimum")
23  ? xml->getProperty<double>("minimum")
24  : INT_MIN;
25  maximum = xml->hasProperty("maximum")
26  ? xml->getProperty<double>("maximum")
27  : INT_MIN;
28 
29  section = xml->hasProperty("section")
30  ? xml->getProperty<unsigned int>("section")
31  : 0;
32  precision = xml->hasProperty("precision")
33  ? xml->getProperty<int>("precision")
34  : INT_MIN;
35 }
36 
37 auto INTExplore::getMinimum() const -> double
38 {
39  return minimum;
40 }
41 auto INTExplore::getMaximum() const -> double
42 {
43  return maximum;
44 }
45 auto INTExplore::getSection() const -> unsigned int
46 {
47  return section;
48 }
49 auto INTExplore::getPrecision() const -> int
50 {
51  return precision;
52 }
53 
54 auto INTExplore::toXML() const -> shared_ptr<XML>
55 {
56  shared_ptr<XML> &xml = super::toXML();
57  if (minimum != INT_MIN) xml->setProperty("minimum", minimum);
58  if (maximum != INT_MIN) xml->setProperty("maximum", maximum);
59  if (section != 0) xml->setProperty("section", section);
60  if (precision != INT_MIN) xml->setProperty("precision", precision);
61 
62  return xml;
63 }
An entity, a standard data class.
Definition: Entity.hpp:48
auto getMinimum() const -> double
Get minimum.
Definition: INTExplore.cpp:37
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
Definition: Entity.cpp:30
virtual void construct(std::shared_ptr< library::XML >)
Construct data of the Entity from an XML object.
Definition: INTExplore.cpp:20
Definition: RWMutex.hpp:4
Package of libraries.
Definition: library.hpp:84
double maximum
Maximum value.
Definition: INTExplore.hpp:40
auto getPrecision() const -> int
Get precision.
Definition: INTExplore.cpp:49
unsigned int section
Section number of exploration.
Definition: INTExplore.hpp:45
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
Definition: INTExplore.cpp:54
Package of network protocol and libraries.
Definition: protocol.hpp:185
int precision
Target precision: 10precision
Definition: INTExplore.hpp:50
Package of Nam-Tree.
Definition: namtree.hpp:93
auto getSection() const -> unsigned int
Get section.
Definition: INTExplore.cpp:45
double minimum
Minimum value.
Definition: INTExplore.hpp:35
XML is a class representing xml object.
Definition: XML.hpp:72
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7
auto getMaximum() const -> double
Get maximum.
Definition: INTExplore.cpp:41