forked from stepcode/stepcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplicitItemId.h
More file actions
124 lines (100 loc) · 3.39 KB
/
explicitItemId.h
File metadata and controls
124 lines (100 loc) · 3.39 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
#ifndef EXPLICITITEMID_H
#define EXPLICITITEMID_H
#include "interfacedItem.h"
class SC_CORE_EXPORT Explicit_item_id : public Interfaced_item {
protected:
Explicit_item_id();
Explicit_item_id( const Explicit_item_id & );
Explicit_item_id( const char * foreign_schema, TypeDescriptor * ld,
const char * oi, const char * ni )
: Interfaced_item( foreign_schema ), _local_definition( ld ), _original_id( oi ), _new_id( ni ) {}
virtual ~Explicit_item_id();
public:
// definition in the local schema. The TypeDescriptor (or subtype) is not
// implemented quite right - the name in it is the original (foreign
// schema) name. The USE or REFERENCED renames are listed in
// TypeDescriptor's altNames member variable.
// Warning: This is currently a null ptr for objects other than
// types and entities - that is - if this is a USEd FUNCTION or PROCEDURE
// this ptr will be null.
const TypeDescriptor * _local_definition;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
// name in originating schema - only exists if it has been renamed.
Express_id _original_id;
Express_id _new_id; // original or renamed name via USE or REFERENCE (non-SDAI)
#ifdef _MSC_VER
#pragma warning( pop )
#endif
const TypeDescriptor * local_definition_() const {
return _local_definition;
}
const Express_id original_id_() const {
return _original_id;
}
// non-sdai, renamed name
const Express_id new_id_() const {
return _new_id;
}
// return string "USE" or "REFERENCE"
virtual const char * EXPRESS_type() = 0;
// private:
void local_definition_( const TypeDescriptor * td ) {
_local_definition = td;
}
void original_id_( const Express_id & ei ) {
_original_id = ei;
}
// non-sdai
void new_id_( const Express_id & ni ) {
_new_id = ni;
}
};
typedef Explicit_item_id * Explicit_item_id_ptr;
class SC_CORE_EXPORT Explicit_item_id__set {
public:
Explicit_item_id__set( int = 16 );
~Explicit_item_id__set();
Explicit_item_id_ptr & operator[]( int index );
void Insert( Explicit_item_id_ptr, int index );
void Append( Explicit_item_id_ptr );
void Remove( int index );
int Index( Explicit_item_id_ptr );
int Count();
void Clear();
private:
void Check( int index );
private:
Explicit_item_id_ptr * _buf;
int _bufsize;
int _count;
};
typedef Explicit_item_id__set * Explicit_item_id__set_ptr;
typedef Explicit_item_id__set_ptr Explicit_item_id__set_var;
class SC_CORE_EXPORT Used_item : public Explicit_item_id {
public:
Used_item() {}
Used_item( const char * foreign_schema, TypeDescriptor * ld,
const char * oi, const char * ni )
: Explicit_item_id( foreign_schema, ld, oi, ni ) {}
virtual ~Used_item() {}
const char * EXPRESS_type() {
return "USE";
}
};
typedef Used_item * Used_item_ptr;
class SC_CORE_EXPORT Referenced_item : public Explicit_item_id {
public:
Referenced_item() {}
Referenced_item( const char * foreign_schema, TypeDescriptor * ld,
const char * oi, const char * ni )
: Explicit_item_id( foreign_schema, ld, oi, ni ) {}
virtual ~Referenced_item() {}
const char * EXPRESS_type() {
return "REFERENCE";
}
};
typedef Referenced_item * Referenced_item_ptr;
#endif //EXPLICITITEMID_H