-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathentityDescriptor.h
More file actions
156 lines (127 loc) · 4.78 KB
/
entityDescriptor.h
File metadata and controls
156 lines (127 loc) · 4.78 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
#ifndef ENTITYDESCRIPTOR_H
#define ENTITYDESCRIPTOR_H
#include "typeDescriptor.h"
#include "attrDescriptor.h"
#include "uniquenessRule.h"
#include "attrDescriptorList.h"
#include "inverseAttributeList.h"
#include "sc_export.h"
typedef SDAI_Application_instance * ( * Creator )();
class Registry;
/** EntityDescriptor
*
* An instance of this class will be generated for each entity type
* found in the schema. This should probably be derived from the
* CreatorEntry class (see sdaiApplicaton_instance.h). Then the binary tree
* that the current software builds up containing the entities in the schema
* will be building the same thing but using the new schema info.
* nodes (i.e. EntityDesc nodes) for each entity.
*/
class SC_CORE_EXPORT EntityDescriptor : public TypeDescriptor {
protected:
SDAI_LOGICAL _abstractEntity;
SDAI_LOGICAL _extMapping; /**< does external mapping have to be used to create an instance of us? (see STEP Part 21, sect 11.2.5.1) */
EntityDescriptorList _subtypes; // OPTIONAL
EntityDescriptorList _supertypes; // OPTIONAL
AttrDescriptorList _explicitAttr; // OPTIONAL
Inverse_attributeList _inverseAttr; // OPTIONAL
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string _supertype_stmt;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
Uniqueness_rule__set_var _uniqueness_rules; // initially a null pointer
// pointer to a function that will create a new instance of a SDAI_Application_instance
Creator NewSTEPentity;
EntityDescriptor( );
EntityDescriptor( const char * name, // i.e. char *
Schema * origSchema,
Logical abstractEntity, // i.e. F U or T
Logical extMapping,
Creator f = 0
);
virtual ~EntityDescriptor();
void InitIAttrs( Registry & reg, const char * schNm );
const char * GenerateExpress( std::string & buf ) const;
const char * QualifiedName( std::string & s ) const;
const SDAI_LOGICAL & AbstractEntity() const {
return _abstractEntity;
}
const SDAI_LOGICAL & ExtMapping() const {
return _extMapping;
}
void AbstractEntity( SDAI_LOGICAL & ae ) {
_abstractEntity.put( ae.asInt() );
}
void ExtMapping( SDAI_LOGICAL & em ) {
_extMapping.put( em.asInt() );
}
void AbstractEntity( Logical ae ) {
_abstractEntity.put( ae );
}
void ExtMapping( Logical em ) {
_extMapping.put( em );
}
void ExtMapping( const char * em ) {
_extMapping.put( em );
}
const EntityDescriptorList & Subtypes() const {
return _subtypes;
}
const EntityDescriptorList & Supertypes() const {
return _supertypes;
}
const EntityDescriptorList & GetSupertypes() const {
return _supertypes;
}
const AttrDescriptorList & ExplicitAttr() const {
return _explicitAttr;
}
const Inverse_attributeList & InverseAttr() const {
return _inverseAttr;
}
virtual const EntityDescriptor * IsA( const EntityDescriptor * ) const;
virtual const TypeDescriptor * IsA( const TypeDescriptor * td ) const;
virtual const TypeDescriptor * IsA( const char * n ) const {
return TypeDescriptor::IsA( n );
}
virtual const TypeDescriptor * CanBe( const TypeDescriptor * o ) const {
return o -> IsA( this );
}
virtual const TypeDescriptor * CanBe( const char * n ) const {
return TypeDescriptor::CanBe( n );
}
// The following will be used by schema initialization functions
void AddSubtype( EntityDescriptor * ed ) {
_subtypes.AddNode( ed );
}
void AddSupertype_Stmt( const std::string & s ) {
_supertype_stmt = s;
}
const char * Supertype_Stmt() {
return _supertype_stmt.c_str();
}
std::string & supertype_stmt_() {
return _supertype_stmt;
}
void AddSupertype( EntityDescriptor * ed ) {
_supertypes.AddNode( ed );
}
void AddExplicitAttr( AttrDescriptor * ad ) {
_explicitAttr.AddNode( ad );
}
void AddInverseAttr( Inverse_attribute * ia ) {
_inverseAttr.AddNode( ia );
}
void uniqueness_rules_( Uniqueness_rule__set * urs ) {
_uniqueness_rules = urs;
}
Uniqueness_rule__set_var & uniqueness_rules_() {
return _uniqueness_rules;
}
};
#endif //ENTITYDESCRIPTOR_H