IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
RuleLeafCollProperty.h
1 // RuleLeafCollProperty.h:
3 // -----------------------
4 //
15 
16 #ifndef __IPSDKBASEPROCESSING_RULELEAFCOLLPROPERTY_H__
17 #define __IPSDKBASEPROCESSING_RULELEAFCOLLPROPERTY_H__
18 
19 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/LeafColl/LeafCollProperty/BaseTLeafCollPropertyRule.h>
20 
21 namespace ipsdk {
22 namespace processor {
23 
26 
27 template <typename AttributeType,
28  typename LeafType,
29  eValuePropertyRuleType::domain ValuePropertyRuleType>
30 class RuleLeafCollProperty : public BaseTLeafCollPropertyRule<typename LeafType::ValueType,
31  ValuePropertyRuleType>
32 {
33 // predefined public types
34 public:
36  typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
37  boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
38  typename AttributeType::ValueType>::type DataItemType;
39 
41  typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
42  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type,
43  typename LeafType::ValueType>::type ValueType;
44 
46  typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafType::g_itemType>,
47  boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type,
48  typename LeafType::CollType>::type CollType;
49 
50 public:
56 
57 // methods
58 public:
62  void init(const boost::weak_ptr<const AttributeType>& pAttribute);
63 
64 protected:
66  std::string getAttributeName() const;
67 
69  const CollType& getAttributeLeafColl() const;
70 
71 // attributes
72 protected:
73 
74 };
75 
78 
79 template <typename AttributeType, typename LeafType, eValuePropertyRuleType::domain ValuePropertyRuleType>
80 inline void
81 RuleLeafCollProperty<AttributeType, LeafType, ValuePropertyRuleType>::init(const boost::weak_ptr<const AttributeType>& pAttribute)
82 {
83  // call of base class initialization method
85 }
86 
87 template <typename AttributeType, typename LeafType, eValuePropertyRuleType::domain ValuePropertyRuleType>
88 inline std::string
90 {
91  return AttributeType::getObjectNameStr() + "::" +
92  DataItemType::template getNodeNameStr<LeafType>();
93 }
94 
95 template <typename AttributeType, typename LeafType, eValuePropertyRuleType::domain ValuePropertyRuleType>
98 {
99  // retrieve associated attribute
100  const AttributeType& derivedAttribute = static_cast<const AttributeType&>(this->getAttribute1());
101 
102  return derivedAttribute.getNode().template getLeafColl<LeafType>();
103 }
104 
107 
108 } // end of namespace processor
109 } // end of namespace ipsdk
110 
111 #endif // __IPSDKBASEPROCESSING_RULELEAFCOLLPROPERTY_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void initBase()
base class initialization method
void init(const boost::weak_ptr< const AttributeType > &pAttribute)
initialization of object
Definition: RuleLeafCollProperty.h:81
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type, typename LeafType::ValueType >::type ValueType
Value type associated to leaf.
Definition: RuleLeafCollProperty.h:43
const CollType & getAttributeLeafColl() const
method allowing to retrieve attribute leaf value collection into derived class
Definition: RuleLeafCollProperty.h:97
Concrete class for rule allowing to check properties of leaf collections of data item attributes...
Definition: RuleLeafCollProperty.h:30
Base template class for rule allowing to check properties of leaf collections of data item attributes...
Definition: BaseTLeafCollPropertyRule.h:28
std::string getAttributeName() const
method allowing to retrieve attribute name into derived class
Definition: RuleLeafCollProperty.h:89
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type, typename LeafType::CollType >::type CollType
Collection type associated to leaf.
Definition: RuleLeafCollProperty.h:48
boost::enable_if< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename AttributeType::ValueType >::type DataItemType
retrieve attribute type
Definition: RuleLeafCollProperty.h:38