IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
StaticNoSplit.h
1 // StaticNoSplit.h:
3 // ----------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_STATICNOSPLIT_H__
16 #define __IPSDKBASEPROCESSING_STATICNOSPLIT_H__
17 
18 #include <IPSDKBaseProcessing/DataSplit/Static/BaseStaticSplit.h>
19 
20 namespace ipsdk {
21 namespace processor {
22 
25 
26 template <typename TProcessor, typename TAttribute>
28 {
29 // predefined public types
30 public:
32  typedef TProcessor ProcessorType;
33 
35  typedef TAttribute AttributeType;
36 
38  typedef typename TAttribute::StorageType ParameterType;
39 
40 public:
43  StaticNoSplit();
44  ~StaticNoSplit();
46 
47 // methods
48 public:
51 
53  const std::string& getAttributeName() const;
54 
56  const std::string& getAttributeToolTip() const;
57 
59  void init(const ParameterType& value);
60 
61 protected:
63  bool checkProcessorType(const BaseProcessor& processor);
64 
69  const ipUInt32 elementIdx,
70  const core::BaseRequestOrigin& requestOrigin);
71 
72 // attributes
73 protected:
76 };
77 
80 
81 template <typename TProcessor, typename TAttribute>
83 {
84 
85 }
86 
87 template <typename TProcessor, typename TAttribute>
88 StaticNoSplit<TProcessor, TAttribute>::~StaticNoSplit()
89 {
90 
91 }
92 
93 template <typename TProcessor, typename TAttribute>
94 inline eSplitStaticType
96 {
98 }
99 
100 template <typename TProcessor, typename TAttribute>
101 inline const std::string&
103 {
104  return TAttribute::getObjectNameStr();
105 }
106 
107 template <typename TProcessor, typename TAttribute>
108 inline const std::string&
110 {
111  return TAttribute::getToolTipStr();
112 }
113 
114 template <typename TProcessor, typename TAttribute>
115 inline void
117 {
118  // call of base class initialization method
119  ElementsLocationInfo elementsLocationInfo;
120  elementsLocationInfo.insertNonLocalized(ElementsRange(0, 1), 0);
121  this->initBaseUnSplitted(elementsLocationInfo);
122 
123  // update object value
124  _value = value;
125 }
126 
127 template <typename TProcessor, typename TAttribute>
128 inline bool
130 {
131  // check for consistency between processor and attribute
133  "This attribute is not part of processor class");
134 
135  return dynamic_cast<const TProcessor*>(&processor) != 0;
136 }
137 
138 template <typename TProcessor, typename TAttribute>
139 inline BoolResult
141  const ipUInt32 elementIdx,
142  const core::BaseRequestOrigin& requestOrigin)
143 {
144  // cast of input processor object
145  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
146 
147  // update of processor attribute value
148  tProcessor.TProcessor::template set<TAttribute>(_value);
149 
150  return true;
151 }
152 
155 
156 } // end of namespace processor
157 } // end of namespace ipsdk
158 
159 #endif // __IPSDKBASEPROCESSING_STATICNOSPLIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
No split operation for static split objects.
Definition: StaticSplitTypes.h:34
ipUInt64 insertNonLocalized(const ElementsRange &elementsRange, const ipUInt64 dataMemorySize)
insertion of a new non localized information into collection
ParameterType _value
object associated value
Definition: StaticNoSplit.h:75
void init(const ParameterType &value)
object initialization method
Definition: StaticNoSplit.h:116
eSplitStaticType getSplitStaticType() const
retrieve static split operation type
Definition: StaticNoSplit.h:95
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: StaticNoSplit.h:109
TProcessor ProcessorType
processor type associated to object
Definition: StaticNoSplit.h:32
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
eSplitStaticType
Enumerate describing static split operation type.
Definition: StaticSplitTypes.h:32
TAttribute::StorageType ParameterType
parameter type associated to object
Definition: StaticNoSplit.h:38
TAttribute AttributeType
attribute type associated to object
Definition: StaticNoSplit.h:35
Base class for data static split objets used for data dispatch.
Definition: BaseStaticSplit.h:34
BoolResult processAttribute(BaseProcessor &processor, const ipUInt32 elementIdx, const core::BaseRequestOrigin &requestOrigin)
initialize processor attribute associate to split operation for a given element index ...
Definition: StaticNoSplit.h:140
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: StaticNoSplit.h:102
bool checkProcessorType(const BaseProcessor &processor)
check processor type in derived class
Definition: StaticNoSplit.h:129
Class allowing to store information about elements range (start offset and number of elements) ...
Definition: ElementsRange.h:27
Base class for request origin description.
Definition: BaseRequestOrigin.h:28
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32
Template class for un-splitted data used for static data dispatch.
Definition: StaticNoSplit.h:27
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53