16 #ifndef __IPSDKBASEPROCESSING_DYNAMICBYCREATIONRESULTSPLIT_H__ 17 #define __IPSDKBASEPROCESSING_DYNAMICBYCREATIONRESULTSPLIT_H__ 19 #include <IPSDKBaseProcessing/DataSplit/Dynamic/BaseDynamicSplit.h> 20 #include <IPSDKBaseData/Range/ElementsRange.h> 21 #include <boost/utility/enable_if.hpp> 22 #include <boost/type_traits/is_same.hpp> 23 #include <boost/static_assert.hpp> 24 #include <boost/make_shared.hpp> 25 #include <boost/function.hpp> 34 template <
typename TProcessor,
typename TAttribute>
52 typedef typename boost::enable_if<
typename boost::is_same<
typename TAttribute::StorageType,
53 boost::shared_ptr<typename TAttribute::ValueType> >::type,
63 typedef boost::function<ParameterType (const ipUInt64, const ipUInt64)>
CreationFunType;
116 template <
typename TProcessor,
typename TAttribute>
120 return g_splitDynamicType;
123 template <
typename TProcessor,
typename TAttribute>
124 inline const std::string&
127 return TAttribute::getObjectNameStr();
130 template <
typename TProcessor,
typename TAttribute>
131 inline const std::string&
134 return TAttribute::getToolTipStr();
137 template <
typename T>
138 inline boost::shared_ptr<T>
139 defaultDynamicByCreationResultSplitCreationFun(
const ipUInt64,
const ipUInt64)
141 return boost::make_shared<T>();
144 template <
typename TProcessor,
typename TAttribute>
151 template <
typename TProcessor,
typename TAttribute>
157 if (pParameterColl.get() == 0)
158 throwNullInputSharedPtr();
163 this->initUnSplitted(elementsLocationInfo);
166 _pParameterColl = pParameterColl;
167 _pParameterColl->clear();
170 _pCreationFun = pCreationFun;
173 template <
typename TProcessor,
typename TAttribute>
179 "This attribute is not part of processor class");
181 return dynamic_cast<const TProcessor*
>(&processor) != 0;
184 template <
typename TProcessor,
typename TAttribute>
192 TProcessor& tProcessor =
static_cast<TProcessor&
>(processor);
195 ParameterType pCurResult = _pCreationFun(elementIdx, nbElements);
198 (*_pParameterColl)[
ElementsRange(elementIdx, nbElements)] = pCurResult;
201 tProcessor.TProcessor::template set<TAttribute>(pCurResult);
212 #endif // __IPSDKBASEPROCESSING_DYNAMICBYCREATIONRESULTSPLIT_H__ bool checkProcessorType(const BaseProcessor &processor)
check processor type in derived class
Definition: DynamicByCreationResultSplit.h:175
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
ipUInt64 insertNonLocalized(const ElementsRange &elementsRange, const ipUInt64 dataMemorySize)
insertion of a new non localized information into collection
eSplitDynamicType getSplitDynamicType() const
retrieve dynamic split operation type
Definition: DynamicByCreationResultSplit.h:118
TProcessor ProcessorType
processor type associated to object
Definition: DynamicByCreationResultSplit.h:43
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: DynamicByCreationResultSplit.h:132
boost::shared_ptr< ParameterColl > ParameterCollPtr
shared pointer to collection of elements associated to dynamic split
Definition: DynamicByCreationResultSplit.h:60
eSplitDynamicType
Enumerate describing dynamic split operation type.
Definition: DynamicSplitTypes.h:36
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: DynamicByCreationResultSplit.h:125
Dynamic split operation type for 'by creation' results elements.
Definition: DynamicSplitTypes.h:42
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
void init(const ParameterCollPtr &pParameterColl)
object initialization method
Definition: DynamicByCreationResultSplit.h:146
TAttribute AttributeType
attribute type associated to object
Definition: DynamicByCreationResultSplit.h:46
Base class for data dynamic split objets used for data dispatch.
Definition: BaseDynamicSplit.h:31
static const eSplitDynamicType::domain g_splitDynamicType
type associated to split operation
Definition: DynamicByCreationResultSplit.h:40
boost::enable_if< typename boost::is_same< typename TAttribute::StorageType, boost::shared_ptr< typename TAttribute::ValueType > >::type, typename TAttribute::StorageType >::type ParameterType
parameter type associated to object
Definition: DynamicByCreationResultSplit.h:54
boost::function< ParameterType(const ipUInt64, const ipUInt64)> CreationFunType
used creation fonction type
Definition: DynamicByCreationResultSplit.h:63
Class allowing to store information about elements range (start offset and number of elements) ...
Definition: ElementsRange.h:27
Template class for results splitted data used for dynamic data dispatch.
Definition: DynamicByCreationResultSplit.h:35
Base class for request origin description.
Definition: BaseRequestOrigin.h:28
CreationFunType _pCreationFun
used creation function
Definition: DynamicByCreationResultSplit.h:110
std::map< ElementsRange, ParameterType > ParameterColl
collection of elements associated to dynamic split indexed by elements range
Definition: DynamicByCreationResultSplit.h:57
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32
TAttribute::ValueType ValueType
parameter value type
Definition: DynamicByCreationResultSplit.h:49
ParameterCollPtr _pParameterColl
collection of elements associated to dynamic split
Definition: DynamicByCreationResultSplit.h:107
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: DynamicByCreationResultSplit.h:186