IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LeafPropertyRuleOperators.h
Go to the documentation of this file.
1 // LeafPropertyRuleOperators.h:
3 // ----------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_LEAFPROPERTYRULEOPERATORS_H__
17 #define __IPSDKBASEPROCESSING_LEAFPROPERTYRULEOPERATORS_H__
18 
20 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/Leaf/LeafProperty/RuleLeafProperty.h>
21 
22 namespace ipsdk {
23 namespace processor {
24 
27 
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 isOdd(const boost::shared_ptr<AttributeType>& pAttribute)
37 {
38  return isOdd<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute));
39 }
40 
41 template <typename LeafType, typename AttributeType>
42 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
43  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
44  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
45  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
46  RulePtr>::type
47 isOdd(const boost::weak_ptr<const AttributeType>& pAttribute)
48 {
50  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
51  pOutputRule->init(pAttribute);
52 
53  return pOutputRule;
54 }
56 
59 template <typename LeafType, typename AttributeType>
60 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
61  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
62  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
63  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
64  RulePtr>::type
65 isEven(const boost::shared_ptr<AttributeType>& pAttribute)
66 {
67  return isEven<LeafType>(boost::weak_ptr<const AttributeType>(pAttribute));
68 }
69 
70 template <typename LeafType, typename AttributeType>
71 inline typename boost::enable_if<typename boost::mpl::and_<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
72  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
73  typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
74  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type>::type,
75  RulePtr>::type
76 isEven(const boost::weak_ptr<const AttributeType>& pAttribute)
77 {
79  boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
80  pOutputRule->init(pAttribute);
81 
82  return pOutputRule;
83 }
85 
88 
89 } // end of namespace processor
90 } // end of namespace ipsdk
91 
92 #endif // __IPSDKBASEPROCESSING_LEAFPROPERTYRULEOPERATORS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base operators used to combined rules.
Concrete class for rule allowing to check properties of leafs of data item attributes.
Definition: RuleLeafProperty.h:30
void init(const boost::weak_ptr< const AttributeType > &pAttribute)
initialization of object
Definition: RuleLeafProperty.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_< 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