16 #ifndef __IPSDKBASEPROCESSING_DYNAMICBYCOPYRESULTSPLIT_H__ 17 #define __IPSDKBASEPROCESSING_DYNAMICBYCOPYRESULTSPLIT_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 ValueType&)>
CopyFunType;
123 template <
typename TProcessor,
typename TAttribute>
127 return g_splitDynamicType;
130 template <
typename TProcessor,
typename TAttribute>
131 inline const std::string&
134 return TAttribute::getObjectNameStr();
137 template <
typename TProcessor,
typename TAttribute>
138 inline const std::string&
141 return TAttribute::getToolTipStr();
144 template <
typename TProcessor,
typename TAttribute>
149 init(pParameterColl, pDefaultValue,
static_cast<ParameterType (*)(
const ValueType&)
>(&boost::make_shared<ValueType>));
152 template <
typename TProcessor,
typename TAttribute>
159 if (pParameterColl.get() == 0)
160 throwNullInputSharedPtr();
161 if (pDefaultValue.get() == 0)
162 throwNullInputSharedPtr();
167 this->initUnSplitted(elementsLocationInfo);
170 _pParameterColl = pParameterColl;
171 _pParameterColl->clear();
174 _pDefaultValue = pDefaultValue;
177 _pCopyFunction = pCopyFunction;
180 template <
typename TProcessor,
typename TAttribute>
186 "This attribute is not part of processor class");
188 return dynamic_cast<const TProcessor*
>(&processor) != 0;
191 template <
typename TProcessor,
typename TAttribute>
199 TProcessor& tProcessor =
static_cast<TProcessor&
>(processor);
205 (*_pParameterColl)[
ElementsRange(elementIdx, nbElements)] = pCurResult;
208 tProcessor.TProcessor::template set<TAttribute>(pCurResult);
219 #endif // __IPSDKBASEPROCESSING_DYNAMICBYCOPYRESULTSPLIT_H__ boost::function< ParameterType(const ValueType &)> CopyFunType
used copy fonction type
Definition: DynamicByCopyResultSplit.h:63
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
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: DynamicByCopyResultSplit.h:139
std::map< ElementsRange, ParameterType > ParameterColl
collection of elements associated to dynamic split indexed by elements range
Definition: DynamicByCopyResultSplit.h:57
bool checkProcessorType(const BaseProcessor &processor)
check processor type in derived class
Definition: DynamicByCopyResultSplit.h:182
CopyFunType _pCopyFunction
used copy function
Definition: DynamicByCopyResultSplit.h:117
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
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: DynamicByCopyResultSplit.h:54
eSplitDynamicType
Enumerate describing dynamic split operation type.
Definition: DynamicSplitTypes.h:36
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: DynamicByCopyResultSplit.h:132
static const eSplitDynamicType::domain g_splitDynamicType
type associated to split operation
Definition: DynamicByCopyResultSplit.h:40
Dynamic split operation type for 'by creation' results elements.
Definition: DynamicSplitTypes.h:42
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: DynamicByCopyResultSplit.h:193
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
boost::shared_ptr< ParameterColl > ParameterCollPtr
shared pointer to collection of elements associated to dynamic split
Definition: DynamicByCopyResultSplit.h:60
Base class for data dynamic split objets used for data dispatch.
Definition: BaseDynamicSplit.h:31
TAttribute::ValueType ValueType
parameter value type
Definition: DynamicByCopyResultSplit.h:49
ParameterType _pDefaultValue
default value for split operation
Definition: DynamicByCopyResultSplit.h:114
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
void init(const ParameterCollPtr &pParameterColl, const ParameterType &pDefaultValue)
object initialization method
Definition: DynamicByCopyResultSplit.h:146
eSplitDynamicType getSplitDynamicType() const
retrieve dynamic split operation type
Definition: DynamicByCopyResultSplit.h:125
TProcessor ProcessorType
processor type associated to object
Definition: DynamicByCopyResultSplit.h:43
TAttribute AttributeType
attribute type associated to object
Definition: DynamicByCopyResultSplit.h:46
Template class for results splitted data used for dynamic data dispatch.
Definition: DynamicByCopyResultSplit.h:35
ParameterCollPtr _pParameterColl
collection of elements associated to dynamic split
Definition: DynamicByCopyResultSplit.h:111
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32