-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathsdaiSelect.h
More file actions
145 lines (115 loc) · 5.41 KB
/
Copy pathsdaiSelect.h
File metadata and controls
145 lines (115 loc) · 5.41 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
#ifndef _STEPSELECT_H
#define _STEPSELECT_H
/*
* NIST STEP Core Class Library
* clstepcore/sdaiSelect.h
* April 1997
* Dave Helfrick
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
#include <sc_export.h>
/**
** \file sdaiSelect.h class definition for the select superclass SDAI_Select.
**/
class STEPaggregate;
class SC_CORE_EXPORT SDAI_Select {
private:
class Storage;
Storage * _storage;
protected:
const SelectTypeDescriptor * _type;
const TypeDescriptor * underlying_type;
BASE_TYPE base_type; // used by the subtypes
// it looks like this member, val, is not used anywhere 9/27/96 - DAS
SDAI_String val;
ErrorDescriptor _error;
const TypeDescriptor * SetUnderlyingType( const TypeDescriptor * );
const TypeDescriptor * CanBe( const char * ) const;
const TypeDescriptor * CanBe( BASE_TYPE ) const;
const TypeDescriptor * CanBe( const TypeDescriptor * td ) const;
const TypeDescriptor * CanBeSet( const char *, const char * ) const;
int IsUnique( const BASE_TYPE bt ) const;
virtual const TypeDescriptor * AssignEntity( SDAI_Application_instance * se );
virtual SDAI_Select * NewSelect();
void * ValueAddress();
const void * ValueAddress() const;
public:
Severity severity() const;
Severity severity( Severity );
std::string Error();
void Error( const char * );
// clears select's error
void ClearError();
// clears error
virtual BASE_TYPE ValueType() const;
// constructors
SDAI_Select( const SelectTypeDescriptor * s = 0,
const TypeDescriptor * td = 0 );
SDAI_Select( const SDAI_Select & other );
virtual ~SDAI_Select();
// from SDAI binding
SDAI_String UnderlyingTypeName() const;
const TypeDescriptor * CurrentUnderlyingType() const;
bool exists() const;
void nullify();
Severity SelectValidLevel( const char * attrValue, ErrorDescriptor * err,
InstMgrBase * im );
// reading and writing
const char * STEPwrite( std::string & s, const char * currSch = 0 ) const;
void STEPwrite( ostream & out = cout, const char * currSch = 0 ) const;
// IMS 8/2/95: added as part of new select implementation
virtual void STEPwrite_verbose( ostream & out = cout, const char * = 0 )
const;
virtual void STEPwrite_content( ostream & out, const char * = 0 ) const;
Severity StrToVal( const char * val, const char * selectType,
ErrorDescriptor * err, InstMgrBase * instances = 0 );
virtual Severity StrToVal_content( const char *,
InstMgrBase * instances = 0 );
Severity STEPread( istream & in, ErrorDescriptor * err,
InstMgrBase * instances = 0, const char * utype = 0,
int addFileId = 0, const char * = NULL );
// Descriptor-driven default; API v1 SELECTs may override it.
virtual Severity STEPread_content( istream & in = cin,
InstMgrBase * instances = 0,
const char * utype = 0,
int addFileId = 0,
const char * currSch = 0 );
//windows complains if operator= is pure virtual, perhaps because the impl is not in the lib with the definition
//linux has a regression if the pure virtual operator= is commented out
virtual SDAI_Select & operator =( const SDAI_Select & other );
SDAI_Select & operator =( const SDAI_Select * other );
SDAI_Select * Clone() const;
// Descriptor-driven value API used by generated API v2 classes and
// by applications that do not need per-choice early-bound members.
bool SetInteger( const TypeDescriptor *, SDAI_Integer );
bool SetReal( const TypeDescriptor *, SDAI_Real );
bool SetString( const TypeDescriptor *, const SDAI_String & );
bool SetBinary( const TypeDescriptor *, const SDAI_Binary & );
bool SetEnum( const TypeDescriptor *, const SDAI_Enum & );
bool SetSelect( const TypeDescriptor *, const SDAI_Select & );
bool SetAggregate( const TypeDescriptor *, const STEPaggregate & );
bool SetEntity( SDAI_Application_instance * );
SDAI_Integer * IntegerValue();
const SDAI_Integer * IntegerValue() const;
SDAI_Real * RealValue();
const SDAI_Real * RealValue() const;
SDAI_String * StringValue();
const SDAI_String * StringValue() const;
SDAI_Binary * BinaryValue();
const SDAI_Binary * BinaryValue() const;
SDAI_Enum * EnumValue();
const SDAI_Enum * EnumValue() const;
SDAI_Select * SelectValue();
const SDAI_Select * SelectValue() const;
STEPaggregate * AggregateValue();
const STEPaggregate * AggregateValue() const;
SDAI_Application_instance * EntityValue() const;
//FIXME set_null always returns true. why not void?!
bool set_null();
bool is_null();
}; /** end class **/
typedef SDAI_Select * SDAI_Select_ptr;
typedef SDAI_Select_ptr SDAI_Select_var;
#endif