IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ForceInstructionSets.h
Go to the documentation of this file.
1 // ForceInstructionSets.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKUNITTESTTOOLS_FORCEINSTRUCTIONSETS_H__
16 #define __IPSDKUNITTESTTOOLS_FORCEINSTRUCTIONSETS_H__
17 
19 #include <IPSDKBaseProcessing/Algorithm/Function/DataTypeIdentifierColl.h>
20 #include <IPSDKBaseProcessing/Algorithm/Function/InstructionSetsIdentifier.h>
21 #include <IPSDKImageProcessing/Algorithm/Function/ImageBufferTypeIdentifier.h>
23 
24 namespace ipsdk {
25 namespace unittest {
26 
29 
30 template <class T>
32 {
33 public:
35  {
36  }
37 
39  {
40  T::releaseForcedInstructionSets();
41  }
42 
43  bool init(const eInstructionSet& is)
44  {
46  dataTypes.init();
47 
49  instructionSets.init(is);
50 
51  return init(dataTypes, instructionSets);
52  }
53 
54  bool init(const image::eImageBufferType& dataType,
55  const eInstructionSet& is)
56  {
59  typeIdentifier.init(dataType);
60  dataTypes.init(typeIdentifier);
61 
63  instructionSets.init(is);
64 
65  return init(dataTypes, instructionSets);
66  }
67 
68  bool init(const image::eImageBufferType& dataType1,
69  const image::eImageBufferType& dataType2,
70  const eInstructionSet& is)
71  {
73  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2;
74  typeIdentifier1.init(dataType1);
75  typeIdentifier2.init(dataType2);
76  dataTypes.init(typeIdentifier1, typeIdentifier2);
77 
79  instructionSets.init(is);
80 
81  return init(dataTypes, instructionSets);
82  }
83 
84  bool init(const image::eImageBufferType& dataType1,
85  const image::eImageBufferType& dataType2,
86  const image::eImageBufferType& dataType3,
87  const eInstructionSet& is)
88  {
90  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2,
91  typeIdentifier3;
92  typeIdentifier1.init(dataType1);
93  typeIdentifier2.init(dataType2);
94  typeIdentifier3.init(dataType3);
95  dataTypes.init(typeIdentifier1, typeIdentifier2, typeIdentifier3);
96 
98  instructionSets.init(is);
99 
100  return init(dataTypes, instructionSets);
101  }
102 
103  bool init(const eInstructionSet& is1, const eInstructionSet& is2)
104  {
106  dataTypes.init();
107 
108  processor::InstructionSetsIdentifier instructionSets;
109  instructionSets.init(is1, is2);
110 
111  return init(dataTypes, instructionSets);
112  }
113 
114  bool init(const image::eImageBufferType& dataType,
115  const eInstructionSet& is1, const eInstructionSet& is2)
116  {
118  imaproc::ImageBufferTypeIdentifier typeIdentifier;
119  typeIdentifier.init(dataType);
120  dataTypes.init(typeIdentifier);
121 
122  processor::InstructionSetsIdentifier instructionSets;
123  instructionSets.init(is1, is2);
124 
125  return init(dataTypes, instructionSets);
126  }
127 
128  bool init(const image::eImageBufferType& dataType1,
129  const image::eImageBufferType& dataType2,
130  const eInstructionSet& is1, const eInstructionSet& is2)
131  {
133  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2;
134  typeIdentifier1.init(dataType1);
135  typeIdentifier2.init(dataType2);
136  dataTypes.init(typeIdentifier1, typeIdentifier2);
137 
138  processor::InstructionSetsIdentifier instructionSets;
139  instructionSets.init(is1, is2);
140 
141  return init(dataTypes, instructionSets);
142  }
143 
144  bool init(const image::eImageBufferType& dataType1,
145  const image::eImageBufferType& dataType2,
146  const image::eImageBufferType& dataType3,
147  const eInstructionSet& is1, const eInstructionSet& is2)
148  {
150  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2,
151  typeIdentifier3;
152  typeIdentifier1.init(dataType1);
153  typeIdentifier2.init(dataType2);
154  typeIdentifier3.init(dataType3);
155  dataTypes.init(typeIdentifier1, typeIdentifier2, typeIdentifier3);
156 
157  processor::InstructionSetsIdentifier instructionSets;
158  instructionSets.init(is1, is2);
159 
160  return init(dataTypes, instructionSets);
161  }
162 
163  bool init(const image::eImageBufferType& dataType,
164  const eInstructionSet& is1, const eInstructionSet& is2,
165  const eInstructionSet& is3)
166  {
168  imaproc::ImageBufferTypeIdentifier typeIdentifier;
169  typeIdentifier.init(dataType);
170  dataTypes.init(typeIdentifier);
171 
172  processor::InstructionSetsIdentifier instructionSets;
173  instructionSets.init(is1, is2, is3);
174 
175  return init(dataTypes, instructionSets);
176  }
177 
178  bool init(const image::eImageBufferType& dataType1,
179  const image::eImageBufferType& dataType2,
180  const eInstructionSet& is1, const eInstructionSet& is2,
181  const eInstructionSet& is3)
182  {
184  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2;
185  typeIdentifier1.init(dataType1);
186  typeIdentifier2.init(dataType2);
187  dataTypes.init(typeIdentifier1, typeIdentifier2);
188 
189  processor::InstructionSetsIdentifier instructionSets;
190  instructionSets.init(is1, is2, is3);
191 
192  return init(dataTypes, instructionSets);
193  }
194 
195  bool init(const image::eImageBufferType& dataType1,
196  const image::eImageBufferType& dataType2,
197  const image::eImageBufferType& dataType3,
198  const eInstructionSet& is1, const eInstructionSet& is2,
199  const eInstructionSet& is3)
200  {
202  imaproc::ImageBufferTypeIdentifier typeIdentifier1, typeIdentifier2,
203  typeIdentifier3;
204  typeIdentifier1.init(dataType1);
205  typeIdentifier2.init(dataType2);
206  typeIdentifier3.init(dataType3);
207  dataTypes.init(typeIdentifier1, typeIdentifier2, typeIdentifier3);
208 
209  processor::InstructionSetsIdentifier instructionSets;
210  instructionSets.init(is1, is2, is3);
211 
212  return init(dataTypes, instructionSets);
213  }
214 
215 protected:
216  bool init(const processor::DataTypeIdentifierColl& dataTypeIdColl,
217  const processor::InstructionSetsIdentifier& instructionSetsId)
218  {
219 
220  const bool bRet = T::accessFunctionSelector().isAvailableFunction(
221  dataTypeIdColl, instructionSetsId);
222  if(bRet)
223  T::forceInstructionSets(instructionSetsId);
224  return bRet;
225  }
226 };
227 
230 
231 } // end of namespace unittest
232 } // end of namespace ipsdk
233 
234 #endif // __IPSDKUNITTESTTOOLS_FORCEINSTRUCTIONSETS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void init(const image::eImageBufferType &imageBufferType)
initialization of object
void init()
initialization of object with no data type identifier
eInstructionSet
Enumerate for processor instruction set description.
Definition: InstructionSetTypes.h:31
Class allowing to identify used image buffer type and so contribute to select a specialized template ...
Definition: ImageBufferTypeIdentifier.h:34
Definition of import/export macro for library.
Definition: ForceInstructionSets.h:31
void init(const eInstructionSet &instructionSet)
initialization of object with a single processor instruction set
Class used for data type collection function identification.
Definition: DataTypeIdentifierColl.h:34
Predefined type for image management.
Class used for processor instruction sets function identification.
Definition: InstructionSetsIdentifier.h:33
eImageBufferType
types associated to image buffers
Definition: ImageTypes.h:78