IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseTValueComparisonRule.h
1 // BaseTValueComparisonRule.h:
3 // ---------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_BASETVALUECOMPARISONRULE_H__
17 #define __IPSDKBASEPROCESSING_BASETVALUECOMPARISONRULE_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::processor::BaseTValueComparisonRule<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::BaseTValueComparisonRule<std::string,eVCRT_Equal>'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKBaseProcessing/Rule/Attribute/Value/ValueComparison/BaseValueComparisonRule.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 
42 
44  static const eValueComparisonRuleType::domain g_valueComparisonRuleType = ValueComparisonRuleType;
45 
46 public:
50  virtual ~BaseTValueComparisonRule() = 0;
52 
53 // methods
54 public:
56  inline eValueComparisonRuleType getValueComparisonRuleType() const;
57 
61  const T& getValue() const;
62 
63 protected:
67  void initBase(const AttributeConstWeakPtr& pAttribute,
68  const T& value);
69 
70 private:
72  bool testRule() const;
73 
75  std::string createRuleFormalString() const;
76 
78  std::string createRuleEvaluatedString(const ipUInt32 increment) const;
79 
80 // attributes
81 protected:
83  T _value;
84 };
85 
88 
89 template <typename T, eValueComparisonRuleType::domain ValueComparisonRuleType>
92 {
93  return g_valueComparisonRuleType;
94 }
95 
98 
99 } // end of namespace processor
100 } // end of namespace ipsdk
101 
102 #pragma warning (pop)
103 
104 #endif // __IPSDKBASEPROCESSING_BASETVALUECOMPARISONRULE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
eValueComparisonRuleType getValueComparisonRuleType() const
retrieve value comparison rule operation type
Definition: BaseTValueComparisonRule.h:91
eValueComparisonRuleType
enumerate describing value comparison rule operation type
Definition: RuleTypes.h:56
BaseValueAttribute< T > BaseAttributeType
base attribute type associated to rule
Definition: BaseTValueComparisonRule.h:41
Base class for value attributes.
Definition: BaseValueAttribute.h:33
Base class for rules allowing to compare an attribute value with a given value.
Definition: BaseValueComparisonRule.h:27
Base template class for rules allowing to compare an attribute value with a given value...
Definition: BaseTValueComparisonRule.h:33
T ValueType
underlying type associated to attribute
Definition: BaseTValueComparisonRule.h:38
boost::weak_ptr< const BaseAttribute > AttributeConstWeakPtr
weak pointer to const attribute object
Definition: AttributeTypes.h:61
T _value
value associated to rule
Definition: BaseTValueComparisonRule.h:83
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53