IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ValuePropertyRuleOperators.h
Go to the documentation of this file.
1 // ValuePropertyRuleOperators.h:
3 // -----------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_VALUEPROPERTYRULEOPERATORS_H__
17 #define __IPSDKBASEPROCESSING_VALUEPROPERTYRULEOPERATORS_H__
18 
20 #include <IPSDKBaseProcessing/Rule/Attribute/Value/ValueProperty/RuleValueProperty.h>
21 #include <IPSDKBaseProcessing/Attribute/Value/BaseValueAttribute.h>
22 
23 namespace ipsdk {
24 namespace processor {
25 
27 // Attribute value property check rules
29 
32 template <typename AttributeType>
33 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
34  boost::mpl::int_<eAttributeType::eAT_Value> >::type,
35  RulePtr>::type
36 isOdd(const boost::shared_ptr<AttributeType>& pAttribute)
37 {
38  return isOdd(boost::weak_ptr<AttributeType>(pAttribute));
39 }
40 
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,
44  RulePtr>::type
45 isOdd(const boost::weak_ptr<AttributeType>& pAttribute)
46 {
48  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
49  pOutputRule->init(pAttribute);
50 
51  return pOutputRule;
52 }
54 
57 template <typename AttributeType>
58 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
59  boost::mpl::int_<eAttributeType::eAT_Value> >::type,
60  RulePtr>::type
61 isEven(const boost::shared_ptr<const AttributeType>& pAttribute)
62 {
63  return isEven(boost::weak_ptr<AttributeType>(pAttribute));
64 }
65 
66 template <typename AttributeType>
67 inline typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
68  boost::mpl::int_<eAttributeType::eAT_Value> >::type,
69  RulePtr>::type
70 isEven(const boost::weak_ptr<AttributeType>& pAttribute)
71 {
73  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
74  pOutputRule->init(pAttribute);
75 
76  return pOutputRule;
77 }
79 
82 
83 } // end of namespace processor
84 } // end of namespace ipsdk
85 
86 #endif // __IPSDKBASEPROCESSING_VALUEPROPERTYRULEOPERATORS_H__
void init(const boost::weak_ptr< const AttributeType > &pAttribute)
initialization of object
Definition: RuleValueProperty.h:63
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_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isEven(const boost::shared_ptr< AttributeType > &pAttribute)
functions allowing to check whether attribute value is even
Definition: LeafPropertyRuleOperators.h:65
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_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type >::type, RulePtr >::type isOdd(const boost::shared_ptr< AttributeType > &pAttribute)
functions allowing to check whether attribute value is odd
Definition: LeafPropertyRuleOperators.h:36
Concrete class for rules allowing to check attributes value properties.
Definition: RuleValueProperty.h:29