IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RuleMatchValueToImageRange.h
1 // RuleMatchValueToImageRange.h:
3 // -----------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_RULEMATCHVALUETOIMAGERANGE_H__
17 #define __IPSDKIMAGEPROCESSING_RULEMATCHVALUETOIMAGERANGE_H__
18 
19 #include <IPSDKImageProcessing/Rule/Image/ImageBinaryMixed/BaseRuleMatchImageRange.h>
20 #include <IPSDKImageProcessing/Attribute/Image/BaseImageAttribute.h>
21 
22 namespace ipsdk {
23 namespace imaproc {
24 
27 
28 template <typename AttributeType>
30 {
31 // predefined public types
32 public:
34  typedef AttributeType ValueAttributeType;
35 
36 public:
42 
43 // methods
44 public:
50  void init(const ImageAttributeConstWeakPtr& pImageAttribute,
51  const boost::weak_ptr<const AttributeType>& pValueAttribute);
52 
53 protected:
55  ipReal64 retrieveValue() const;
56 
58  std::string retrieveValueAttributeName() const;
59 
60 // attributes
61 protected:
62 
63 };
64 
67 
68 template <typename AttributeType>
69 inline void
71  const boost::weak_ptr<const AttributeType>& pValueAttribute)
72 {
73  // call of base class initialization method
74  BaseRuleMatchImageRange::initBase(pImageAttribute, pValueAttribute);
75 }
76 
77 template <typename AttributeType>
78 inline ipReal64
80 {
81  // retrieve associated attribute
82  const AttributeType& valueAttribute = static_cast<const AttributeType&>(getAttribute2());
83 
84  return valueAttribute.getValue();
85 }
86 
87 template <typename AttributeType>
88 inline std::string
90 {
91  // retrieve associated attribute
92  const AttributeType& valueAttribute = static_cast<const AttributeType&>(getAttribute2());
93 
94  return valueAttribute.getObjectName();
95 }
96 
99 
100 } // end of namespace imaproc
101 } // end of namespace ipsdk
102 
103 #endif // __IPSDKIMAGEPROCESSING_RULEMATCHVALUETOIMAGERANGE_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
std::string retrieveValueAttributeName() const
method allowing to retrieve value associated to attribute leaf in derived class
Definition: RuleMatchValueToImageRange.h:89
boost::weak_ptr< const BaseImageAttribute > ImageAttributeConstWeakPtr
Definition: ImageAttributeTypes.h:38
AttributeType ValueAttributeType
Value attribute type.
Definition: RuleMatchValueToImageRange.h:34
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
void initBase()
base class initialization method
Rule class allowing to check that a value is inside an image buffer type value range.
Definition: RuleMatchValueToImageRange.h:29
void init(const ImageAttributeConstWeakPtr &pImageAttribute, const boost::weak_ptr< const AttributeType > &pValueAttribute)
initialization of object
Definition: RuleMatchValueToImageRange.h:70
ipReal64 retrieveValue() const
method allowing to retrieve value associated to attribute leaf in derived class
Definition: RuleMatchValueToImageRange.h:79
Base class for rules allowing to check that a value is inside an image buffer type value range...
Definition: BaseRuleMatchImageRange.h:27