1 #ifndef P23SDAI_H
2 #define P23SDAI_H
3
4 /*
5 * NIST STEP Core Class Library
6 * clstepcore/sdai.h
7 * April 1997
8 * David Sauder
9 * KC Morris
10
11 * Development of this software was funded by the United States Government,
12 * and is not subject to copyright.
13
14 * This file is included to support the proposed SDAI/C++ Language Binding
15 * specified in Annex D of STEP Part 22.
16
17 * This file specifies the appropriate naming conventions and NULL
18 * values for the EXPRESS base types.
19 */
20
21 #include "sc_cf.h"
22 #include <sc_export.h>
23
24 extern const char * SCLversion;
25
26 #include <ctype.h>
27 #include <string>
28
29
30 #include "dictdefs.h"
31
32 #include "baseType.h"
33 #include "Str.h"
34 #include "errordesc.h"
35
36 typedef std::string Express_id;
37
38 class TypeDescriptor;
39 class EntityDescriptor;
40 class SelectTypeDescriptor;
41 class InstMgrBase;
42
43 #include "STEPattributeList.h"
44 #include "STEPinvAttrList.h"
45
46 class STEPattributeList;
47 class STEPattribute;
48
49 #ifndef BINARY_DELIM
50 #define BINARY_DELIM '\"'
51 #endif
52
53 // STRING
54 #define S_STRING_NULL ""
55
56
57 typedef long SDAI_Integer;
58 typedef short SDAI_Short;
59 typedef unsigned short SDAI_UShort;
60 typedef unsigned long SDAI_ULong;
61 typedef double SDAI_Real;
62
63 // C++ from values.h DAS PORT
64 extern SC_CORE_EXPORT const SDAI_Integer SDAI_INT_NULL;
65 extern SC_CORE_EXPORT const SDAI_Real SDAI_REAL_NULL;
66 // arbitrary choice by me for number DAS
67 extern SC_CORE_EXPORT const SDAI_Real SDAI_NUMBER_NULL;
68
69
70 enum SDAI_Access_type {
71 SDAI_sdaiRO,
72 SDAI_sdaiRW,
73 SDAI_Access_type_unset
74 };
75
76 enum SDAI_Commit_mode {
77 SDAI_sdaiCOMMIT,
78 SDAI_sdaiABORT
79 } ;
80
81 enum SDAI_AttrFlag {
82 SDAI_sdaiSET,
83 SDAI_sdaiUNSET
84 } ;
85
86 enum SDAI_ImplementationClass {
87 SDAI_sdaiCLASS1,
88 SDAI_sdaiCLASS2,
89 SDAI_sdaiCLASS3,
90 SDAI_sdaiCLASS4,
91 SDAI_sdaiCLASS5
92 }; // conflict with part 22 EXPRESS:
93
94 enum SDAI_Error_id {
95 //
96 // error codes taken from 10303-23, Jan 28, 1997.
97 // ISO TC184/SC4/WG11 N 004
98 //
99 SDAI_sdaiNO_ERR = 0, // No error
100 SDAI_sdaiSS_OPN = 10, // Session open
101 SDAI_sdaiSS_NAVL = 20, // Session not available
102 SDAI_sdaiSS_NOPN = 30, // Session is not open
103 SDAI_sdaiRP_NEXS = 40, // Repository does not exist
104 SDAI_sdaiRP_NAVL = 50, // Repository not available
105 SDAI_sdaiRP_OPN = 60, // Repository already opened
106 SDAI_sdaiRP_NOPN = 70, // Repository is not open
107 SDAI_sdaiTR_EAB = 80, // Transaction ended abnormally so it no longer exists
108 SDAI_sdaiTR_EXS = 90, // Transaction exists
109 SDAI_sdaiTR_NAVL = 100, // Transaction not available
110 SDAI_sdaiTR_RW = 110, // Transaction read-write
111 SDAI_sdaiTR_NRW = 120, // Transaction not read-write
112 SDAI_sdaiTR_NEXS = 130, // Transaction does not exist
113 SDAI_sdaiMO_NDEQ = 140, // SDAI-model not domain-equivalent
114 SDAI_sdaiMO_NEXS = 150, // SDAI-model does not exist
115 SDAI_sdaiMO_NVLD = 160, // SDAI-model invalid
116 SDAI_sdaiMO_DUP = 170, // SDAI-model duplicate
117 SDAI_sdaiMX_NRW = 180, // SDAI-model access not read-write
118 SDAI_sdaiMX_NDEF = 190, // SDAI-model access is not defined
119 SDAI_sdaiMX_RW = 200, // SDAI-model access read-write
120 SDAI_sdaiMX_RO = 210, // SDAI-model access read-only
121 SDAI_sdaiSD_NDEF = 220, // Schema definition is not defined
122 SDAI_sdaiED_NDEF = 230, // Entity definition not defined
123 SDAI_sdaiED_NDEQ = 240, // Entity definition not domain equivalent
124 SDAI_sdaiED_NVLD = 250, // Entity definition invalid
125 // SDAI_sdaiED_NAVL = 250, // Entity definition not available
126 SDAI_sdaiRU_NDEF = 260, // Rule not defined
127 SDAI_sdaiEX_NSUP = 270, // Expression evaluation not supported
128 SDAI_sdaiAT_NVLD = 280, // Attribute invalid
129 SDAI_sdaiAT_NDEF = 290, // Attribute not defined
130 SDAI_sdaiSI_DUP = 300, // Schema instance duplicate
131 SDAI_sdaiSI_NEXS = 310, // Schema instance does not exist
132 SDAI_sdaiEI_NEXS = 320, // Entity instance does not exist
133 SDAI_sdaiEI_NAVL = 330, // Entity instance not available
134 SDAI_sdaiEI_NVLD = 340, // Entity instance invalid
135 SDAI_sdaiEI_NEXP = 350, // Entity instance not exported
136 SDAI_sdaiSC_NEXS = 360, // Scope does not exist
137 SDAI_sdaiSC_EXS = 370, // Scope exists
138 SDAI_sdaiAI_NEXS = 380, // Aggregate instance does not exist
139 SDAI_sdaiAI_NVLD = 390, // Aggregate instance invalid
140 SDAI_sdaiAI_NSET = 400, // Aggregate instance is empty
141 SDAI_sdaiVA_NVLD = 410, // Value invalid
142 SDAI_sdaiVA_NEXS = 420, // Value does not exist
143 SDAI_sdaiVA_NSET = 430, // Value not set
144 SDAI_sdaiVT_NVLD = 440, // Value type invalid
145 SDAI_sdaiIR_NEXS = 450, // Iterator does not exist
146 SDAI_sdaiIR_NSET = 460, // Current member is not defined
147 SDAI_sdaiIX_NVLD = 470, // Index invalid
148 SDAI_sdaiER_NSET = 480, // Event recording not set
149 SDAI_sdaiOP_NVLD = 490, // Operator invalid
150 SDAI_sdaiFN_NAVL = 500, // Function not available
151 SDAI_sdaiSY_ERR = 1000 // Underlying system error
152 };
153
154 typedef char * SDAI_Time_stamp;
155 typedef char * SDAI_Entity_name;
156 typedef char * SDAI_Schema_name;
157
158 #include <sdaiString.h>
159
160 #include <sdaiBinary.h>
161
162 // define Object which I am calling sdaiObject for now - DAS
163 #include <sdaiObject.h>
164
165 /******************************************************************************
166 ENUMERATION
167 These types do not use the interface specified.
168 The interface used is to enumerated values. The enumerations are
169 mapped in the following way:
170 * enumeration-item-from-schema ==> enumeration item in c++ enum clause
171 * all enumeration items in c++ enum are in upper case
172 * the value ENUM_NULL is used to represent NULL for all enumerated types
173 *****************************************************************************/
174
175 #include <sdaiEnum.h>
176
177 /******************************************************************************
178 BOOLEAN and LOGICAL
179
180 Logical are implemented as an enumeration in sdaiEnum.h:
181
182 Boolean are implemented as an enumeration in sdaiEnum.h:
183
184 ******************************************************************************/
185
186 // ***note*** this file needs classes from sdaiEnum.h
187 // define DAObjectID and classes PID, PID_DA, PID_SDAI, DAObject, DAObject_SDAI
188 #include <sdaiDaObject.h>
189
190
191 #include <sdaiApplication_instance.h>
192 #include <sdaiApplication_instance_set.h>
193
194 /******************************************************************************
195 SELECT
196
197 Selects are represented as subclasses of the SDAI_Select class in
198 sdaiSelect.h
199
200 ******************************************************************************/
201 #include <sdaiSelect.h>
202
203 class SDAI_Model_contents;
204 typedef SDAI_Model_contents * SDAI_Model_contents_ptr;
205 typedef SDAI_Model_contents_ptr SDAI_Model_contents_var;
206
207 #include <sdaiModel_contents_list.h>
208
209 #include <sdaiSession_instance.h>
210 #include <sdaiEntity_extent.h>
211 #include <sdaiEntity_extent_set.h>
212 #include <sdaiModel_contents.h>
213
214 // ENTITY
215 extern SC_CORE_EXPORT SDAI_Application_instance NilSTEPentity;
216 #define ENTITY_NULL &NilSTEPentity
217 #define NULL_ENTITY &NilSTEPentity
218 #define S_ENTITY_NULL &NilSTEPentity
219
220
221 typedef SDAI_Application_instance STEPentity;
222 typedef SDAI_Application_instance * STEPentity_ptr;
223 typedef STEPentity_ptr STEPentity_var;
224
225 typedef SDAI_Application_instance * STEPentityPtr;
226 typedef SDAI_Application_instance * STEPentityH;
227
228 extern SC_CORE_EXPORT SDAI_Application_instance *
229 ReadEntityRef( istream & in, ErrorDescriptor * err, const char * tokenList,
230 InstMgrBase * instances, int addFileId );
231
232 #define SdaiInteger SDAI_Integer
233 #define SdaiReal SDAI_Real
234
235 #define STEPenumeration SDAI_Enum
236 #define SdaiSelect SDAI_Select
237 #define SdaiString SDAI_String
238 #define SdaiBinary SDAI_Binary
239
240 #define S_INT_NULL SDAI_INT_NULL
241 #define S_REAL_NULL SDAI_REAL_NULL
242 #define S_NUMBER_NULL SDAI_NUMBER_NULL
243
244 /******************************************************************************
245 AGGREGATE TYPES
246
247 Aggregate types are accessed generically. (There are not seperate
248 classes for the different types of aggregates.) Aggregates are
249 implemented through the STEPaggregate class.
250
251 ******************************************************************************/
252
create_BOOLEAN()253 inline SDAI_BOOLEAN * create_BOOLEAN() {
254 return new SDAI_BOOLEAN ;
255 }
256
create_LOGICAL()257 inline SDAI_LOGICAL * create_LOGICAL() {
258 return new SDAI_LOGICAL ;
259 }
260
261 // below is outdated
262 typedef SDAI_Select * SdaiSelectH;
263
264 #endif
265