-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathRegistry.h
More file actions
99 lines (78 loc) · 3.21 KB
/
Registry.h
File metadata and controls
99 lines (78 loc) · 3.21 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
#ifndef _REGISTRY_H
#define _REGISTRY_H
/*
* NIST STEP Core Class Library
* clstepcore/Registry.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.
*/
#include <sc_export.h>
#include <sdai.h>
#include <errordesc.h>
#include <sc_hash.h>
#include <Str.h>
#include <complexSupport.h>
// defined and created in Registry.cc
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiINTEGER;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiREAL;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiNUMBER;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiSTRING;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiBINARY;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiBOOLEAN;
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiLOGICAL;
typedef struct Hash_Table * HashTable;
class Registry;
typedef void ( * CF_init )( Registry & ); // pointer to creation initialization
class SC_CORE_EXPORT Registry {
protected:
HashTable primordialSwamp; // dictionary of EntityDescriptors
HashTable active_schemas; // dictionary of Schemas
HashTable active_types; // dictionary of TypeDescriptors
ComplexCollect * col; // struct containing all complex entity info
int entity_cnt,
all_ents_cnt;
HashEntry cur_entity;
HashEntry cur_schema;
HashEntry cur_type;
// used by AddEntity() and RemoveEntity() to deal with renamings of an
// entity done in a USE or REFERENCE clause - see header comments in
// file Registry.inline.cc
void AddClones( const EntityDescriptor & );
void RemoveClones( const EntityDescriptor & );
public:
Registry( CF_init initFunct );
~Registry();
void DeleteContents(); // CAUTION: calls delete on all the descriptors
const EntityDescriptor * FindEntity( const char *, const char * = 0,
int check_case = 0 ) const;
const Schema * FindSchema( const char *, int check_case = 0 ) const;
const TypeDescriptor * FindType( const char *, int check_case = 0 ) const;
void AddEntity( const EntityDescriptor & );
void AddSchema( const Schema & );
void AddType( const TypeDescriptor & );
void RemoveEntity( const char * );
void RemoveSchema( const char * );
void RemoveType( const char * );
int GetEntityCnt();
int GetFullEntCnt() {
return all_ents_cnt;
}
void ResetEntities();
const EntityDescriptor * NextEntity();
void ResetSchemas();
const Schema * NextSchema();
void ResetTypes();
const TypeDescriptor * NextType();
const ComplexCollect * CompCol() {
return col;
}
void SetCompCollect( ComplexCollect * c ) {
col = c;
}
SDAI_Application_instance * ObjCreate( const char * nm, const char * = 0,
int check_case = 0 ) const;
};
#endif /* _REGISTRY_H */