IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseTValueCustomPropertyRule.h
1 // BaseTValueCustomPropertyRule.h:
3 // -------------------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_BASETVALUECUSTOMPROPERTYRULE_H__
17 #define __IPSDKBASEPROCESSING_BASETVALUECUSTOMPROPERTYRULE_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::processor::BaseTValueCustomPropertyRule<T>::_customEvaluator' : class 'boost::function<ipsdk::BoolResult(const T &)>' needs to have dll-interface to be used by clients of class 'ipsdk::processor::BaseTValueCustomPropertyRule<T>'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
24 #include <IPSDKBaseProcessing/Rule/Attribute/Value/ValueCustomProperty/BaseValueCustomPropertyRule.h>
25 #include <boost/function.hpp>
26 
27 namespace ipsdk {
28 namespace processor {
29 
32 
33 template <typename T>
35 {
36 // predefined public types
37 public:
39  typedef T ValueType;
40 
43 
45  typedef boost::function<BoolResult (const T& value)> CustomEvaluator;
46 
47 public:
51  virtual ~BaseTValueCustomPropertyRule() = 0;
53 
54 // methods
55 public:
56 
57 protected:
59  void initBase(const AttributeConstWeakPtr& pAttribute,
60  const CustomEvaluator& customEvaluator);
61 
62 private:
64  bool testRule() const;
65 
67  std::string createRuleFormalString() const;
68 
70  std::string createRuleEvaluatedString(const ipUInt32 increment) const;
71 
72 // attributes
73 private:
75  CustomEvaluator _customEvaluator;
76 };
77 
80 
81 } // end of namespace processor
82 } // end of namespace ipsdk
83 
84 #pragma warning (pop)
85 
86 #endif // __IPSDKBASEPROCESSING_BASETVALUECUSTOMPROPERTYRULE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
T ValueType
underlying type associated to attribute
Definition: BaseTValueCustomPropertyRule.h:39
boost::function< BoolResult(const T &value)> CustomEvaluator
type associated to functions allowing to test attribute validity
Definition: BaseTValueCustomPropertyRule.h:45
Base class for value attributes.
Definition: BaseValueAttribute.h:33
Base class for rules allowing to check attributes value custom properties.
Definition: BaseValueCustomPropertyRule.h:27
Base template class for rules allowing to check attributes value custom properties.
Definition: BaseTValueCustomPropertyRule.h:34
BaseValueAttribute< T > BaseAttributeType
base attribute type associated to rule
Definition: BaseTValueCustomPropertyRule.h:42
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