IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseTLeafCollValueComparisonRule.h
1 // BaseTLeafCollValueComparisonRule.h:
3 // -----------------------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_BASETLEAFCOLLVALUECOMPARISONRULE_H__
16 #define __IPSDKBASEPROCESSING_BASETLEAFCOLLVALUECOMPARISONRULE_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::processor::BaseTLeafCollValueComparisonRule<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::BaseTLeafCollValueComparisonRule<std::string,eVCRT_Equal>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/LeafColl/LeafCollValueComparison/BaseLeafCollValueComparisonRule.h>
24 
25 namespace ipsdk {
26 namespace processor {
27 
30 
31 template <typename T, eValueComparisonRuleType::domain ValueComparisonRuleType>
33 {
34 // predefined public types
35 public:
37  typedef T ValueType;
38 
40  typedef std::vector<T> LeafCollType;
41 
43  static const eValueComparisonRuleType::domain g_valueComparisonRuleType = ValueComparisonRuleType;
44 
45 public:
49  virtual ~BaseTLeafCollValueComparisonRule() = 0;
51 
52 // methods
53 public:
55  inline eValueComparisonRuleType getValueComparisonRuleType() const;
56 
60  const T& getValue() const;
61 
62 protected:
66  void initBase(const AttributeConstWeakPtr& pAttribute,
67  const T& value);
68 
70  virtual std::string getAttributeName() const = 0;
71 
73  virtual const LeafCollType& getAttributeLeafColl() const = 0;
74 
75 private:
77  bool testRule() const;
78 
80  std::string createRuleFormalString() const;
81 
83  std::string createRuleEvaluatedString(const ipUInt32 increment) const;
84 
85 // attributes
86 protected:
88  T _value;
89 };
90 
93 
94 template <typename T, eValueComparisonRuleType::domain ValueComparisonRuleType>
97 {
98  return g_valueComparisonRuleType;
99 }
100 
103 
104 } // end of namespace processor
105 } // end of namespace ipsdk
106 
107 #pragma warning (pop)
108 
109 #endif // __IPSDKBASEPROCESSING_BASETLEAFCOLLVALUECOMPARISONRULE_H__
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
std::vector< T > LeafCollType
underlying collection type associated to attribute
Definition: BaseTLeafCollValueComparisonRule.h:40
eValueComparisonRuleType getValueComparisonRuleType() const
retrieve value comparison rule operation type
Definition: BaseTLeafCollValueComparisonRule.h:96
T _value
value associated to rule
Definition: BaseTLeafCollValueComparisonRule.h:88
T ValueType
underlying type associated to attribute
Definition: BaseTLeafCollValueComparisonRule.h:37
Definition: BaseTLeafCollValueComparisonRule.h:32
Base class for rule allowing to compare leaf collection value of data item attributes with a given va...
Definition: BaseLeafCollValueComparisonRule.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