15 #ifndef __IPSDKBASEPROCESSING_ATTRIBUTECOMPARISONRULEOPERATORS_H__ 16 #define __IPSDKBASEPROCESSING_ATTRIBUTECOMPARISONRULEOPERATORS_H__ 19 #include <IPSDKBaseProcessing/Rule/Attribute/Value/AttributeComparison/RuleAttributeComparison.h> 20 #include <IPSDKBaseProcessing/Attribute/Value/BaseValueAttribute.h> 30 template <
typename AttributeType1,
typename AttributeType2>
31 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
32 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
33 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
34 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
35 typename boost::is_same<
typename AttributeType1::ValueType,
36 typename AttributeType2::ValueType>::type>::type,
38 operator== (
const boost::shared_ptr<AttributeType1>& pAttribute1,
39 const boost::shared_ptr<AttributeType2>& pAttribute2)
41 return isEqual(boost::weak_ptr<AttributeType1>(pAttribute1),
42 boost::weak_ptr<AttributeType2>(pAttribute2));
45 template <
typename AttributeType1,
typename AttributeType2>
46 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
47 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
48 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
49 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
50 typename boost::is_same<
typename AttributeType1::ValueType,
51 typename AttributeType2::ValueType>::type>::type,
53 isEqual(
const boost::weak_ptr<AttributeType1>& pAttribute1,
54 const boost::weak_ptr<AttributeType2>& pAttribute2)
57 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
58 pOutputRule->
init(pAttribute1, pAttribute2);
69 template <
typename AttributeType1,
typename AttributeType2>
70 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
71 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
72 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
73 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
74 typename boost::is_same<
typename AttributeType1::ValueType,
75 typename AttributeType2::ValueType>::type>::type,
77 operator!= (
const boost::shared_ptr<AttributeType1>& pAttribute1,
78 const boost::shared_ptr<AttributeType2>& pAttribute2)
80 return isNotEqual(boost::weak_ptr<AttributeType1>(pAttribute1),
81 boost::weak_ptr<AttributeType2>(pAttribute2));
84 template <
typename AttributeType1,
typename AttributeType2>
85 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
86 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
87 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
88 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
89 typename boost::is_same<
typename AttributeType1::ValueType,
90 typename AttributeType2::ValueType>::type>::type,
92 isNotEqual(
const boost::weak_ptr<AttributeType1>& pAttribute1,
93 const boost::weak_ptr<AttributeType2>& pAttribute2)
96 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
97 pOutputRule->
init(pAttribute1, pAttribute2);
108 template <
typename AttributeType1,
typename AttributeType2>
109 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
110 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
111 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
112 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
113 typename boost::is_same<
typename AttributeType1::ValueType,
114 typename AttributeType2::ValueType>::type>::type,
116 operator> (
const boost::shared_ptr<AttributeType1>& pAttribute1,
117 const boost::shared_ptr<AttributeType2>& pAttribute2)
119 return isGreater(boost::weak_ptr<AttributeType1>(pAttribute1),
120 boost::weak_ptr<AttributeType2>(pAttribute2));
123 template <
typename AttributeType1,
typename AttributeType2>
124 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
125 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
126 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
127 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
128 typename boost::is_same<
typename AttributeType1::ValueType,
129 typename AttributeType2::ValueType>::type>::type,
131 isGreater(
const boost::weak_ptr<AttributeType1>& pAttribute1,
132 const boost::weak_ptr<AttributeType2>& pAttribute2)
135 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
136 pOutputRule->
init(pAttribute1, pAttribute2);
147 template <
typename AttributeType1,
typename AttributeType2>
148 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
149 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
150 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
151 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
152 typename boost::is_same<
typename AttributeType1::ValueType,
153 typename AttributeType2::ValueType>::type>::type,
155 operator< (const boost::shared_ptr<AttributeType1>& pAttribute1,
156 const boost::shared_ptr<AttributeType2>& pAttribute2)
158 return isLower(boost::weak_ptr<AttributeType1>(pAttribute1),
159 boost::weak_ptr<AttributeType2>(pAttribute2));
162 template <
typename AttributeType1,
typename AttributeType2>
163 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
164 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
165 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
166 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
167 typename boost::is_same<
typename AttributeType1::ValueType,
168 typename AttributeType2::ValueType>::type>::type,
170 isLower(
const boost::weak_ptr<AttributeType1>& pAttribute1,
171 const boost::weak_ptr<AttributeType2>& pAttribute2)
174 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
175 pOutputRule->
init(pAttribute1, pAttribute2);
187 template <
typename AttributeType1,
typename AttributeType2>
188 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
189 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
190 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
191 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
192 typename boost::is_same<
typename AttributeType1::ValueType,
193 typename AttributeType2::ValueType>::type>::type,
195 operator>= (
const boost::shared_ptr<AttributeType1>& pAttribute1,
196 const boost::shared_ptr<AttributeType2>& pAttribute2)
199 boost::weak_ptr<AttributeType2>(pAttribute2));
202 template <
typename AttributeType1,
typename AttributeType2>
203 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
204 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
205 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
206 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
207 typename boost::is_same<
typename AttributeType1::ValueType,
208 typename AttributeType2::ValueType>::type>::type,
211 const boost::weak_ptr<AttributeType2>& pAttribute2)
214 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
215 pOutputRule->
init(pAttribute1, pAttribute2);
227 template <
typename AttributeType1,
typename AttributeType2>
228 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
229 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
230 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
231 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
232 typename boost::is_same<
typename AttributeType1::ValueType,
233 typename AttributeType2::ValueType>::type>::type,
235 operator<= (const boost::shared_ptr<AttributeType1>& pAttribute1,
236 const boost::shared_ptr<AttributeType2>& pAttribute2)
238 return isLowerOrEqual(boost::weak_ptr<AttributeType1>(pAttribute1),
239 boost::weak_ptr<AttributeType2>(pAttribute2));
242 template <
typename AttributeType1,
typename AttributeType2>
243 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType1::g_attributeType>,
244 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
245 typename boost::is_same<boost::mpl::int_<AttributeType2::g_attributeType>,
246 boost::mpl::int_<eAttributeType::eAT_Value> >::type,
247 typename boost::is_same<
typename AttributeType1::ValueType,
248 typename AttributeType2::ValueType>::type>::type,
251 const boost::weak_ptr<AttributeType2>& pAttribute2)
254 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
255 pOutputRule->
init(pAttribute1, pAttribute2);
267 #endif // __IPSDKBASEPROCESSING_ATTRIBUTECOMPARISONRULEOPERATORS_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.
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
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
void init(const boost::weak_ptr< const AttributeType1 > &pAttribute1, const boost::weak_ptr< const AttributeType2 > &pAttribute2)
initialization of object
Definition: RuleAttributeComparison.h:75
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
Concrete class for rules allowing to compare attributes value.
Definition: RuleAttributeComparison.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 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