IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseTLeafValueComparisonRule.h
1 // BaseTLeafValueComparisonRule.h:
3 // -------------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_BASETLEAFVALUECOMPARISONRULE_H__
17 #define __IPSDKBASEPROCESSING_BASETLEAFVALUECOMPARISONRULE_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::processor::BaseTLeafValueComparisonRule<std::string,eVCRT_Equal>::_value' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'ipsdk::processor::BaseTLeafValueComparisonRule<std::string,eVCRT_Equal>'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/Leaf/LeafValueComparison/BaseLeafValueComparisonRule.h>
25 
26 namespace ipsdk {
27 namespace processor {
28 
31 
32 template <typename T, eValueComparisonRuleType::domain ValueComparisonRuleType>
34 {
35 // predefined public types
36 public:
38  typedef T ValueType;
39 
41  static const eValueComparisonRuleType::domain g_valueComparisonRuleType = ValueComparisonRuleType;
42 
43 public:
47  virtual ~BaseTLeafValueComparisonRule() = 0;
49 
50 // methods
51 public:
53  inline eValueComparisonRuleType getValueComparisonRuleType() const;
54 
58  const T& getValue() const;
59 
60 protected:
64  void initBase(const AttributeConstWeakPtr& pAttribute,
65  const T& value);
66 
68  virtual std::string getAttributeName() const = 0;
69 
71  virtual T getAttributeValue() const = 0;
72 
73 private:
75  bool testRule() const;
76 
78  std::string createRuleFormalString() const;
79 
81  std::string createRuleEvaluatedString(const ipUInt32 increment) const;
82 
83 // attributes
84 protected:
86  T _value;
87 };
88 
91 
92 template <typename T, eValueComparisonRuleType::domain ValueComparisonRuleType>
95 {
96  return g_valueComparisonRuleType;
97 }
98 
101 
102 } // end of namespace processor
103 } // end of namespace ipsdk
104 
105 #pragma warning (pop)
106 
107 #endif // __IPSDKBASEPROCESSING_BASETLEAFVALUECOMPARISONRULE_H__
T ValueType
underlying type associated to attribute
Definition: BaseTLeafValueComparisonRule.h:38
T _value
value associated to rule
Definition: BaseTLeafValueComparisonRule.h:86
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
eValueComparisonRuleType
enumerate describing value comparison rule operation type
Definition: RuleTypes.h:56
Base template class for rule allowing to compare leaf value of data item attributes with a given valu...
Definition: BaseTLeafValueComparisonRule.h:33
eValueComparisonRuleType getValueComparisonRuleType() const
retrieve value comparison rule operation type
Definition: BaseTLeafValueComparisonRule.h:94
Base class for rule allowing to compare leaf value of data item attributes with a given value...
Definition: BaseLeafValueComparisonRule.h:27
boost::weak_ptr< const BaseAttribute > AttributeConstWeakPtr
weak pointer to const attribute object
Definition: AttributeTypes.h:61
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53