16 #ifndef __IPSDKBASEPROCESSING_RULELEAFVALUECOMPARISON_H__ 17 #define __IPSDKBASEPROCESSING_RULELEAFVALUECOMPARISON_H__ 19 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/Leaf/LeafValueComparison/BaseTLeafValueComparisonRule.h> 28 template <
typename AttributeType,
30 eValueComparisonRuleType::domain ValueComparisonRuleType,
37 template <
typename AttributeType,
39 eValueComparisonRuleType::domain ValueComparisonRuleType>
41 typename
boost::disable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>, typename LeafType::ValueType>::type>::type> :
43 ValueComparisonRuleType>
48 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
49 boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
53 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
54 boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type,
69 void init(
const boost::weak_ptr<const AttributeType>& pAttribute,
70 const ValueType& value);
74 std::string getAttributeName()
const;
77 ValueType getAttributeValue()
const;
87 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
89 RuleLeafValueComparison<AttributeType, LeafType, ValueComparisonRuleType,
90 typename boost::disable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::
91 init(
const boost::weak_ptr<const AttributeType>& pAttribute,
98 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
101 typename boost::disable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::
102 getAttributeName()
const 104 return AttributeType::getObjectNameStr() +
"::" +
105 DataItemType::template getNodeNameStr<LeafType>();
108 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
110 typename boost::disable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::ValueType
112 typename boost::disable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::
113 getAttributeValue()
const 116 const AttributeType& derivedAttribute =
static_cast<const AttributeType&
>(this->getAttribute1());
118 return derivedAttribute.getNode().template getValue<LeafType>();
124 template <
typename AttributeType,
126 eValueComparisonRuleType::domain ValueComparisonRuleType>
128 typename
boost::enable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>, typename LeafType::ValueType>::type>::type> :
130 ValueComparisonRuleType>
135 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
136 boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
140 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
141 boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type,
159 void init(
const boost::weak_ptr<const AttributeType>& pAttribute,
160 const ValueType& value);
164 std::string getAttributeName()
const;
167 BaseValueType getAttributeValue()
const;
177 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
179 RuleLeafValueComparison<AttributeType, LeafType, ValueComparisonRuleType,
180 typename boost::enable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::
181 init(
const boost::weak_ptr<const AttributeType>& pAttribute,
188 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
191 typename boost::enable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::
192 getAttributeName()
const 194 return AttributeType::getObjectNameStr() +
"::" +
195 DataItemType::template getNodeNameStr<LeafType>();
198 template <
typename AttributeType,
typename LeafType, eValueComparisonRuleType::domain ValueComparisonRuleType>
200 typename boost::enable_if<typename boost::is_base_of<boost::detail::enum_base<typename LeafType::ValueType>,
typename LeafType::ValueType>::type>::type>::BaseValueType
202 getAttributeValue()
const 205 const AttributeType& derivedAttribute =
static_cast<const AttributeType&
>(this->getAttribute1());
207 return derivedAttribute.getNode().template getValue<LeafType>().value();
216 #endif // __IPSDKBASEPROCESSING_RULELEAFVALUECOMPARISON_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::enable_if< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename AttributeType::ValueType >::type DataItemType
retrieve attribute type
Definition: RuleLeafValueComparison.h:50
Base template class for rule allowing to compare leaf value of data item attributes with a given valu...
Definition: BaseTLeafValueComparisonRule.h:33
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
void initBase()
base class initialization method
Definition: DataItemNodeHdrMacrosDetails.h:48
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename LeafType::ValueType >::type ValueType
Value type associated to leaf.
Definition: RuleLeafValueComparison.h:142
boost::enable_if< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename AttributeType::ValueType >::type DataItemType
retrieve attribute type
Definition: RuleLeafValueComparison.h:137
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename LeafType::ValueType >::type ValueType
Value type associated to leaf.
Definition: RuleLeafValueComparison.h:55
Concrete class for rule allowing to compare leaf value of data item attributes with a given value...
Definition: RuleLeafValueComparison.h:32
ipInt32 BaseValueType
Base value type associated to leaf.
Definition: RuleLeafValueComparison.h:145
Predefined macros for enumerates management.