15 #ifndef __IPSDKBASEDATA_DATAITEMENUMLEAF_H__ 16 #define __IPSDKBASEDATA_DATAITEMENUMLEAF_H__ 18 #include <IPSDKBaseData/DataItem/Leaf/BaseDataItemEnumLeaf.h> 25 template <
typename enumType>
45 return EnumType::getEnumName();
61 boost::optional<EnumType> optValue = EnumType::get_by_name(strValue.c_str());
62 if (optValue.is_initialized() ==
true) {
63 intValue = optValue->value();
74 std::string& strValue)
const 76 boost::optional<EnumType> optValue = EnumType::get_by_value(intValue);
77 if (optValue.is_initialized() ==
true) {
78 strValue = optValue->str();
93 template <
typename enumType>
97 _enumValue = enumValue.value();
100 template <
typename enumType>
104 return *enumType::get_by_index(static_cast<ipsdk::ipInt32>(_enumValue));
113 #endif // __IPSDKBASEDATA_DATAITEMENUMLEAF_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void setValue(const EnumType &enumValue)
set value associated to object
Definition: DataItemEnumLeaf.h:95
Concrete class for data item leafs associated to enumerate value.
Definition: DataItemEnumLeaf.h:26
std::string getEnumNameStr() const
method allowing to retrieve enumerate name
Definition: DataItemEnumLeaf.h:43
bool toString(const ipUInt32 &intValue, std::string &strValue) const
method allowing to convert enumerate integer value to a string value
Definition: DataItemEnumLeaf.h:73
enumType EnumType
enumerate type associated to object
Definition: DataItemEnumLeaf.h:31
bool fromString(const std::string &strValue, ipUInt32 &intValue) const
method allowing to convert enumerate string value to an integer value
Definition: DataItemEnumLeaf.h:58
EnumType getValue() const
retrieve value associated to object
Definition: DataItemEnumLeaf.h:102
Base class for data item leafs associated to enumerate value.
Definition: BaseDataItemEnumLeaf.h:25
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53