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