IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LeafValueComparisonRuleOperators.h
Go to the documentation of this file.
1 // LeafValueComparisonRuleOperators.h:
3 // -----------------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_LEAFVALUECOMPARISONRULEOPERATORS_H__
17 #define __IPSDKBASEPROCESSING_LEAFVALUECOMPARISONRULEOPERATORS_H__
18 
20 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/Leaf/LeafValueComparison/RuleLeafValueComparison.h>
21 
22 namespace ipsdk {
23 namespace processor {
24 
28 
30 template <typename LeafType, typename AttributeType>
31 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
32  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
33  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
34  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
35  RulePtr>::type
36 isEqual(const boost::shared_ptr<AttributeType>& pAttribute,
37  const typename LeafType::ValueType& value)
38 {
39  return isEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
40 }
41 
42 template <typename LeafType, typename AttributeType>
43 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
44  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
45  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
46  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
47  RulePtr>::type
48 isEqual(const boost::weak_ptr<AttributeType>& pAttribute,
49  const typename LeafType::ValueType& value)
50 {
52  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
53  pOutputRule->init(pAttribute, value);
54 
55  return pOutputRule;
56 }
58 
62 
64 template <typename LeafType, typename AttributeType>
65 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
66  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
67  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
68  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
69  RulePtr>::type
70 isNotEqual(const boost::shared_ptr<AttributeType>& pAttribute,
71  const typename LeafType::ValueType& value)
72 {
73  return isNotEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
74 }
75 
76 template <typename LeafType, typename AttributeType>
77 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
78  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
79  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
80  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
81  RulePtr>::type
82 isNotEqual(const boost::weak_ptr<AttributeType>& pAttribute,
83  const typename LeafType::ValueType& value)
84 {
86  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
87  pOutputRule->init(pAttribute, value);
88 
89  return pOutputRule;
90 }
92 
96 
98 template <typename LeafType, typename AttributeType>
99 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
100  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
101  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
102  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
103  RulePtr>::type
104 isGreater(const boost::shared_ptr<AttributeType>& pAttribute,
105  const typename LeafType::ValueType& value)
106 {
107  return isGreater<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
108 }
109 
110 template <typename LeafType, typename AttributeType>
111 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
112  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
113  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
114  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
115  RulePtr>::type
116 isGreater(const boost::weak_ptr<AttributeType>& pAttribute,
117  const typename LeafType::ValueType& value)
118 {
120  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
121  pOutputRule->init(pAttribute, value);
122 
123  return pOutputRule;
124 }
126 
130 
132 template <typename LeafType, typename AttributeType>
133 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
134  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
135  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
136  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
137  RulePtr>::type
138 isLower(const boost::shared_ptr<AttributeType>& pAttribute,
139  const typename LeafType::ValueType& value)
140 {
141  return isLower<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
142 }
143 
144 template <typename LeafType, typename AttributeType>
145 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
146  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
147  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
148  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
149  RulePtr>::type
150 isLower(const boost::weak_ptr<AttributeType>& pAttribute,
151  const typename LeafType::ValueType& value)
152 {
154  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
155  pOutputRule->init(pAttribute, value);
156 
157  return pOutputRule;
158 }
160 
164 
166 template <typename LeafType, typename AttributeType>
167 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
168  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
169  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
170  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
171  RulePtr>::type
172 isGreaterOrEqual(const boost::shared_ptr<AttributeType>& pAttribute,
173  const typename LeafType::ValueType& value)
174 {
175  return isGreaterOrEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
176 }
177 
178 template <typename LeafType, typename AttributeType>
179 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
180  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
181  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
182  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
183  RulePtr>::type
184 isGreaterOrEqual(const boost::weak_ptr<AttributeType>& pAttribute,
185  const typename LeafType::ValueType& value)
186 {
188  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
189  pOutputRule->init(pAttribute, value);
190 
191  return pOutputRule;
192 }
194 
198 
200 template <typename LeafType, typename AttributeType>
201 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
202  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
203  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
204  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
205  RulePtr>::type
206 isLowerOrEqual(const boost::shared_ptr<AttributeType>& pAttribute,
207  const typename LeafType::ValueType& value)
208 {
209  return isLowerOrEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
210 }
211 
212 template <typename LeafType, typename AttributeType>
213 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
214  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
215  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
216  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
217  RulePtr>::type
218 isLowerOrEqual(const boost::weak_ptr<AttributeType>& pAttribute,
219  const typename LeafType::ValueType& value)
220 {
222  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
223  pOutputRule->init(pAttribute, value);
224 
225  return pOutputRule;
226 }
228 
231 
232 } // end of namespace processor
233 } // end of namespace ipsdk
234 
235 #endif // __IPSDKBASEPROCESSING_LEAFVALUECOMPARISONRULEOPERATORS_H__
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::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
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 rule allowing to compare leaf value of data item attributes with a given value...
Definition: RuleLeafValueComparison.h:32
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