IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseDataItemEnumLeaf.h
1 // BaseDataItemEnumLeaf.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKBASEDATA_BASEDATAITEMENUMLEAF_H__
16 #define __IPSDKBASEDATA_BASEDATAITEMENUMLEAF_H__
17 
18 #include <IPSDKBaseData/DataItem/Leaf/BaseDataItemLeaf.h>
19 
20 namespace ipsdk {
21 
24 
26 {
27  // declare serial class
29 
30 // predefined public types
31 public:
33  static const eDataItemValueType::domain g_dataItemValueType = eDataItemValueType::eDIVT_Enum;
34 
35 public:
41 
42 // methods
43 public:
45  eDataItemValueType getDataItemValueType() const;
46 
48  virtual std::string getEnumNameStr() const;
49 
51  virtual std::string getValueStr() const;
52 
53 protected:
57  virtual bool fromString(const std::string& strValue,
58  ipUInt32& intValue) const;
59 
63  virtual bool toString(const ipUInt32& intValue,
64  std::string& strValue) const;
65 
66 // attributes
67 protected:
70 };
71 
74 
75 inline eDataItemValueType
77 {
78  return g_dataItemValueType;
79 }
80 
81 inline std::string
83 {
84  return "";
85 }
86 
87 inline bool
88 BaseDataItemEnumLeaf::fromString(const std::string& strValue,
89  ipUInt32& intValue) const
90 {
91  return false;
92 }
93 
94 inline bool
96  std::string& strValue) const
97 {
98  return false;
99 }
100 
101 inline std::string
103 {
104  std::string valueStr;
105  if (toString(_enumValue, valueStr) == true)
106  return valueStr;
107  else
108  return "";
109 }
110 
113 
114 } // end of namespace ipsdk
115 
116 #endif // __IPSDKBASEDATA_BASEDATAITEMENUMLEAF_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
virtual bool toString(const ipUInt32 &intValue, std::string &strValue) const
method allowing to convert enumerate integer value to a string value
Definition: BaseDataItemEnumLeaf.h:95
virtual std::string getEnumNameStr() const
method allowing to retrieve enumerate name
Definition: BaseDataItemEnumLeaf.h:82
eDataItemValueType getDataItemValueType() const
retrieve data item value type
Definition: BaseDataItemEnumLeaf.h:76
ipUInt32 _enumValue
integer value associated to enumerate
Definition: BaseDataItemEnumLeaf.h:69
PYIPSDKBASE_API std::string toString(const BaseDataItem &dataItem)
function allowing to convert an IPSDK data item to a string representation
IPSDKGEOMETRY_API void fromString(Polygon2d< T > &polygon, const std::string &dataStr)
eDataItemValueType
Enumerate describing data items value type.
Definition: DataItemTypes.h:70
Data item associated to an enumerate value.
Definition: DataItemTypes.h:98
virtual std::string getValueStr() const
retrieve string representation associated to enumerate value
Definition: BaseDataItemEnumLeaf.h:102
virtual bool fromString(const std::string &strValue, ipUInt32 &intValue) const
method allowing to convert enumerate string value to an integer value
Definition: BaseDataItemEnumLeaf.h:88
Base class for data item leafs.
Definition: BaseDataItemLeaf.h:25
static const eDataItemValueType::domain g_dataItemValueType
enumerate associated to value type
Definition: BaseDataItemEnumLeaf.h:33
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
Base class for data item leafs associated to enumerate value.
Definition: BaseDataItemEnumLeaf.h:25
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53