OCC22355 Avoid annoying warnings in NCollection_SparseArray.hxx on 64-bit Linux with...
[occt.git] / src / QANCollection / QANCollection3.cxx
CommitLineData
7fd59977 1// File: QANCollection.cxx
2// Created: Fri Mar 5 09:08:10 2004
3// Author: Mikhail KUZMITCHEV
4// <mkv@russox>
5
6
7#include <QANCollection.hxx>
8#include <Draw_Interpretor.hxx>
9
10#define ItemType gp_Pnt
11#define Key1Type Standard_Real
12#define Key2Type Standard_Integer
13
14#include <QANCollection_PerfTest.hxx>
15
ba39a6a3
Y
16#include <QANCollection_PerfSparseArray.hxx>
17
7fd59977 18IMPLEMENT_HARRAY1(QANCollection_HArray1Perf)
19IMPLEMENT_HARRAY2(QANCollection_HArray2Perf)
20IMPLEMENT_HSET(QANCollection_HSetPerf)
21IMPLEMENT_HSEQUENCE(QANCollection_HSequencePerf)
22
23//=======================================================================
24//function : CheckArguments
25//purpose :
26//=======================================================================
27Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
28{
29 if ( argc != 3) {
30 di << "Usage : " << argv[0] << " Repeat Size" << "\n";
31 return 1;
32 }
33 Repeat = atoi(argv[1]);
34 Size = atoi(argv[2]);
35 if ( Repeat < 1 ) {
36 di << "Repeat > 0" << "\n";
37 return 1;
38 }
39 if ( Size < 1 ) {
40 di << "Size > 0" << "\n";
41 return 1;
42 }
43 return 0;
44}
45
46
47//=======================================================================
48//function : QANColPerfArray1
49//purpose :
50//=======================================================================
51static Standard_Integer QANColPerfArray1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
52{
53 Standard_Integer Repeat, Size;
54 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
55 return 1;
56 }
57 CompArray1(Repeat,Size);
58 return 0;
59}
60
61//=======================================================================
62//function : QANColPerfArray2
63//purpose :
64//=======================================================================
65static Standard_Integer QANColPerfArray2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
66{
67 Standard_Integer Repeat, Size;
68 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
69 return 1;
70 }
71 CompArray2(Repeat,Size);
72 return 0;
73}
74
75//=======================================================================
76//function : QANColPerfList
77//purpose :
78//=======================================================================
79static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
80{
81 Standard_Integer Repeat, Size;
82 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
83 return 1;
84 }
85 CompList(Repeat,Size);
86 return 0;
87}
88
89//=======================================================================
90//function : QANColPerfQueue
91//purpose :
92//=======================================================================
93static Standard_Integer QANColPerfQueue(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
94{
95 Standard_Integer Repeat, Size;
96 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
97 return 1;
98 }
99 CompQueue(Repeat,Size);
100 return 0;
101}
102
103//=======================================================================
104//function : QANColPerfStack
105//purpose :
106//=======================================================================
107static Standard_Integer QANColPerfStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
108{
109 Standard_Integer Repeat, Size;
110 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
111 return 1;
112 }
113 CompStack(Repeat,Size);
114 return 0;
115}
116
117//=======================================================================
118//function : QANColPerfSet
119//purpose :
120//=======================================================================
121static Standard_Integer QANColPerfSet(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
122{
123 Standard_Integer Repeat, Size;
124 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
125 return 1;
126 }
127 CompSet(Repeat,Size);
128 return 0;
129}
130
131//=======================================================================
132//function : QANColPerfSList
133//purpose :
134//=======================================================================
135static Standard_Integer QANColPerfSList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
136{
137 Standard_Integer Repeat, Size;
138 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
139 return 1;
140 }
141 CompSList(Repeat,Size);
142 return 0;
143}
144
145//=======================================================================
146//function : QANColPerfSequence
147//purpose :
148//=======================================================================
149static Standard_Integer QANColPerfSequence(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
150{
151 Standard_Integer Repeat, Size;
152 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
153 return 1;
154 }
155 CompSequence(Repeat,Size);
156 return 0;
157}
158
159//=======================================================================
160//function : QANColPerfMap
161//purpose :
162//=======================================================================
163static Standard_Integer QANColPerfMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
164{
165 Standard_Integer Repeat, Size;
166 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
167 return 1;
168 }
169 CompMap(Repeat,Size);
170 return 0;
171}
172
173//=======================================================================
174//function : QANColPerfDataMap
175//purpose :
176//=======================================================================
177static Standard_Integer QANColPerfDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
178{
179 Standard_Integer Repeat, Size;
180 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
181 return 1;
182 }
183 CompDataMap(Repeat,Size);
184 return 0;
185}
186
187//=======================================================================
188//function : QANColPerfDoubleMap
189//purpose :
190//=======================================================================
191static Standard_Integer QANColPerfDoubleMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
192{
193 Standard_Integer Repeat, Size;
194 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
195 return 1;
196 }
197 CompDoubleMap(Repeat,Size);
198 return 0;
199}
200
201//=======================================================================
202//function : QANColPerfIndexedMap
203//purpose :
204//=======================================================================
205static Standard_Integer QANColPerfIndexedMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
206{
207 Standard_Integer Repeat, Size;
208 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
209 return 1;
210 }
211 CompIndexedMap(Repeat,Size);
212 return 0;
213}
214
215//=======================================================================
216//function : QANColPerfIndexedDataMap
217//purpose :
218//=======================================================================
219static Standard_Integer QANColPerfIndexedDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
220{
221 Standard_Integer Repeat, Size;
222 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
223 return 1;
224 }
225 CompIndexedDataMap(Repeat,Size);
226 return 0;
227}
228
ba39a6a3
Y
229//=======================================================================
230//function : QANColCheckSparseArray
231//purpose :
232//=======================================================================
233static Standard_Integer QANColCheckSparseArray(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
234{
235 Standard_Integer Repeat, Size;
236 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
237 return 1;
238 }
239 CompSparseArray(Repeat,Size);
240 return 0;
241}
242
7fd59977 243void QANCollection::Commands3(Draw_Interpretor& theCommands) {
244 char *group = "QANCollection";
245
246 // from agvCollTest/src/CollectionEXE/PerfTestEXE.cxx
247 theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
248 theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
249 theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
250 theCommands.Add("QANColPerfQueue", "QANColPerfQueue Repeat Size", __FILE__, QANColPerfQueue, group);
251 theCommands.Add("QANColPerfStack", "QANColPerfStack Repeat Size", __FILE__, QANColPerfStack, group);
252 theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group);
253 theCommands.Add("QANColPerfSList", "QANColPerfSList Repeat Size", __FILE__, QANColPerfSList, group);
254 theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
255 theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);
256 theCommands.Add("QANColPerfDataMap", "QANColPerfDataMap Repeat Size", __FILE__, QANColPerfDataMap, group);
257 theCommands.Add("QANColPerfDoubleMap", "QANColPerfDoubleMap Repeat Size", __FILE__, QANColPerfDoubleMap, group);
258 theCommands.Add("QANColPerfIndexedMap", "QANColPerfIndexedMap Repeat Size", __FILE__, QANColPerfIndexedMap, group);
259 theCommands.Add("QANColPerfIndexedDataMap", "QANColPerfIndexedDataMap Repeat Size", __FILE__, QANColPerfIndexedDataMap, group);
ba39a6a3
Y
260
261 theCommands.Add("QANColCheckSparseArray", "QANColCheckSparseArray Repeat Size", __FILE__, QANColCheckSparseArray, group);
262
7fd59977 263 return;
264}
ba39a6a3 265