15 #ifndef __IPSDKIMAGEPROCESSING_IPENUMRULEOPERATORS_H__ 16 #define __IPSDKIMAGEPROCESSING_IPENUMRULEOPERATORS_H__ 20 #include <IPSDKImageProcessing/Rule/IPEnum/RuleIPEnumValue.h> 21 #include <IPSDKImageProcessing/Attribute/IPEnum/IPEnumAttribute.h> 22 #include <boost/utility/enable_if.hpp> 23 #include <boost/type_traits/is_same.hpp> 24 #include <boost/mpl/equal_to.hpp> 25 #include <boost/mpl/and.hpp> 26 #include <boost/make_shared.hpp> 37 template <
typename AttributeType>
38 inline typename boost::enable_if<typename boost::mpl::equal_to<boost::mpl::int_<AttributeType::g_imageProcessingAttributeType>,
39 boost::mpl::int_<eImageProcessingAttributeType::eIPAT_IPEnum> >::type,
41 operator== (
const boost::shared_ptr<AttributeType>& pAttribute,
42 const typename AttributeType::ValueType& value)
44 return isEqual(boost::weak_ptr<AttributeType>(pAttribute), value);
47 template <
typename AttributeType>
48 inline typename boost::enable_if<typename boost::mpl::equal_to<boost::mpl::int_<AttributeType::g_imageProcessingAttributeType>,
49 boost::mpl::int_<eImageProcessingAttributeType::eIPAT_IPEnum> >::type,
51 isEqual(
const boost::weak_ptr<AttributeType>& pAttribute,
52 const typename AttributeType::ValueType& value)
55 boost::shared_ptr<RuleType> pOutputRule = boost::make_shared<RuleType>();
56 pOutputRule->
init(pAttribute, value);
65 template <
typename AttributeType>
66 inline typename boost::enable_if<typename boost::mpl::equal_to<boost::mpl::int_<AttributeType::g_imageProcessingAttributeType>,
67 boost::mpl::int_<eImageProcessingAttributeType::eIPAT_IPEnum> >::type,
69 operator!= (
const boost::shared_ptr<AttributeType>& pAttribute,
70 const typename AttributeType::ValueType& value)
72 return isEqual(boost::weak_ptr<AttributeType>(pAttribute), value);
75 template <
typename AttributeType>
76 inline typename boost::enable_if<typename boost::mpl::equal_to<boost::mpl::int_<AttributeType::g_imageProcessingAttributeType>,
77 boost::mpl::int_<eImageProcessingAttributeType::eIPAT_IPEnum> >::type,
79 isNotEqual(
const boost::weak_ptr<AttributeType>& pAttribute,
80 const typename AttributeType::ValueType& value)
92 #endif // __IPSDKIMAGEPROCESSING_IPENUMRULEOPERATORS_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base operators used to combined rules.
boost::enable_if< typename boost::mpl::equal_to< boost::mpl::int_< AttributeType::g_imageProcessingAttributeType >, boost::mpl::int_< eImageProcessingAttributeType::eIPAT_IPEnum > >::type, ipsdk::processor::RulePtr >::type isNotEqual(const boost::weak_ptr< AttributeType > &pAttribute, const typename AttributeType::ValueType &value)
Definition: IPEnumRuleOperators.h:79
boost::enable_if< typename boost::mpl::equal_to< boost::mpl::int_< AttributeType::g_imageProcessingAttributeType >, boost::mpl::int_< eImageProcessingAttributeType::eIPAT_IPEnum > >::type, ipsdk::processor::RulePtr >::type isEqual(const boost::weak_ptr< AttributeType > &pAttribute, const typename AttributeType::ValueType &value)
Definition: IPEnumRuleOperators.h:51
IPSDKBASEPROCESSING_API RulePtr Not(const RulePtr &pRule)
logical rule combination operators
boost::shared_ptr< BaseRule > RulePtr
shared pointer to rule
Definition: RuleTypes.h:104
Definition of import/export macro for library.
Definition: RuleIPEnumValue.h:28
boost::enable_if< typename boost::mpl::equal_to< boost::mpl::int_< AttributeType::g_imageProcessingAttributeType >, boost::mpl::int_< eImageProcessingAttributeType::eIPAT_IPEnum > >::type, ipsdk::processor::RulePtr >::type operator==(const boost::shared_ptr< AttributeType > &pAttribute, const typename AttributeType::ValueType &value)
Definition: IPEnumRuleOperators.h:41
boost::enable_if< typename boost::mpl::equal_to< boost::mpl::int_< AttributeType::g_imageProcessingAttributeType >, boost::mpl::int_< eImageProcessingAttributeType::eIPAT_IPEnum > >::type, ipsdk::processor::RulePtr >::type operator!=(const boost::shared_ptr< AttributeType > &pAttribute, const typename AttributeType::ValueType &value)
Definition: IPEnumRuleOperators.h:69
void init(const AttributeConstWeakPtr &pAttribute, const EnumType &enumValue)
initialization of object
Definition: RuleIPEnumValue.h:52