-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathSTEPaggregate.h
More file actions
583 lines (478 loc) · 20.3 KB
/
STEPaggregate.h
File metadata and controls
583 lines (478 loc) · 20.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
#ifndef STEPAGGREGATE_H
#define STEPAGGREGATE_H
/*
* NIST STEP Core Class Library
* clstepcore/STEPaggregate.h
* April 1997
* K. C. Morris
* David Sauder
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
class InstMgr;
class STEPaggregate;
class LOGICAL;
class BOOLEAN;
class TypeDescriptor;
#include <scl_export.h>
#include <errordesc.h>
#include <SingleLinkList.h>
#include <baseType.h>
#include <sdai.h>
#include <STEPundefined.h>
#include <string>
#define AGGR_NULL &NilSTEPaggregate
extern STEPaggregate NilSTEPaggregate;
class SingleLinkNode;
typedef STEPaggregate * STEPaggregateH;
typedef STEPaggregate * STEPaggregate_ptr;
typedef STEPaggregate_ptr STEPaggregate_var;
class SCL_CORE_EXPORT STEPaggregate : public SingleLinkList {
protected:
int _null;
protected:
virtual Severity ReadValue( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0,
int assignVal = 1, int ExchangeFileFormat = 1,
const char * currSch = 0 );
public:
int is_null() {
return _null;
}
virtual Severity AggrValidLevel( const char * value, ErrorDescriptor * err,
const TypeDescriptor * elem_type, InstMgr * insts,
int optional, char * tokenList, int addFileId = 0,
int clearError = 0 );
virtual Severity AggrValidLevel( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type, InstMgr * insts,
int optional, char * tokenList, int addFileId = 0,
int clearError = 0 );
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err = 0,
const TypeDescriptor * elem_type = 0,
InstMgr * insts = 0, int addFileId = 0 );
virtual Severity STEPread( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type = 0,
InstMgr * insts = 0, int addFileId = 0,
const char * currSch = 0 );
// OUTPUT
virtual const char * asStr( std::string & s ) const;
virtual void STEPwrite( ostream & out = cout, const char * = 0 ) const;
virtual SingleLinkNode * NewNode();
void AddNode( SingleLinkNode * );
void Empty();
STEPaggregate();
virtual ~STEPaggregate();
// COPY - defined in subtypes
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
};
/****************************************************************//**
** \class GenericAggregate
** This class supports LIST OF:
** SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
******************************************************************/
class SCL_CORE_EXPORT GenericAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
GenericAggregate();
virtual ~GenericAggregate();
};
typedef GenericAggregate * GenericAggregateH;
typedef GenericAggregate * GenericAggregate_ptr;
typedef GenericAggregate_ptr GenericAggregate_var;
/******************************************************************************
**
*****************************************************************************/
class SCL_CORE_EXPORT EntityAggregate : public STEPaggregate {
public:
virtual Severity ReadValue( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0,
int assignVal = 1, int ExchangeFileFormat = 1,
const char * currSch = 0 );
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
EntityAggregate();
virtual ~EntityAggregate();
};
typedef EntityAggregate * EntityAggregateH;
typedef EntityAggregate * EntityAggregate_ptr;
typedef EntityAggregate_ptr EntityAggregate_var;
/****************************************************************//**
** \class SelectAggregate
** This is a minimal represention for a collection of SDAI_Select
******************************************************************/
class SCL_CORE_EXPORT SelectAggregate : public STEPaggregate {
public:
virtual Severity ReadValue( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0,
int assignVal = 1, int ExchangeFileFormat = 1,
const char * currSch = 0 );
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
SelectAggregate();
virtual ~SelectAggregate();
};
typedef SelectAggregate * SelectAggregateH;
typedef SelectAggregate * SelectAggregate_ptr;
typedef SelectAggregate_ptr SelectAggregate_var;
/****************************************************************//**
** \class StringAggregate
** This class supports LIST OF STRING type
******************************************************************/
class SCL_CORE_EXPORT StringAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
StringAggregate();
virtual ~StringAggregate();
};
typedef StringAggregate * StringAggregateH;
typedef StringAggregate * StringAggregate_ptr;
typedef StringAggregate_ptr StringAggregate_var;
/****************************************************************//**
** \class BinaryAggregate
** This class supports LIST OF BINARY type
******************************************************************/
class SCL_CORE_EXPORT BinaryAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
BinaryAggregate();
virtual ~BinaryAggregate();
};
typedef BinaryAggregate * BinaryAggregateH;
typedef BinaryAggregate * BinaryAggregate_ptr;
typedef BinaryAggregate_ptr BinaryAggregate_var;
/**************************************************************//**
** \class EnumAggregate
** This is a minimal representions for a collection ofSDAI_Enum
******************************************************************/
class SCL_CORE_EXPORT EnumAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
EnumAggregate();
virtual ~EnumAggregate();
};
typedef EnumAggregate * EnumAggregateH;
typedef EnumAggregate * EnumAggregate_ptr;
typedef EnumAggregate_ptr EnumAggregate_var;
class SCL_CORE_EXPORT LOGICALS : public EnumAggregate {
public:
virtual SingleLinkNode * NewNode();
LOGICALS();
virtual ~LOGICALS();
};
typedef LOGICALS * LogicalsH;
typedef LOGICALS * LOGICALS_ptr;
typedef LOGICALS_ptr LOGICALS_var;
SCL_CORE_EXPORT LOGICALS * create_LOGICALS();
class SCL_CORE_EXPORT BOOLEANS : public EnumAggregate {
public:
virtual SingleLinkNode * NewNode();
BOOLEANS();
virtual ~BOOLEANS();
};
typedef BOOLEANS * BOOLEANS_ptr;
typedef BOOLEANS_ptr BOOLEANS_var;
SCL_CORE_EXPORT BOOLEANS * create_BOOLEANS();
class SCL_CORE_EXPORT RealAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
RealAggregate();
virtual ~RealAggregate();
};
typedef RealAggregate * RealAggregateH;
typedef RealAggregate * RealAggregate_ptr;
typedef RealAggregate_ptr RealAggregate_var;
class SCL_CORE_EXPORT IntAggregate : public STEPaggregate {
public:
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
IntAggregate();
virtual ~IntAggregate();
};
typedef IntAggregate * IntAggregateH;
typedef IntAggregate * IntAggregate_ptr;
typedef IntAggregate_ptr IntAggregate_var;
///////////////////////////////////////////////////////////////////////////////
class SCL_CORE_EXPORT STEPnode : public SingleLinkNode {
protected:
int _null;
public:
int is_null() {
return _null;
}
void set_null() {
_null = 1;
}
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
};
typedef STEPnode * STEPnodeH;
/**************************************************************//**
** \class GenericAggregate
** This class is for the Nodes of GenericAggregates
******************************************************************/
class SCL_CORE_EXPORT GenericAggrNode : public STEPnode {
public:
SCLundefined value;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
GenericAggrNode( const char * str );
GenericAggrNode( GenericAggrNode & gan );
GenericAggrNode();
~GenericAggrNode();
virtual SingleLinkNode * NewNode();
};
/////////////////////////////////////////////////////////////////////////////
class SCL_CORE_EXPORT EntityNode : public STEPnode {
public:
SDAI_Application_instance * node;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
virtual Severity STEPread( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
virtual Severity STEPread( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
EntityNode( SDAI_Application_instance * e );
EntityNode();
~EntityNode();
virtual SingleLinkNode * NewNode();
// Calling these funtions is an error.
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( s, err, 0, 0, 0 );
}
Severity StrToVal( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( in, err, 0, 0, 0 );
}
Severity STEPread( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( s, err, 0, 0, 0 );
}
Severity STEPread( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( in, err, 0, 0, 0 );
}
};
///////////////////////////////////////////////////////////////////////////
/**************************************************************//**
** \class SelectNode
** This is a minimal representions for node in lists of SDAI_Select
******************************************************************/
class SCL_CORE_EXPORT SelectNode : public STEPnode {
public:
SDAI_Select * node;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0,
const char * currSch = 0 );
virtual Severity STEPread( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0 );
virtual Severity STEPread( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgr * insts, int addFileId = 0,
const char * currSch = 0 );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
SelectNode( SDAI_Select * s );
SelectNode();
~SelectNode();
virtual SingleLinkNode * NewNode();
// Calling these funtions is an error.
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( s, err, 0, 0, 0 );
}
Severity StrToVal( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( in, err, 0, 0, 0 );
}
Severity STEPread( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( s, err, 0, 0, 0 );
}
Severity STEPread( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( in, err, 0, 0, 0 );
}
};
/**************************************************************//**
** \class StringNode
** This class is for the Nodes of StringAggregates
******************************************************************/
class SCL_CORE_EXPORT StringNode : public STEPnode {
public:
SDAI_String value;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
StringNode( StringNode & sn );
StringNode( const char * sStr );
StringNode();
~StringNode();
virtual SingleLinkNode * NewNode();
};
///////////////////////////////////////////////////////////////////////////
/**************************************************************//**
** \class BinaryNode
** This class is for the Nodes of BinaryAggregates
******************************************************************/
class SCL_CORE_EXPORT BinaryNode : public STEPnode {
public:
SDAI_Binary value;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
BinaryNode( BinaryNode & bn );
BinaryNode( const char * sStr );
BinaryNode();
~BinaryNode();
virtual SingleLinkNode * NewNode();
};
/**************************************************************//**
** \class EnumNode
** This is a minimal representions for node in lists of SDAI_Enum
******************************************************************/
class SCL_CORE_EXPORT EnumNode : public STEPnode {
public:
SDAI_Enum * node;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
EnumNode( SDAI_Enum * e );
EnumNode();
~EnumNode();
virtual SingleLinkNode * NewNode();
};
class SCL_CORE_EXPORT RealNode : public STEPnode {
public:
SDAI_Real value; // double
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
RealNode();
~RealNode();
virtual SingleLinkNode * NewNode();
};
class SCL_CORE_EXPORT IntNode : public STEPnode {
public:
SDAI_Integer value; // long int
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
IntNode();
~IntNode();
virtual SingleLinkNode * NewNode();
};
/******************************************************************
** FIXME The following classes are currently stubs
**
**/
/*
class Array : public STEPaggregate {
public:
int lowerBound;
int upperBound;
};
class Bag : public STEPaggregate {
public:
int min_ele;
int max_ele;
};
class List : public STEPaggregate {
int min_ele;
int max_ele;
List *prev;
};
class Set :
public STEPaggregate {
int cnt;
};
*/
#endif