IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LeafCollValueComparisonRuleOperators.h
Go to the documentation of this file.
1 // LeafCollValueComparisonRuleOperators.h:
3 // ---------------------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_LEAFCOLLVALUECOMPARISONRULEOPERATORS_H__
17 #define __IPSDKBASEPROCESSING_LEAFCOLLVALUECOMPARISONRULEOPERATORS_H__
18 
20 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/LeafColl/LeafCollValueComparison/RuleLeafCollValueComparison.h>
21 
22 namespace ipsdk {
23 namespace processor {
24 
27 
31 
33 template <typename LeafType, typename AttributeType>
34 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
35  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
36  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
37  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
38  RulePtr>::type
39 isEqual(const boost::shared_ptr<AttributeType>& pAttribute,
40  const typename LeafType::ValueType& value)
41 {
42  return isEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
43 }
44 
45 template <typename LeafType, typename AttributeType>
46 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
47  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
48  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
49  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
50  RulePtr>::type
51 isEqual(const boost::weak_ptr<AttributeType>& pAttribute,
52  const typename LeafType::ValueType& value)
53 {
55  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
56  pOutputRule->init(pAttribute, value);
57 
58  return pOutputRule;
59 }
61 
65 
67 template <typename LeafType, typename AttributeType>
68 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
69  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
70  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
71  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
72  RulePtr>::type
73 isNotEqual(const boost::shared_ptr<AttributeType>& pAttribute,
74  const typename LeafType::ValueType& value)
75 {
76  return isNotEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
77 }
78 
79 template <typename LeafType, typename AttributeType>
80 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
81  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
82  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
83  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
84  RulePtr>::type
85 isNotEqual(const boost::weak_ptr<AttributeType>& pAttribute,
86  const typename LeafType::ValueType& value)
87 {
89  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
90  pOutputRule->init(pAttribute, value);
91 
92  return pOutputRule;
93 }
95 
99 
101 template <typename LeafType, typename AttributeType>
102 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
103  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
104  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
105  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
106  RulePtr>::type
107 isGreater(const boost::shared_ptr<AttributeType>& pAttribute,
108  const typename LeafType::ValueType& value)
109 {
110  return isGreater<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
111 }
112 
113 template <typename LeafType, typename AttributeType>
114 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
115  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
116  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
117  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
118  RulePtr>::type
119 isGreater(const boost::weak_ptr<AttributeType>& pAttribute,
120  const typename LeafType::ValueType& value)
121 {
123  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
124  pOutputRule->init(pAttribute, value);
125 
126  return pOutputRule;
127 }
129 
133 
135 template <typename LeafType, typename AttributeType>
136 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
137  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
138  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
139  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
140  RulePtr>::type
141 isLower(const boost::shared_ptr<AttributeType>& pAttribute,
142  const typename LeafType::ValueType& value)
143 {
144  return isLower<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
145 }
146 
147 template <typename LeafType, typename AttributeType>
148 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
149  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
150  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
151  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
152  RulePtr>::type
153 isLower(const boost::weak_ptr<AttributeType>& pAttribute,
154  const typename LeafType::ValueType& value)
155 {
157  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
158  pOutputRule->init(pAttribute, value);
159 
160  return pOutputRule;
161 }
163 
167 
169 template <typename LeafType, typename AttributeType>
170 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
171  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
172  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
173  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
174  RulePtr>::type
175 isGreaterOrEqual(const boost::shared_ptr<AttributeType>& pAttribute,
176  const typename LeafType::ValueType& value)
177 {
178  return isGreaterOrEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
179 }
180 
181 template <typename LeafType, typename AttributeType>
182 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
183  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
184  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
185  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
186  RulePtr>::type
187 isGreaterOrEqual(const boost::weak_ptr<AttributeType>& pAttribute,
188  const typename LeafType::ValueType& value)
189 {
191  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
192  pOutputRule->init(pAttribute, value);
193 
194  return pOutputRule;
195 }
197 
201 
203 template <typename LeafType, typename AttributeType>
204 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
205  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
206  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
207  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
208  RulePtr>::type
209 isLowerOrEqual(const boost::shared_ptr<AttributeType>& pAttribute,
210  const typename LeafType::ValueType& value)
211 {
212  return isLowerOrEqual<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute), value);
213 }
214 
215 template <typename LeafType, typename AttributeType>
216 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
217  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
218  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
219  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type>::type,
220  RulePtr>::type
221 isLowerOrEqual(const boost::weak_ptr<AttributeType>& pAttribute,
222  const typename LeafType::ValueType& value)
223 {
225  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
226  pOutputRule->init(pAttribute, value);
227 
228  return pOutputRule;
229 }
231 
234 
235 } // end of namespace processor
236 } // end of namespace ipsdk
237 
238 #endif // __IPSDKBASEPROCESSING_LEAFCOLLVALUECOMPARISONRULEOPERATORS_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
Concrete class for rule allowing to compare leaf value collection of data item attributes with a give...
Definition: RuleLeafCollValueComparison.h:30
void init(const boost::weak_ptr< const AttributeType > &pAttribute, const ValueType &value)
initialization of object
Definition: RuleLeafCollValueComparison.h:82
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
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