IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
StaticSplitOperators.h
Go to the documentation of this file.
1 // StaticSplitOperators.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_STATICSPLITOPERATORS_H__
16 #define __IPSDKBASEPROCESSING_STATICSPLITOPERATORS_H__
17 
18 #include <IPSDKBaseProcessing/DataSplit/Static/Instances/StaticNoSplit.h>
19 #include <IPSDKBaseProcessing/DataSplit/Static/Instances/StaticResultSplit.h>
20 #include <IPSDKBaseProcessing/DataSplit/Static/Instances/StaticParameterSplit.h>
21 #include <boost/make_shared.hpp>
22 
23 namespace ipsdk {
24 namespace processor {
25 
28 
30 template <typename TProcessor, typename TAttribute>
31 boost::shared_ptr<StaticNoSplit<TProcessor, TAttribute> >
32 staticNoSplit(const typename TAttribute::StorageType& value)
33 {
34  // create and initialize split operator
35  typedef StaticNoSplit<TProcessor, TAttribute> DataSplit;
36  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
37  pDataSplit->init(value);
38 
39  return pDataSplit;
40 }
41 
44 template <typename TProcessor, typename TAttribute>
45 boost::shared_ptr<StaticResultSplit<TProcessor, TAttribute> >
47 {
48  // create used default value
49  typename TAttribute::StorageType pDefaultValue(boost::make_shared<typename TAttribute::StorageType::element_type>());
50 
51  // create and initialize split operator
53  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
54  pDataSplit->init(pResultsColl, pDefaultValue);
55 
56  return pDataSplit;
57 }
58 template <typename TProcessor, typename TAttribute>
59 boost::shared_ptr<StaticResultSplit<TProcessor, TAttribute> >
61  const typename TAttribute::StorageType& pDefaultValue)
62 {
63  // create and initialize split operator
65  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
66  pDataSplit->init(pResultsColl, pDefaultValue);
67 
68  return pDataSplit;
69 }
71 
74 template <typename TProcessor, typename TAttribute>
75 boost::shared_ptr<StaticParameterSplit<TProcessor, TAttribute> >
77 {
78  // create and initialize split operator
80  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
81  pDataSplit->init(pParameterColl);
82 
83  return pDataSplit;
84 }
86 
89 
90 } // end of namespace processor
91 } // end of namespace ipsdk
92 
93 #endif // __IPSDKBASEPROCESSING_STATICSPLITOPERATORS_H__
Template class for results splitted data used for static data dispatch.
Definition: StaticResultSplit.h:32
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void init(const ParameterType &value)
object initialization method
Definition: StaticNoSplit.h:116
void init(const ParameterCollPtr &pParameterColl, const ParameterType &pDefaultValue)
object initialization method
Definition: StaticResultSplit.h:133
boost::shared_ptr< StaticResultSplit< TProcessor, TAttribute > > staticResultsSplit(const typename StaticResultSplit< TProcessor, TAttribute >::ParameterCollPtr &pResultsColl)
create a results splitted data operation used for data dispatch
Definition: StaticSplitOperators.h:46
boost::shared_ptr< StaticParameterSplit< TProcessor, TAttribute > > staticParameterSplit(const typename StaticParameterSplit< TProcessor, TAttribute >::ParameterCollConstPtr &pParameterColl)
create a parameter splitted data operation used for data dispatch
Definition: StaticSplitOperators.h:76
boost::shared_ptr< ParameterColl > ParameterCollPtr
shared pointer to collection of elements associated to static split
Definition: StaticResultSplit.h:51
Template class for parameter splitted data used for static data dispatch.
Definition: StaticParameterSplit.h:29
boost::shared_ptr< StaticNoSplit< TProcessor, TAttribute > > staticNoSplit(const typename TAttribute::StorageType &value)
create an un-splitted data operation used for data dispatch
Definition: StaticSplitOperators.h:32
Template class for un-splitted data used for static data dispatch.
Definition: StaticNoSplit.h:27
boost::shared_ptr< const ParameterColl > ParameterCollConstPtr
shared pointer to collection of elements associated to static split
Definition: StaticParameterSplit.h:46
void init(const ParameterCollConstPtr &pParameterColl)
object initialization method
Definition: StaticParameterSplit.h:124