IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
GenericMeasureSetSplit.h
1 // GenericMeasureSetSplit.h:
3 // -------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_GENERICMEASURESETSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_GENERICMEASURESETSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/MeasureSet/BaseGenericMeasureSetSplit.h>
20 
21 namespace ipsdk {
22 namespace imaproc {
23 
26 
27 template <typename TProcessor, typename InputDataType, typename TAttribute>
29 {
30 // predefined public types
31 public:
33  typedef TProcessor ProcessorType;
34 
36  typedef TAttribute AttributeType;
37 
39  typedef typename TAttribute::ValueType OutputType;
40 
41 public:
47 
48 // methods
49 public:
51  const std::string& getAttributeName() const;
52 
54  const std::string& getAttributeToolTip() const;
55 
61  void init(const boost::shared_ptr<InputDataType>& pMeasureSet,
62  const MeasureSetCollPtr& pMeasureSetColl);
63 
64 protected:
66  bool checkProcessorType(const processor::BaseProcessor& processor);
67 
72  const boost::shared_ptr<InputDataType>& pSubMeasureSet);
73 
74 // attributes
75 protected:
76 
77 };
78 
81 
82 template <typename TProcessor, typename InputDataType, typename TAttribute>
83 inline const std::string&
85 {
86  return TAttribute::getObjectNameStr();
87 }
88 
89 template <typename TProcessor, typename InputDataType, typename TAttribute>
90 inline const std::string&
92 {
93  return TAttribute::getToolTipStr();
94 }
95 
96 template <typename TProcessor, typename InputDataType, typename TAttribute>
97 inline void
98 GenericMeasureSetSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pMeasureSet,
99  const MeasureSetCollPtr& pMeasureSetColl)
100 {
101  // call of base class initialization method
102  this->initBase(pMeasureSet, pMeasureSetColl);
103 }
104 
105 template <typename TProcessor, typename InputDataType, typename TAttribute>
106 inline bool
108 {
109  // check for consistency between processor and attribute
111  "This attribute is not part of processor class");
112 
113  return dynamic_cast<const TProcessor*>(&processor) != 0;
114 }
115 
116 template <typename TProcessor, typename InputDataType, typename TAttribute>
117 inline BoolResult
119  const boost::shared_ptr<InputDataType>& pSubMeasureSet)
120 {
121  // cast of input processor object
122  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
123 
124  // update of processor attribute value
125  tProcessor.TProcessor::template set<TAttribute>(pSubMeasureSet);
126 
127  return true;
128 }
129 
132 
133 } // end of namespace imaproc
134 } // end of namespace ipsdk
135 
136 #endif // __IPSDKIMAGEPROCESSING_GENERICMEASURESETSPLIT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::shared_ptr< MeasureSetColl > MeasureSetCollPtr
shared pointer to measure set collection
Definition: MeasureSetSplitTypes.h:54
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: GenericMeasureSetSplit.h:107
Base class for processor class.
Definition: BaseProcessor.h:43
structure allowing to check whether a given attribute exists in attribute collection information ...
Definition: AttributeCollInfoCheckMacros.h:131
TProcessor ProcessorType
processor type associated to object
Definition: GenericMeasureSetSplit.h:33
TAttribute::ValueType OutputType
output data type for split operation
Definition: GenericMeasureSetSplit.h:39
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: GenericMeasureSetSplit.h:91
TAttribute AttributeType
attribute type associated to object
Definition: GenericMeasureSetSplit.h:36
Concrete class for split operation generating generic sub measure set for data dispatch.
Definition: GenericMeasureSetSplit.h:28
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< InputDataType > &pSubMeasureSet)
initialize processor attribute associate to split operation for a given sub measure set ...
Definition: GenericMeasureSetSplit.h:118
Base class for generic shape measure set split operations for data dispatch.
Definition: BaseGenericMeasureSetSplit.h:28
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: GenericMeasureSetSplit.h:84
void init(const boost::shared_ptr< InputDataType > &pMeasureSet, const MeasureSetCollPtr &pMeasureSetColl)
initialization method for splitted objects
Definition: GenericMeasureSetSplit.h:98