16 #ifndef __IPSDKBASEPROCESSING_VALUECOMPARISONRULEOPERATORS_H__ 17 #define __IPSDKBASEPROCESSING_VALUECOMPARISONRULEOPERATORS_H__ 20 #include <IPSDKBaseProcessing/Rule/Attribute/Value/ValueComparison/RuleValueComparison.h> 21 #include <IPSDKBaseProcessing/Attribute/Value/BaseValueAttribute.h> 31 template <
typename AttributeType>
32 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
33 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
35 operator== (
const boost::shared_ptr<AttributeType>& pAttribute,
36 const typename AttributeType::ValueType& value)
38 return isEqual(boost::weak_ptr<AttributeType>(pAttribute), value);
41 template <
typename AttributeType>
42 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
43 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
45 isEqual(
const boost::weak_ptr<AttributeType>& pAttribute,
46 const typename AttributeType::ValueType& value)
49 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
50 pOutputRule->
init(pAttribute, value);
61 template <
typename AttributeType>
62 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
63 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
65 operator!= (
const boost::shared_ptr<AttributeType>& pAttribute,
66 const typename AttributeType::ValueType& value)
68 return isNotEqual(boost::weak_ptr<AttributeType>(pAttribute), value);
71 template <
typename AttributeType>
72 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
73 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
75 isNotEqual(
const boost::weak_ptr<AttributeType>& pAttribute,
76 const typename AttributeType::ValueType& value)
79 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
80 pOutputRule->
init(pAttribute, value);
91 template <
typename AttributeType>
92 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
93 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
95 operator> (
const boost::shared_ptr<AttributeType>& pAttribute,
96 const typename AttributeType::ValueType& value)
98 return isGreater(boost::weak_ptr<AttributeType>(pAttribute), value);
101 template <
typename AttributeType>
102 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
103 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
105 isGreater(
const boost::weak_ptr<AttributeType>& pAttribute,
106 const typename AttributeType::ValueType& value)
109 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
110 pOutputRule->
init(pAttribute, value);
121 template <
typename AttributeType>
122 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
123 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
125 operator< (const boost::shared_ptr<AttributeType>& pAttribute,
126 const typename AttributeType::ValueType& value)
128 return isLower(boost::weak_ptr<AttributeType>(pAttribute), value);
131 template <
typename AttributeType>
132 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
133 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
135 isLower(
const boost::weak_ptr<AttributeType>& pAttribute,
136 const typename AttributeType::ValueType& value)
139 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
140 pOutputRule->
init(pAttribute, value);
152 template <
typename AttributeType>
153 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
154 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
156 operator>= (
const boost::shared_ptr<AttributeType>& pAttribute,
157 const typename AttributeType::ValueType& value)
162 template <
typename AttributeType>
163 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
164 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
167 const typename AttributeType::ValueType& value)
170 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
171 pOutputRule->
init(pAttribute, value);
183 template <
typename AttributeType>
184 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
185 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
187 operator<= (const boost::shared_ptr<AttributeType>& pAttribute,
188 const typename AttributeType::ValueType& value)
190 return isLowerOrEqual(boost::weak_ptr<AttributeType>(pAttribute), value);
193 template <
typename AttributeType>
194 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
195 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
198 const typename AttributeType::ValueType& value)
201 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
202 pOutputRule->
init(pAttribute, value);
214 #endif // __IPSDKBASEPROCESSING_VALUECOMPARISONRULEOPERATORS_H__ boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType1::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< boost::mpl::int_< AttributeType2::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< typename AttributeType1::ValueType, typename AttributeType2::ValueType >::type >::type, RulePtr >::type operator>=(const boost::shared_ptr< AttributeType1 > &pAttribute1, const boost::shared_ptr< AttributeType2 > &pAttribute2)
Definition: AttributeComparisonRuleOperators.h:195
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isGreater(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is greater than another.
Definition: LeafsComparisonRuleOperators.h:170
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base operators used to combined rules.
void init(const boost::weak_ptr< const AttributeType > &pAttribute, const ValueType &value)
initialization of object
Definition: RuleValueComparison.h:64
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isNotEqual(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is not equal to another.
Definition: LeafsComparisonRuleOperators.h:106
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType1::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< boost::mpl::int_< AttributeType2::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< typename AttributeType1::ValueType, typename AttributeType2::ValueType >::type >::type, RulePtr >::type operator==(const boost::shared_ptr< AttributeType1 > &pAttribute1, const boost::shared_ptr< AttributeType2 > &pAttribute2)
Rule allowing to check whether a value attribute is equal to another.
Definition: AttributeComparisonRuleOperators.h:38
boost::shared_ptr< BaseRule > RulePtr
shared pointer to rule
Definition: RuleTypes.h:104
Concrete class for rules allowing to compare an attribute value with a given value.
Definition: RuleValueComparison.h:29
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isGreaterOrEqual(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is greater or equal to another.
Definition: LeafsComparisonRuleOperators.h:298
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType1::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< boost::mpl::int_< AttributeType2::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< typename AttributeType1::ValueType, typename AttributeType2::ValueType >::type >::type, RulePtr >::type operator!=(const boost::shared_ptr< AttributeType1 > &pAttribute1, const boost::shared_ptr< AttributeType2 > &pAttribute2)
Rule allowing to check whether a value attribute is not equal another.
Definition: AttributeComparisonRuleOperators.h:77
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isLower(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is lower than another.
Definition: LeafsComparisonRuleOperators.h:234
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isEqual(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is equal to another.
Definition: LeafsComparisonRuleOperators.h:42
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafType1::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename boost::is_same< boost::mpl::int_< LeafType2::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isLowerOrEqual(const boost::shared_ptr< AttributeType > &pAttribute)
Rule allowing to check whether a DataItem Leaf is lower or equal to another.
Definition: LeafsComparisonRuleOperators.h:362
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType1::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< boost::mpl::int_< AttributeType2::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_Value > >::type, typename boost::is_same< typename AttributeType1::ValueType, typename AttributeType2::ValueType >::type >::type, RulePtr >::type operator>(const boost::shared_ptr< AttributeType1 > &pAttribute1, const boost::shared_ptr< AttributeType2 > &pAttribute2)
Rule allowing to check whether a value attribute is greater than another.
Definition: AttributeComparisonRuleOperators.h:116