IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RuleMatchLeafToStripRange.h
1 // RuleMatchLeafToStripRange.h:
3 // ----------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_RULEMATCHLEAFTOSTRIPRANGE_H__
17 #define __IPSDKIMAGEPROCESSING_RULEMATCHLEAFTOSTRIPRANGE_H__
18 
19 #include <IPSDKImageProcessing/Rule/Strip/StripBinaryMixed/BaseRuleMatchStripRange.h>
20 
21 namespace ipsdk {
22 namespace imaproc {
23 
26 
27 template <typename AttributeType, typename LeafType>
29 {
30 // predefined public types
31 public:
33  typedef AttributeType ValueAttributeType;
34 
36  typedef typename ValueAttributeType::ValueType DataItemType;
37 
39  typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
40  boost::mpl::int_<eDataItemType::eDIT_Leaf> >::type,
41  typename LeafType::ValueType>::type ValueType;
42 
43 public:
49 
50 // methods
51 public:
57  void init(const StripAttributeConstWeakPtr& pStripAttribute,
58  const boost::weak_ptr<const AttributeType>& pValueAttribute);
59 
60 protected:
62  ipReal64 retrieveValue() const;
63 
65  std::string retrieveValueAttributeName() const;
66 
67 // attributes
68 protected:
69 
70 };
71 
74 
75 template <typename AttributeType, typename LeafType>
76 inline void
78  const boost::weak_ptr<const AttributeType>& pValueAttribute)
79 {
80  // call of base class initialization method
81  BaseRuleMatchStripRange::initBase(pStripAttribute, pValueAttribute);
82 }
83 
84 template <typename AttributeType, typename LeafType>
85 inline ipReal64
87 {
88  // retrieve associated attribute
89  const AttributeType& derivedAttribute = static_cast<const AttributeType&>(getAttribute2());
90 
91  return derivedAttribute.getNode().template getValue<LeafType>();
92 }
93 
94 template <typename AttributeType, typename LeafType>
95 inline std::string
97 {
98  return ValueAttributeType::getObjectNameStr() + "::" +
99  DataItemType::template getNodeNameStr<LeafType>();
100 }
101 
104 
105 } // end of namespace imaproc
106 } // end of namespace ipsdk
107 
108 #endif // __IPSDKIMAGEPROCESSING_RULEMATCHLEAFTOSTRIPRANGE_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: RuleMatchLeafToStripRange.h:96
AttributeType ValueAttributeType
Value attribute type.
Definition: RuleMatchLeafToStripRange.h:33
ValueAttributeType::ValueType DataItemType
retrieve DataItem node type associated to attribute
Definition: RuleMatchLeafToStripRange.h:36
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Rule class allowing to check that a DataItem leaf value is inside a strip buffer type value range...
Definition: RuleMatchLeafToStripRange.h:28
void initBase()
base class initialization method
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_Leaf > >::type, typename LeafType::ValueType >::type ValueType
Value type associated to leaf.
Definition: RuleMatchLeafToStripRange.h:41
boost::weak_ptr< const BaseStripAttribute > StripAttributeConstWeakPtr
weak pointer to image strip attribute
Definition: StripAttributeTypes.h:80
ipReal64 retrieveValue() const
method allowing to retrieve value associated to attribute leaf in derived class
Definition: RuleMatchLeafToStripRange.h:86
void init(const StripAttributeConstWeakPtr &pStripAttribute, const boost::weak_ptr< const AttributeType > &pValueAttribute)
initialization of object
Definition: RuleMatchLeafToStripRange.h:77
Base class for rules allowing to check that a value is inside a strip buffer type value range...
Definition: BaseRuleMatchStripRange.h:27