15 #ifndef INTERROGATEDATABASE_H 16 #define INTERROGATEDATABASE_H 18 #include "dtoolbase.h" 20 #include "interrogate_interface.h" 21 #include "interrogateType.h" 22 #include "interrogateFunction.h" 23 #include "interrogateFunctionWrapper.h" 24 #include "interrogateManifest.h" 25 #include "interrogateElement.h" 26 #include "interrogateMakeSeq.h" 27 #include "interrogate_request.h" 48 bool get_error_flag();
50 int get_num_global_types();
51 TypeIndex get_global_type(
int n);
52 int get_num_all_types();
53 TypeIndex get_all_type(
int n);
54 int get_num_global_functions();
55 FunctionIndex get_global_function(
int n);
56 int get_num_all_functions();
57 FunctionIndex get_all_function(
int n);
58 int get_num_global_manifests();
59 ManifestIndex get_global_manifest(
int n);
60 int get_num_global_elements();
61 ElementIndex get_global_element(
int n);
70 INLINE TypeIndex lookup_type_by_name(
const string &name);
71 INLINE TypeIndex lookup_type_by_scoped_name(
const string &name);
72 INLINE TypeIndex lookup_type_by_true_name(
const string &name);
73 INLINE ManifestIndex lookup_manifest_by_name(
const string &name);
74 INLINE ElementIndex lookup_element_by_name(
const string &name);
75 INLINE ElementIndex lookup_element_by_scoped_name(
const string &name);
77 void remove_type(TypeIndex type);
79 void *get_fptr(FunctionWrapperIndex wrapper);
81 FunctionWrapperIndex get_wrapper_by_unique_name(
const string &unique_name);
83 static int get_file_major_version();
84 static int get_file_minor_version();
85 static int get_current_major_version();
86 static int get_current_minor_version();
90 void set_error_flag(
bool error_flag);
95 void add_wrapper(FunctionWrapperIndex index,
108 int remap_indices(
int first_index);
115 INLINE
void check_latest();
121 bool find_module(FunctionWrapperIndex wrapper,
123 int binary_search_module(
int begin,
int end, FunctionIndex
function);
126 const string &wrapper_hash_name);
129 typedef map<TypeIndex, InterrogateType> TypeMap;
131 typedef map<FunctionIndex, InterrogateFunction *> FunctionMap;
132 FunctionMap _function_map;
133 typedef map<FunctionWrapperIndex, InterrogateFunctionWrapper> FunctionWrapperMap;
134 FunctionWrapperMap _wrapper_map;
136 typedef map<ManifestIndex, InterrogateManifest> ManifestMap;
137 ManifestMap _manifest_map;
138 typedef map<ElementIndex, InterrogateElement> ElementMap;
139 ElementMap _element_map;
141 typedef map<MakeSeqIndex, InterrogateMakeSeq> MakeSeqMap;
142 MakeSeqMap _make_seq_map;
144 typedef vector<TypeIndex> GlobalTypes;
145 GlobalTypes _global_types;
146 GlobalTypes _all_types;
147 typedef vector<FunctionIndex> GlobalFunctions;
148 GlobalFunctions _global_functions;
149 GlobalFunctions _all_functions;
150 typedef vector<ManifestIndex> GlobalManifests;
151 GlobalManifests _global_manifests;
152 typedef vector<ElementIndex> GlobalElements;
153 GlobalElements _global_elements;
157 typedef vector<InterrogateModuleDef *> Modules;
159 typedef map<string, InterrogateModuleDef *> ModulesByHash;
160 ModulesByHash _modules_by_hash;
164 typedef vector<InterrogateModuleDef *> Requests;
171 LT_type_name = 0x001,
172 LT_type_scoped_name = 0x002,
173 LT_type_true_name = 0x004,
174 LT_manifest_name = 0x008,
175 LT_element_name = 0x010,
176 LT_element_scoped_name = 0x020,
180 typedef map<string, int> Lookup;
181 Lookup _types_by_name;
182 Lookup _types_by_scoped_name;
183 Lookup _types_by_true_name;
184 Lookup _manifests_by_name;
185 Lookup _elements_by_name;
186 Lookup _elements_by_scoped_name;
188 void freshen_types_by_name();
189 void freshen_types_by_scoped_name();
190 void freshen_types_by_true_name();
191 void freshen_manifests_by_name();
192 void freshen_elements_by_name();
193 void freshen_elements_by_scoped_name();
195 int lookup(
const string &name,
196 Lookup &lookup, LookupType type,
200 static int _file_major_version;
201 static int _file_minor_version;
202 static int _current_major_version;
203 static int _current_minor_version;
206 #include "interrogateDatabase.I"
This class manages a mapping of integers to integers.
Represents a synthetic method created via the MAKE_SEQ() macro.
This stores all of the interrogate data and handles reading the data from a disk file when necessary...
An internal representation of a type.
An internal representation of a function.
An internal representation of a callable function.
An internal representation of a manifest constant.
An internal representation of a data element, like a data member or a global variable.