17 #ifndef __IPSDKBASEPROCESSING_DYNAMICBYRANGEDATASPLIT_H__ 18 #define __IPSDKBASEPROCESSING_DYNAMICBYRANGEDATASPLIT_H__ 20 #include <IPSDKBaseProcessing/DataSplit/Dynamic/BaseDynamicSplit.h> 21 #include <boost/utility/enable_if.hpp> 22 #include <boost/type_traits/is_same.hpp> 23 #include <boost/make_shared.hpp> 32 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
47 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
48 boost::mpl::int_<processor::eAttributeType::eAT_DataItem> >::type,
107 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
113 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
114 DynamicByRangeDataSplit<TProcessor, TAttribute, CollField, ValueField>::~DynamicByRangeDataSplit()
119 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
123 return g_splitDynamicType;
126 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
127 inline const std::string&
130 return TAttribute::getObjectNameStr();
133 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
134 inline const std::string&
137 return TAttribute::getToolTipStr();
140 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
146 if (pDataItem.get() == 0 || pIdxCollMap.get() == 0)
147 throwNullInputSharedPtr();
152 this->initUnSplitted(elementsLocationInfo);
155 _pDataItem = pDataItem;
158 _pIdxCollMap = pIdxCollMap;
159 _pIdxCollMap->clear();
162 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
167 if (pDataItem.get() == 0)
168 throwNullInputSharedPtr();
173 this->initUnSplitted(elementsLocationInfo);
176 _pDataItem = pDataItem;
179 _pIdxCollMap.reset();
182 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
188 "This attribute is not part of processor class");
190 return dynamic_cast<const TProcessor*
>(&processor) != 0;
193 template <
typename TProcessor,
typename TAttribute,
typename CollField,
typename ValueField>
201 TProcessor& tProcessor =
static_cast<TProcessor&
>(processor);
204 IdxCollPtr pIdxColl(boost::make_shared<IdxColl>());
205 boost::shared_ptr<ValueType> pParamColl(boost::make_shared<ValueType>());
208 const ipUInt64 endElementIdx = elementIdx + nbElements;
211 typedef typename DataItemType::template ChildNodeInfo<CollField>::CollType ParameterPtrCollType;
212 const ParameterPtrCollType& vPrms = _pDataItem->template getNode<CollField>().getColl();
219 typedef typename TAttribute::ValueType::template ChildNodeInfo<CollField>::CollNodePtrType ParameterPtrType;
220 const ParameterPtrType& pCurDataItem = vPrms[i];
223 const ipUInt64 curValue =
static_cast<ipUInt64>(pCurDataItem->template getValue<ValueField>());
226 if(curValue >= elementIdx && curValue < endElementIdx) {
229 if (_pIdxCollMap.get() != 0)
230 pIdxColl->push_back(i);
231 pParamColl->template push_back<CollField>(pCurDataItem);
236 if (_pIdxCollMap.get() != 0)
237 (*_pIdxCollMap)[
ElementsRange(elementIdx, nbElements)] = pIdxColl;
240 tProcessor.TProcessor::template set<TAttribute>(pParamColl);
251 #endif // __IPSDKBASEPROCESSING_DYNAMICRESULTSPLIT_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
TProcessor ProcessorType
processor type associated to object
Definition: DynamicByRangeDataSplit.h:41
ipUInt64 insertNonLocalized(const ElementsRange &elementsRange, const ipUInt64 dataMemorySize)
insertion of a new non localized information into collection
void init(const StorageType &pDataItem, const IdxCollMapPtr &pIdxCollMap)
object initialization method
Definition: DynamicByRangeDataSplit.h:142
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
eSplitDynamicType
Enumerate describing dynamic split operation type.
Definition: DynamicSplitTypes.h:36
TAttribute::ValueType ValueType
parameter type associated to object
Definition: DynamicByRangeDataSplit.h:55
eSplitDynamicType getSplitDynamicType() const
retrieve dynamic split operation type
Definition: DynamicByRangeDataSplit.h:121
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: DynamicByRangeDataSplit.h:195
static const eSplitDynamicType::domain g_splitDynamicType
type associated to split operation
Definition: DynamicByRangeDataSplit.h:38
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
Dynamic split operation type for valued data with value used to match elements range.
Definition: DynamicSplitTypes.h:44
Base class for data dynamic split objets used for data dispatch.
Definition: BaseDynamicSplit.h:31
bool checkProcessorType(const BaseProcessor &processor)
check processor type in derived class
Definition: DynamicByRangeDataSplit.h:184
boost::shared_ptr< IdxCollMap > IdxCollMapPtr
shared pointer to collections of indices
Definition: DynamicSplitTypes.h:66
boost::shared_ptr< IdxColl > IdxCollPtr
shared pointer to collection of indices
Definition: DynamicSplitTypes.h:59
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: DynamicByRangeDataSplit.h:128
TAttribute AttributeType
attribute type associated to object
Definition: DynamicByRangeDataSplit.h:44
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
IdxCollMapPtr _pIdxCollMap
collection of elements index associated to each splits
Definition: DynamicByRangeDataSplit.h:101
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: DynamicByRangeDataSplit.h:135
boost::enable_if< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< processor::eAttributeType::eAT_DataItem > >::type, typename AttributeType::ValueType >::type DataItemType
retrieve DataItem node type associated to attribute
Definition: DynamicByRangeDataSplit.h:49
StorageType _pDataItem
collection of elements associated to dynamic split
Definition: DynamicByRangeDataSplit.h:98
TAttribute::StorageType StorageType
parameter storage type associated to object
Definition: DynamicByRangeDataSplit.h:52
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32
Template class for split range data used for dynamic data dispatch.
Definition: DynamicByRangeDataSplit.h:33