1 // Created on: 2004-03-05
2 // Created by: Mikhail KUZMITCHEV
3 // Copyright (c) 2004-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <QANCollection.hxx>
23 #include <Draw_Interpretor.hxx>
25 #define ItemType gp_Pnt
26 #define Key1Type Standard_Real
27 #define Key2Type Standard_Integer
29 #include <QANCollection_PerfTest.hxx>
31 #include <QANCollection_PerfSparseArray.hxx>
33 IMPLEMENT_HARRAY1(QANCollection_HArray1Perf)
34 IMPLEMENT_HARRAY2(QANCollection_HArray2Perf)
35 IMPLEMENT_HSET(QANCollection_HSetPerf)
36 IMPLEMENT_HSEQUENCE(QANCollection_HSequencePerf)
38 //=======================================================================
39 //function : CheckArguments
41 //=======================================================================
42 Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
45 di << "Usage : " << argv[0] << " Repeat Size" << "\n";
48 Repeat = atoi(argv[1]);
51 di << "Repeat > 0" << "\n";
55 di << "Size > 0" << "\n";
62 //=======================================================================
63 //function : QANColPerfArray1
65 //=======================================================================
66 static Standard_Integer QANColPerfArray1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
68 Standard_Integer Repeat, Size;
69 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
72 CompArray1(Repeat,Size);
76 //=======================================================================
77 //function : QANColPerfArray2
79 //=======================================================================
80 static Standard_Integer QANColPerfArray2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
82 Standard_Integer Repeat, Size;
83 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
86 CompArray2(Repeat,Size);
90 //=======================================================================
91 //function : QANColPerfList
93 //=======================================================================
94 static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
96 Standard_Integer Repeat, Size;
97 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
100 CompList(Repeat,Size);
104 //=======================================================================
105 //function : QANColPerfQueue
107 //=======================================================================
108 static Standard_Integer QANColPerfQueue(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
110 Standard_Integer Repeat, Size;
111 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
114 CompQueue(Repeat,Size);
118 //=======================================================================
119 //function : QANColPerfStack
121 //=======================================================================
122 static Standard_Integer QANColPerfStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
124 Standard_Integer Repeat, Size;
125 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
128 CompStack(Repeat,Size);
132 //=======================================================================
133 //function : QANColPerfSet
135 //=======================================================================
136 static Standard_Integer QANColPerfSet(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
138 Standard_Integer Repeat, Size;
139 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
142 CompSet(Repeat,Size);
146 //=======================================================================
147 //function : QANColPerfSList
149 //=======================================================================
150 static Standard_Integer QANColPerfSList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
152 Standard_Integer Repeat, Size;
153 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
156 CompSList(Repeat,Size);
160 //=======================================================================
161 //function : QANColPerfSequence
163 //=======================================================================
164 static Standard_Integer QANColPerfSequence(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
166 Standard_Integer Repeat, Size;
167 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
170 CompSequence(Repeat,Size);
174 //=======================================================================
175 //function : QANColPerfMap
177 //=======================================================================
178 static Standard_Integer QANColPerfMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
180 Standard_Integer Repeat, Size;
181 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
184 CompMap(Repeat,Size);
188 //=======================================================================
189 //function : QANColPerfDataMap
191 //=======================================================================
192 static Standard_Integer QANColPerfDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
194 Standard_Integer Repeat, Size;
195 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
198 CompDataMap(Repeat,Size);
202 //=======================================================================
203 //function : QANColPerfDoubleMap
205 //=======================================================================
206 static Standard_Integer QANColPerfDoubleMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
208 Standard_Integer Repeat, Size;
209 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
212 CompDoubleMap(Repeat,Size);
216 //=======================================================================
217 //function : QANColPerfIndexedMap
219 //=======================================================================
220 static Standard_Integer QANColPerfIndexedMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
222 Standard_Integer Repeat, Size;
223 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
226 CompIndexedMap(Repeat,Size);
230 //=======================================================================
231 //function : QANColPerfIndexedDataMap
233 //=======================================================================
234 static Standard_Integer QANColPerfIndexedDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
236 Standard_Integer Repeat, Size;
237 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
240 CompIndexedDataMap(Repeat,Size);
244 //=======================================================================
245 //function : QANColCheckSparseArray
247 //=======================================================================
248 static Standard_Integer QANColCheckSparseArray(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
250 Standard_Integer Repeat, Size;
251 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
254 CompSparseArray(Repeat,Size);
258 void QANCollection::Commands3(Draw_Interpretor& theCommands) {
259 char *group = "QANCollection";
261 // from agvCollTest/src/CollectionEXE/PerfTestEXE.cxx
262 theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
263 theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
264 theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
265 theCommands.Add("QANColPerfQueue", "QANColPerfQueue Repeat Size", __FILE__, QANColPerfQueue, group);
266 theCommands.Add("QANColPerfStack", "QANColPerfStack Repeat Size", __FILE__, QANColPerfStack, group);
267 theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group);
268 theCommands.Add("QANColPerfSList", "QANColPerfSList Repeat Size", __FILE__, QANColPerfSList, group);
269 theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
270 theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);
271 theCommands.Add("QANColPerfDataMap", "QANColPerfDataMap Repeat Size", __FILE__, QANColPerfDataMap, group);
272 theCommands.Add("QANColPerfDoubleMap", "QANColPerfDoubleMap Repeat Size", __FILE__, QANColPerfDoubleMap, group);
273 theCommands.Add("QANColPerfIndexedMap", "QANColPerfIndexedMap Repeat Size", __FILE__, QANColPerfIndexedMap, group);
274 theCommands.Add("QANColPerfIndexedDataMap", "QANColPerfIndexedDataMap Repeat Size", __FILE__, QANColPerfIndexedDataMap, group);
276 theCommands.Add("QANColCheckSparseArray", "QANColCheckSparseArray Repeat Size", __FILE__, QANColCheckSparseArray, group);