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