Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

InterrogateDatabase Class Reference

This stores all of the interrogate data and handles reading the data from a disk file when necessary. More...

#include <interrogateDatabase.h>

List of all members.

Public Member Functions

void request_module (InterrogateModuleDef *def)
 Requests that the interrogate data for the given module be made available.

int get_num_global_types ()
 Returns the total number of "global" types known to the interrogate database.

TypeIndex get_global_type (int n)
 Returns the index of the nth global type known to the interrogate database.

int get_num_all_types ()
 Returns the total number of types known to the interrogate database.

TypeIndex get_all_type (int n)
 Returns the index of the nth type known to the interrogate database.

int get_num_global_functions ()
 Returns the total number of global functions known to the interrogate database.

FunctionIndex get_global_function (int n)
 Returns the index of the nth global function known to the interrogate database.

int get_num_all_functions ()
 Returns the total number of functions known to the interrogate database.

FunctionIndex get_all_function (int n)
 Returns the index of the nth function known to the interrogate database.

int get_num_global_manifests ()
 Returns the total number of global manifest constants known to the interrogate database.

ManifestIndex get_global_manifest (int n)
 Returns the index of the nth global manifest constant known to the interrogate database.

int get_num_global_elements ()
 Returns the total number of global data elements known to the interrogate database.

ElementIndex get_global_element (int n)
 Returns the index of the nth global data element known to the interrogate database.

const InterrogateTypeget_type (TypeIndex type)
 Returns the type associated with the given TypeIndex, if there is one.

const InterrogateFunctionget_function (FunctionIndex function)
 Returns the function associated with the given FunctionIndex, if there is one.

const InterrogateFunctionWrapperget_wrapper (FunctionWrapperIndex wrapper)
 Returns the function wrapper associated with the given FunctionWrapperIndex, if there is one.

const InterrogateManifestget_manifest (ManifestIndex manifest)
 Returns the manifest constant associated with the given ManifestIndex, if there is one.

const InterrogateElementget_element (ElementIndex element)
 Returns the data element associated with the given ElementIndex, if there is one.

TypeIndex lookup_type_by_name (const string &name)
 Returns the TypeIndex associated with the first type found with the given name, or 0 if no type has this name.

TypeIndex lookup_type_by_scoped_name (const string &name)
 Returns the TypeIndex associated with the first type found with the given scoped name, or 0 if no type has this name.

TypeIndex lookup_type_by_true_name (const string &name)
 Returns the TypeIndex associated with the first type found with the given true name, or 0 if no type has this name.

ManifestIndex lookup_manifest_by_name (const string &name)
 Returns the ManifestIndex associated with the first manifest found with the given name, or 0 if no manifest has this name.

ElementIndex lookup_element_by_name (const string &name)
 Returns the ElementIndex associated with the first element found with the given name, or 0 if no element has this name.

ElementIndex lookup_element_by_scoped_name (const string &name)
 Returns the ElementIndex associated with the first element found with the given scoped name, or 0 if no element has this name.

void remove_type (TypeIndex type)
 Erases the type from the database.

void * get_fptr (FunctionWrapperIndex wrapper)
 Returns the function pointer associated with the given function wrapper, if it has a pointer available.

FunctionWrapperIndex get_wrapper_by_unique_name (const string &unique_name)
 Looks up the function wrapper corresponding to the given unique name, if available.

int get_next_index ()
 Returns a new index number suitable for the next thing, that will not be shared with any other index numbers.

void add_type (TypeIndex index, const InterrogateType &type)
 Adds the indicated type to the database at the given index number.

void add_function (FunctionIndex index, InterrogateFunction *function)
 Adds the indicated function to the database at the given index number.

void add_wrapper (FunctionWrapperIndex index, const InterrogateFunctionWrapper &wrapper)
 Adds the indicated function wrapper to the database at the given index number.

void add_manifest (ManifestIndex index, const InterrogateManifest &manifest)
 Adds the indicated manifest constant to the database at the given index number.

void add_element (ElementIndex index, const InterrogateElement &element)
 Adds the indicated data element to the database at the given index number.

InterrogateTypeupdate_type (TypeIndex type)
 Returns a non-const reference to the indicated type, allowing the user to update it.

InterrogateFunctionupdate_function (FunctionIndex function)
 Returns a non-const reference to the indicated function, allowing the user to update it.

InterrogateFunctionWrapperupdate_wrapper (FunctionWrapperIndex wrapper)
 Returns a non-const reference to the indicated function wrapper, allowing the user to update it.

InterrogateManifestupdate_manifest (ManifestIndex manifest)
 Returns a non-const reference to the indicated manifest constant, allowing the user to update it.

InterrogateElementupdate_element (ElementIndex element)
 Returns a non-const reference to the indicated data element, allowing the user to update it.

int remap_indices (int first_index)
 Resequences all of the various index numbers so that all of the functions start at first_index and increment consecutively from there, and then all of the types follow.

int remap_indices (int first_index, IndexRemapper &remap)
 This flavor of remap_indices() accepts a map that should be empty on initial call, and will be filled with the mapping of old index number to new index number.

void write (ostream &out, InterrogateModuleDef *def) const
 Writes the database to the indicated stream for later reading.

bool read (istream &in, InterrogateModuleDef *def)
 Reads a database from the indicated stream, associated with the indicated module definition and merges it with any existing data in the database, according to the expected index numbers specified in the module def.


Static Public Member Functions

InterrogateDatabase * get_ptr ()
 Returns the global pointer to the one InterrogateDatabase.

int get_file_major_version ()
 Returns the major version number of the interrogate database file currently being read.

int get_file_minor_version ()
 Returns the minor version number of the interrogate database file currently being read.

int get_current_major_version ()
 Returns the major version number currently expected in interrogate database files generated by this code base.

int get_current_minor_version ()
 Returns the minor version number currently expected in interrogate database files generated by this code base.


Private Types

typedef map< TypeIndex, InterrogateTypeTypeMap
typedef map< FunctionIndex,
InterrogateFunction * > 
FunctionMap
typedef map< FunctionWrapperIndex,
InterrogateFunctionWrapper
FunctionWrapperMap
typedef map< ManifestIndex,
InterrogateManifest
ManifestMap
typedef map< ElementIndex,
InterrogateElement
ElementMap
typedef vector< TypeIndexGlobalTypes
typedef vector< FunctionIndexGlobalFunctions
typedef vector< ManifestIndexGlobalManifests
typedef vector< ElementIndexGlobalElements
typedef vector< InterrogateModuleDef * > Modules
typedef map< string, InterrogateModuleDef * > ModulesByHash
typedef vector< InterrogateModuleDef * > Requests
typedef map< string, int > Lookup
enum  LookupType {
  LT_type_name = 0x001, LT_type_scoped_name = 0x002, LT_type_true_name = 0x004, LT_manifest_name = 0x008,
  LT_element_name = 0x010, LT_element_scoped_name = 0x020
}

Private Member Functions

 InterrogateDatabase ()
void check_latest ()
 Checks that all the latest data for all the libraries have been loaded.

void load_latest ()
 Reads in the latest interrogate data.

bool read_new (istream &in, InterrogateModuleDef *def)
 Reads from the indicated stream (the header information has already been read) into the newly-created database.

void merge_from (const InterrogateDatabase &other)
 Copies all the data from the indicated database into this one.

bool find_module (FunctionWrapperIndex wrapper, InterrogateModuleDef *&def, int &module_index)
 Looks up the wrapper definition in the set of module defs that are loaded in at runtime and represent the part of the interrogate database that's compiled in.

int binary_search_module (int begin, int end, FunctionIndex function)
 Searches for the function module that includes the given function index by binary search.

int binary_search_wrapper_hash (InterrogateUniqueNameDef *begin, InterrogateUniqueNameDef *end, const string &wrapper_hash_name)
 Searches for the particular function wrapper's hash name within a given module.

void freshen_types_by_name ()
 Builds up the lookup of types by name.

void freshen_types_by_scoped_name ()
 Builds up the lookup of types by scoped name.

void freshen_types_by_true_name ()
 Builds up the lookup of types by true name.

void freshen_manifests_by_name ()
 Builds up the lookup of manifests by name.

void freshen_elements_by_name ()
 Builds up the lookup of elements by name.

void freshen_elements_by_scoped_name ()
 Builds up the lookup of elements by scoped name.

int lookup (const string &name, Lookup &lookup, LookupType type, void(InterrogateDatabase::*freshen)())
 Looks up a type, manifest, or element in the indicated lookup table by name.


Private Attributes

TypeMap _type_map
FunctionMap _function_map
FunctionWrapperMap _wrapper_map
ManifestMap _manifest_map
ElementMap _element_map
GlobalTypes _global_types
GlobalTypes _all_types
GlobalFunctions _global_functions
GlobalFunctions _all_functions
GlobalManifests _global_manifests
GlobalElements _global_elements
Modules _modules
ModulesByHash _modules_by_hash
Requests _requests
int _next_index
int _lookups_fresh
Lookup _types_by_name
Lookup _types_by_scoped_name
Lookup _types_by_true_name
Lookup _manifests_by_name
Lookup _elements_by_name
Lookup _elements_by_scoped_name

Static Private Attributes

InterrogateDatabase * _global_ptr = NULL
int _file_major_version = 0
int _file_minor_version = 0
int _current_major_version = 2
int _current_minor_version = 2


Detailed Description

This stores all of the interrogate data and handles reading the data from a disk file when necessary.

Definition at line 48 of file interrogateDatabase.h.


Member Typedef Documentation

typedef map<ElementIndex, InterrogateElement> InterrogateDatabase::ElementMap [private]
 

Definition at line 141 of file interrogateDatabase.h.

typedef map<FunctionIndex, InterrogateFunction *> InterrogateDatabase::FunctionMap [private]
 

Definition at line 134 of file interrogateDatabase.h.

Referenced by add_function().

typedef map<FunctionWrapperIndex, InterrogateFunctionWrapper> InterrogateDatabase::FunctionWrapperMap [private]
 

Definition at line 136 of file interrogateDatabase.h.

Referenced by add_function().

typedef vector<ElementIndex> InterrogateDatabase::GlobalElements [private]
 

Definition at line 152 of file interrogateDatabase.h.

typedef vector<FunctionIndex> InterrogateDatabase::GlobalFunctions [private]
 

Definition at line 147 of file interrogateDatabase.h.

typedef vector<ManifestIndex> InterrogateDatabase::GlobalManifests [private]
 

Definition at line 150 of file interrogateDatabase.h.

typedef vector<TypeIndex> InterrogateDatabase::GlobalTypes [private]
 

Definition at line 144 of file interrogateDatabase.h.

typedef map<string, int> InterrogateDatabase::Lookup [private]
 

Definition at line 179 of file interrogateDatabase.h.

typedef map<ManifestIndex, InterrogateManifest> InterrogateDatabase::ManifestMap [private]
 

Definition at line 139 of file interrogateDatabase.h.

typedef vector<InterrogateModuleDef *> InterrogateDatabase::Modules [private]
 

Definition at line 157 of file interrogateDatabase.h.

typedef map<string, InterrogateModuleDef *> InterrogateDatabase::ModulesByHash [private]
 

Definition at line 159 of file interrogateDatabase.h.

typedef vector<InterrogateModuleDef *> InterrogateDatabase::Requests [private]
 

Definition at line 164 of file interrogateDatabase.h.

typedef map<TypeIndex, InterrogateType> InterrogateDatabase::TypeMap [private]
 

Definition at line 132 of file interrogateDatabase.h.


Member Enumeration Documentation

enum InterrogateDatabase::LookupType [private]
 

Enumeration values:
LT_type_name 
LT_type_scoped_name 
LT_type_true_name 
LT_manifest_name 
LT_element_name 
LT_element_scoped_name 

Definition at line 169 of file interrogateDatabase.h.


Constructor & Destructor Documentation

InterrogateDatabase::InterrogateDatabase  )  [private]
 

Definition at line 41 of file interrogateDatabase.cxx.

References _global_ptr, and NULL.


Member Function Documentation

void InterrogateDatabase::add_element ElementIndex  index,
const InterrogateElement element
 

Adds the indicated data element to the database at the given index number.

Definition at line 731 of file interrogateDatabase.cxx.

References _wrapper_map.

void InterrogateDatabase::add_function FunctionIndex  index,
InterrogateFunction function
 

Adds the indicated function to the database at the given index number.

Definition at line 672 of file interrogateDatabase.cxx.

References _function_map, _wrapper_map, IndexRemapper::add_mapping(), IndexRemapper::clear(), FunctionMap, and FunctionWrapperMap.

void InterrogateDatabase::add_manifest ManifestIndex  index,
const InterrogateManifest manifest
 

Adds the indicated manifest constant to the database at the given index number.

Definition at line 712 of file interrogateDatabase.cxx.

void InterrogateDatabase::add_type TypeIndex  index,
const InterrogateType type
 

Adds the indicated type to the database at the given index number.

Definition at line 639 of file interrogateDatabase.cxx.

References _element_map, and check_latest().

Referenced by InterrogateBuilder::get_cast_function().

void InterrogateDatabase::add_wrapper FunctionWrapperIndex  index,
const InterrogateFunctionWrapper wrapper
 

Adds the indicated function wrapper to the database at the given index number.

Definition at line 694 of file interrogateDatabase.cxx.

int InterrogateDatabase::binary_search_module int  begin,
int  end,
FunctionIndex  function
[private]
 

Searches for the function module that includes the given function index by binary search.

Definition at line 1430 of file interrogateDatabase.cxx.

int InterrogateDatabase::binary_search_wrapper_hash InterrogateUniqueNameDef begin,
InterrogateUniqueNameDef end,
const string &  wrapper_hash_name
[private]
 

Searches for the particular function wrapper's hash name within a given module.

Returns the index number local to the module, or -1 if it is not found.

Definition at line 1458 of file interrogateDatabase.cxx.

Referenced by get_wrapper().

void InterrogateDatabase::check_latest  )  [inline, private]
 

Checks that all the latest data for all the libraries have been loaded.

Loads them if not.

Definition at line 34 of file interrogateDatabase.I.

References _types_by_name, freshen_types_by_name(), INLINE, lookup(), LT_type_name, and TypeIndex.

Referenced by add_type(), get_all_type(), get_current_major_version(), get_current_minor_version(), get_global_function(), get_global_type(), get_num_all_functions(), get_num_all_types(), get_num_global_types(), lookup_manifest_by_name(), lookup_type_by_name(), and lookup_type_by_true_name().

bool InterrogateDatabase::find_module FunctionWrapperIndex  wrapper,
InterrogateModuleDef *&  def,
int &  module_index
[private]
 

Looks up the wrapper definition in the set of module defs that are loaded in at runtime and represent the part of the interrogate database that's compiled in.

If the wrapper definition is not found, returns false. If it is found, returns true and sets def and module_index to the particular module and the index within the module where the wrapper is defined.

Definition at line 1405 of file interrogateDatabase.cxx.

Referenced by get_function().

void InterrogateDatabase::freshen_elements_by_name  )  [private]
 

Builds up the lookup of elements by name.

Definition at line 1555 of file interrogateDatabase.cxx.

Referenced by lookup_type_by_true_name().

void InterrogateDatabase::freshen_elements_by_scoped_name  )  [private]
 

Builds up the lookup of elements by scoped name.

Definition at line 1572 of file interrogateDatabase.cxx.

Referenced by lookup_manifest_by_name().

void InterrogateDatabase::freshen_manifests_by_name  )  [private]
 

Builds up the lookup of manifests by name.

Definition at line 1538 of file interrogateDatabase.cxx.

void InterrogateDatabase::freshen_types_by_name  )  [private]
 

Builds up the lookup of types by name.

Definition at line 1487 of file interrogateDatabase.cxx.

Referenced by check_latest().

void InterrogateDatabase::freshen_types_by_scoped_name  )  [private]
 

Builds up the lookup of types by scoped name.

Definition at line 1504 of file interrogateDatabase.cxx.

Referenced by lookup_type_by_name().

void InterrogateDatabase::freshen_types_by_true_name  )  [private]
 

Builds up the lookup of types by true name.

Definition at line 1521 of file interrogateDatabase.cxx.

FunctionIndex InterrogateDatabase::get_all_function int  n  ) 
 

Returns the index of the nth function known to the interrogate database.

Definition at line 273 of file interrogateDatabase.cxx.

Referenced by interrogate_number_of_functions().

TypeIndex InterrogateDatabase::get_all_type int  n  ) 
 

Returns the index of the nth type known to the interrogate database.

Definition at line 195 of file interrogateDatabase.cxx.

References _all_functions, and check_latest().

Referenced by interrogate_number_of_types(), and InterfaceMaker::~InterfaceMaker().

int InterrogateDatabase::get_current_major_version  )  [static]
 

Returns the major version number currently expected in interrogate database files generated by this code base.

Definition at line 590 of file interrogateDatabase.cxx.

References _type_map, and check_latest().

int InterrogateDatabase::get_current_minor_version  )  [static]
 

Returns the minor version number currently expected in interrogate database files generated by this code base.

Definition at line 607 of file interrogateDatabase.cxx.

References _function_map, and check_latest().

const InterrogateElement & InterrogateDatabase::get_element ElementIndex  element  ) 
 

Returns the data element associated with the given ElementIndex, if there is one.

Definition at line 454 of file interrogateDatabase.cxx.

References _file_minor_version.

Referenced by interrogate_element_getter(), interrogate_element_has_getter(), interrogate_element_has_setter(), interrogate_element_name(), interrogate_element_type(), interrogate_get_element_by_scoped_name(), and interrogate_manifest_get_int_value().

int InterrogateDatabase::get_file_major_version  )  [static]
 

Returns the major version number of the interrogate database file currently being read.

Definition at line 558 of file interrogateDatabase.cxx.

References _global_manifests, and _manifest_map.

int InterrogateDatabase::get_file_minor_version  )  [static]
 

Returns the minor version number of the interrogate database file currently being read.

Definition at line 573 of file interrogateDatabase.cxx.

References _element_map, _global_elements, and InterrogateElement::is_global().

void * InterrogateDatabase::get_fptr FunctionWrapperIndex  wrapper  ) 
 

Returns the function pointer associated with the given function wrapper, if it has a pointer available.

Returns NULL if the pointer is not available.

Definition at line 494 of file interrogateDatabase.cxx.

Referenced by interrogate_wrapper_has_pointer(), and interrogate_wrapper_parameter_is_this().

const InterrogateFunction & InterrogateDatabase::get_function FunctionIndex  function  ) 
 

Returns the function associated with the given FunctionIndex, if there is one.

Definition at line 385 of file interrogateDatabase.cxx.

References find_module(), InterrogateModuleDef::fptrs, NULL, and InterrogateModuleDef::num_fptrs.

Referenced by interrogate_function_c_wrapper(), interrogate_function_class(), interrogate_function_comment(), interrogate_function_has_comment(), interrogate_function_has_module_name(), interrogate_function_is_method(), interrogate_function_is_virtual(), interrogate_function_module_name(), interrogate_function_name(), interrogate_function_number_of_c_wrappers(), interrogate_function_number_of_python_wrappers(), interrogate_function_prototype(), interrogate_function_scoped_name(), and interrogate_get_function().

ElementIndex InterrogateDatabase::get_global_element int  n  ) 
 

Returns the index of the nth global data element known to the interrogate database.

Definition at line 343 of file interrogateDatabase.cxx.

References _manifest_map.

Referenced by interrogate_number_of_globals().

FunctionIndex InterrogateDatabase::get_global_function int  n  ) 
 

Returns the index of the nth global function known to the interrogate database.

Definition at line 234 of file interrogateDatabase.cxx.

References _global_manifests, check_latest(), and ManifestIndex.

Referenced by interrogate_number_of_global_functions(), and InterfaceMaker::~InterfaceMaker().

ManifestIndex InterrogateDatabase::get_global_manifest int  n  ) 
 

Returns the index of the nth global manifest constant known to the interrogate database.

Definition at line 308 of file interrogateDatabase.cxx.

References _function_map.

Referenced by interrogate_number_of_manifests(), and InterfaceMaker::~InterfaceMaker().

TypeIndex InterrogateDatabase::get_global_type int  n  ) 
 

Returns the index of the nth global type known to the interrogate database.

Definition at line 156 of file interrogateDatabase.cxx.

References _all_types, check_latest(), and TypeIndex.

Referenced by interrogate_number_of_global_types().

const InterrogateManifest & InterrogateDatabase::get_manifest ManifestIndex  manifest  ) 
 

Returns the manifest constant associated with the given ManifestIndex, if there is one.

Definition at line 431 of file interrogateDatabase.cxx.

References InterrogateModuleDef::first_index.

Referenced by interrogate_get_manifest_by_name(), interrogate_manifest_definition(), interrogate_manifest_get_type(), interrogate_manifest_getter(), interrogate_manifest_has_getter(), interrogate_manifest_has_int_value(), interrogate_manifest_has_type(), and interrogate_manifest_name().

int InterrogateDatabase::get_next_index  ) 
 

Returns a new index number suitable for the next thing, that will not be shared with any other index numbers.

Definition at line 624 of file interrogateDatabase.cxx.

Referenced by InterrogateBuilder::get_cast_function().

int InterrogateDatabase::get_num_all_functions  ) 
 

Returns the total number of functions known to the interrogate database.

This includes all known functions, global, method, or synthesized. See also get_num_global_functions().

Definition at line 257 of file interrogateDatabase.cxx.

References _global_elements, and check_latest().

Referenced by interrogate_get_global_function().

int InterrogateDatabase::get_num_all_types  ) 
 

Returns the total number of types known to the interrogate database.

This includes all known types, global as well as incidental. See also get_num_global_types().

Definition at line 179 of file interrogateDatabase.cxx.

References _global_functions, check_latest(), and FunctionIndex.

Referenced by interrogate_get_global_type(), and InterfaceMaker::~InterfaceMaker().

int InterrogateDatabase::get_num_global_elements  ) 
 

Returns the total number of global data elements known to the interrogate database.

Definition at line 327 of file interrogateDatabase.cxx.

References _wrapper_map.

Referenced by interrogate_element_setter().

int InterrogateDatabase::get_num_global_functions  ) 
 

Returns the total number of global functions known to the interrogate database.

These are functions defined at the global level, e.g. non-member functions.

Definition at line 218 of file interrogateDatabase.cxx.

References _all_functions.

Referenced by interrogate_get_global(), and InterfaceMaker::~InterfaceMaker().

int InterrogateDatabase::get_num_global_manifests  ) 
 

Returns the total number of global manifest constants known to the interrogate database.

Definition at line 292 of file interrogateDatabase.cxx.

Referenced by InterfaceMaker::~InterfaceMaker().

int InterrogateDatabase::get_num_global_types  ) 
 

Returns the total number of "global" types known to the interrogate database.

These are types defined at the global level that should be considered for exporting, but not the incidental types (like pointers, etc.) that must be defined to support these.

Definition at line 140 of file interrogateDatabase.cxx.

References _all_types, and check_latest().

Referenced by interrogate_get_wrapper_by_unique_name().

InterrogateDatabase * InterrogateDatabase::get_ptr  )  [static]
 

Returns the global pointer to the one InterrogateDatabase.

Definition at line 57 of file interrogateDatabase.cxx.

Referenced by InterrogateBuilder::clean_identifier(), InterrogateBuilder::get_cast_function(), InterrogateBuilder::get_getter(), InterfaceMaker::get_unique_prefix(), interrogate_element_getter(), interrogate_element_has_getter(), interrogate_element_has_setter(), interrogate_element_name(), interrogate_element_scoped_name(), interrogate_element_setter(), interrogate_element_type(), interrogate_function_c_wrapper(), interrogate_function_class(), interrogate_function_comment(), interrogate_function_has_comment(), interrogate_function_has_module_name(), interrogate_function_is_method(), interrogate_function_is_virtual(), interrogate_function_module_name(), interrogate_function_name(), interrogate_function_number_of_c_wrappers(), interrogate_function_number_of_python_wrappers(), interrogate_function_prototype(), interrogate_function_python_wrapper(), interrogate_function_scoped_name(), interrogate_get_element_by_name(), interrogate_get_element_by_scoped_name(), interrogate_get_function(), interrogate_get_global(), interrogate_get_global_function(), interrogate_get_global_type(), interrogate_get_manifest(), interrogate_get_manifest_by_name(), interrogate_get_type(), interrogate_get_type_by_name(), interrogate_get_type_by_scoped_name(), interrogate_get_type_by_true_name(), interrogate_get_wrapper_by_unique_name(), interrogate_manifest_definition(), interrogate_manifest_get_int_value(), interrogate_manifest_get_type(), interrogate_manifest_getter(), interrogate_manifest_has_getter(), interrogate_manifest_has_int_value(), interrogate_manifest_has_type(), interrogate_manifest_name(), interrogate_number_of_functions(), interrogate_number_of_global_functions(), interrogate_number_of_global_types(), interrogate_number_of_globals(), interrogate_number_of_manifests(), interrogate_number_of_types(), interrogate_type_atomic_token(), interrogate_type_comment(), interrogate_type_derivation_downcast_is_impossible(), interrogate_type_derivation_has_downcast(), interrogate_type_derivation_has_upcast(), interrogate_type_destructor_is_inherited(), interrogate_type_enum_value(), interrogate_type_enum_value_name(), interrogate_type_enum_value_scoped_name(), interrogate_type_get_cast(), interrogate_type_get_constructor(), interrogate_type_get_derivation(), interrogate_type_get_destructor(), interrogate_type_get_downcast(), interrogate_type_get_element(), interrogate_type_get_method(), interrogate_type_get_upcast(), interrogate_type_has_comment(), interrogate_type_has_destructor(), interrogate_type_has_module_name(), interrogate_type_is_atomic(), interrogate_type_is_class(), interrogate_type_is_const(), interrogate_type_is_enum(), interrogate_type_is_fully_defined(), interrogate_type_is_long(), interrogate_type_is_longlong(), interrogate_type_is_nested(), interrogate_type_is_pointer(), interrogate_type_is_short(), interrogate_type_is_signed(), interrogate_type_is_struct(), interrogate_type_is_union(), interrogate_type_is_unpublished(), interrogate_type_is_unsigned(), interrogate_type_is_wrapped(), interrogate_type_module_name(), interrogate_type_name(), interrogate_type_number_of_casts(), interrogate_type_number_of_constructors(), interrogate_type_number_of_derivations(), interrogate_type_number_of_elements(), interrogate_type_number_of_enum_values(), interrogate_type_number_of_methods(), interrogate_type_number_of_nested_types(), interrogate_type_outer_class(), interrogate_type_scoped_name(), interrogate_type_true_name(), interrogate_type_wrapped_type(), interrogate_wrapper_caller_manages_return_value(), interrogate_wrapper_has_pointer(), interrogate_wrapper_has_return_value(), interrogate_wrapper_is_callable_by_name(), interrogate_wrapper_number_of_parameters(), interrogate_wrapper_parameter_has_name(), interrogate_wrapper_parameter_is_this(), interrogate_wrapper_parameter_name(), interrogate_wrapper_parameter_type(), interrogate_wrapper_pointer(), interrogate_wrapper_return_type(), interrogate_wrapper_return_value_destructor(), and InterfaceMaker::~InterfaceMaker().

const InterrogateType & InterrogateDatabase::get_type TypeIndex  type  ) 
 

Returns the type associated with the given TypeIndex, if there is one.

Definition at line 362 of file interrogateDatabase.cxx.

References _element_map.

Referenced by InterrogateBuilder::clean_identifier(), interrogate_get_type_by_true_name(), interrogate_type_atomic_token(), interrogate_type_comment(), interrogate_type_derivation_downcast_is_impossible(), interrogate_type_derivation_has_downcast(), interrogate_type_derivation_has_upcast(), interrogate_type_destructor_is_inherited(), interrogate_type_enum_value(), interrogate_type_enum_value_name(), interrogate_type_enum_value_scoped_name(), interrogate_type_get_cast(), interrogate_type_get_constructor(), interrogate_type_get_derivation(), interrogate_type_get_destructor(), interrogate_type_get_downcast(), interrogate_type_get_element(), interrogate_type_get_method(), interrogate_type_get_upcast(), interrogate_type_has_comment(), interrogate_type_has_destructor(), interrogate_type_has_module_name(), interrogate_type_is_atomic(), interrogate_type_is_class(), interrogate_type_is_const(), interrogate_type_is_enum(), interrogate_type_is_fully_defined(), interrogate_type_is_long(), interrogate_type_is_longlong(), interrogate_type_is_nested(), interrogate_type_is_pointer(), interrogate_type_is_short(), interrogate_type_is_signed(), interrogate_type_is_struct(), interrogate_type_is_union(), interrogate_type_is_unpublished(), interrogate_type_is_unsigned(), interrogate_type_is_wrapped(), interrogate_type_module_name(), interrogate_type_name(), interrogate_type_number_of_casts(), interrogate_type_number_of_constructors(), interrogate_type_number_of_derivations(), interrogate_type_number_of_elements(), interrogate_type_number_of_enum_values(), interrogate_type_number_of_methods(), interrogate_type_number_of_nested_types(), interrogate_type_outer_class(), interrogate_type_scoped_name(), interrogate_type_true_name(), and interrogate_type_wrapped_type().

const InterrogateFunctionWrapper & InterrogateDatabase::get_wrapper FunctionWrapperIndex  wrapper  ) 
 

Returns the function wrapper associated with the given FunctionWrapperIndex, if there is one.

Definition at line 408 of file interrogateDatabase.cxx.

References _modules_by_hash, binary_search_wrapper_hash(), FunctionWrapperIndex, InterrogateModuleDef::num_unique_names, and InterrogateModuleDef::unique_names.

Referenced by interrogate_function_python_wrapper(), interrogate_wrapper_caller_manages_return_value(), interrogate_wrapper_has_return_value(), interrogate_wrapper_is_callable_by_name(), interrogate_wrapper_number_of_parameters(), interrogate_wrapper_parameter_has_name(), interrogate_wrapper_parameter_name(), interrogate_wrapper_parameter_type(), interrogate_wrapper_pointer(), interrogate_wrapper_return_type(), and interrogate_wrapper_return_value_destructor().

FunctionWrapperIndex InterrogateDatabase::get_wrapper_by_unique_name const string &  unique_name  ) 
 

Looks up the function wrapper corresponding to the given unique name, if available.

Returns the corresponding wrapper index, or 0 if no such wrapper is found.

Definition at line 520 of file interrogateDatabase.cxx.

References _global_types.

void InterrogateDatabase::load_latest  )  [private]
 

Reads in the latest interrogate data.

Definition at line 1072 of file interrogateDatabase.cxx.

References InterrogateType::get_true_name().

int InterrogateDatabase::lookup const string &  name,
Lookup lookup,
LookupType  type,
void(InterrogateDatabase::*  freshen)()
[private]
 

Looks up a type, manifest, or element in the indicated lookup table by name.

This is an internal support function.

Definition at line 1593 of file interrogateDatabase.cxx.

Referenced by check_latest(), lookup_manifest_by_name(), lookup_type_by_name(), and lookup_type_by_true_name().

ElementIndex InterrogateDatabase::lookup_element_by_name const string &  name  )  [inline]
 

Returns the ElementIndex associated with the first element found with the given name, or 0 if no element has this name.

Definition at line 129 of file interrogateDatabase.I.

Referenced by interrogate_element_scoped_name().

ElementIndex InterrogateDatabase::lookup_element_by_scoped_name const string &  name  )  [inline]
 

Returns the ElementIndex associated with the first element found with the given scoped name, or 0 if no element has this name.

Definition at line 148 of file interrogateDatabase.I.

Referenced by interrogate_get_element_by_name().

ManifestIndex InterrogateDatabase::lookup_manifest_by_name const string &  name  )  [inline]
 

Returns the ManifestIndex associated with the first manifest found with the given name, or 0 if no manifest has this name.

Definition at line 110 of file interrogateDatabase.I.

References _elements_by_scoped_name, check_latest(), ElementIndex, freshen_elements_by_scoped_name(), INLINE, lookup(), and LT_element_scoped_name.

Referenced by interrogate_get_manifest().

TypeIndex InterrogateDatabase::lookup_type_by_name const string &  name  )  [inline]
 

Returns the TypeIndex associated with the first type found with the given name, or 0 if no type has this name.

Definition at line 53 of file interrogateDatabase.I.

References _types_by_scoped_name, check_latest(), freshen_types_by_scoped_name(), INLINE, lookup(), LT_type_scoped_name, and TypeIndex.

Referenced by interrogate_get_type().

TypeIndex InterrogateDatabase::lookup_type_by_scoped_name const string &  name  )  [inline]
 

Returns the TypeIndex associated with the first type found with the given scoped name, or 0 if no type has this name.

Definition at line 72 of file interrogateDatabase.I.

Referenced by interrogate_get_type_by_name().

TypeIndex InterrogateDatabase::lookup_type_by_true_name const string &  name  )  [inline]
 

Returns the TypeIndex associated with the first type found with the given true name, or 0 if no type has this name.

Definition at line 91 of file interrogateDatabase.I.

References _elements_by_name, check_latest(), ElementIndex, freshen_elements_by_name(), INLINE, lookup(), and LT_element_name.

Referenced by interrogate_get_type_by_scoped_name().

void InterrogateDatabase::merge_from const InterrogateDatabase &  other  )  [private]
 

Copies all the data from the indicated database into this one.

It is an error if any index numbers are shared between the two databases.

Definition at line 1276 of file interrogateDatabase.cxx.

References _type_map, and _types_by_true_name.

Referenced by remap_indices().

bool InterrogateDatabase::read istream &  in,
InterrogateModuleDef def
 

Reads a database from the indicated stream, associated with the indicated module definition and merges it with any existing data in the database, according to the expected index numbers specified in the module def.

The header information has already been read.

Returns true if the file is read successfully, false if there is an error.

Definition at line 1040 of file interrogateDatabase.cxx.

Referenced by remap_indices().

bool InterrogateDatabase::read_new istream &  in,
InterrogateModuleDef def
[private]
 

Reads from the indicated stream (the header information has already been read) into the newly-created database.

It is an error if the database already has some data in it.

Definition at line 1151 of file interrogateDatabase.cxx.

Referenced by remap_indices().

int InterrogateDatabase::remap_indices int  first_index,
IndexRemapper remap
 

This flavor of remap_indices() accepts a map that should be empty on initial call, and will be filled with the mapping of old index number to new index number.

This allows the caller to update its own data structures to match the new index numbers.

Definition at line 861 of file interrogateDatabase.cxx.

References _current_major_version, _current_minor_version, _file_major_version, _file_minor_version, _requests, InterrogateModuleDef::database_filename, Filename::empty(), InterrogateModuleDef::file_identifier, DSearchPath::find_file(), get_interrogatedb_path(), NULL, Filename::open_read(), read(), and Filename::set_text().

int InterrogateDatabase::remap_indices int  first_index  ) 
 

Resequences all of the various index numbers so that all of the functions start at first_index and increment consecutively from there, and then all of the types follow.

Returns the next available index number.

Definition at line 839 of file interrogateDatabase.cxx.

References _next_index, InterrogateModuleDef::database_filename, InterrogateModuleDef::first_index, merge_from(), InterrogateModuleDef::next_index, and read_new().

void InterrogateDatabase::remove_type TypeIndex  type  ) 
 

Erases the type from the database.

Definition at line 475 of file interrogateDatabase.cxx.

References _current_minor_version.

void InterrogateDatabase::request_module InterrogateModuleDef def  ) 
 

Requests that the interrogate data for the given module be made available.

The function pointers will be made available immediately, while the database file will be read later, the next time someone asks for interrogate data that requires it.

Definition at line 85 of file interrogateDatabase.cxx.

References _modules, and _next_index.

InterrogateElement & InterrogateDatabase::update_element ElementIndex  element  ) 
 

Returns a non-const reference to the indicated data element, allowing the user to update it.

Definition at line 817 of file interrogateDatabase.cxx.

References _element_map.

InterrogateFunction & InterrogateDatabase::update_function FunctionIndex  function  ) 
 

Returns a non-const reference to the indicated function, allowing the user to update it.

Definition at line 769 of file interrogateDatabase.cxx.

Referenced by InterrogateBuilder::get_getter(), and InterfaceMaker::get_wrapper_name().

InterrogateManifest & InterrogateDatabase::update_manifest ManifestIndex  manifest  ) 
 

Returns a non-const reference to the indicated manifest constant, allowing the user to update it.

Definition at line 801 of file interrogateDatabase.cxx.

References _wrapper_map.

InterrogateType & InterrogateDatabase::update_type TypeIndex  type  ) 
 

Returns a non-const reference to the indicated type, allowing the user to update it.

Definition at line 752 of file interrogateDatabase.cxx.

References _all_functions.

InterrogateFunctionWrapper & InterrogateDatabase::update_wrapper FunctionWrapperIndex  wrapper  ) 
 

Returns a non-const reference to the indicated function wrapper, allowing the user to update it.

Definition at line 785 of file interrogateDatabase.cxx.

References _function_map.

void InterrogateDatabase::write ostream &  out,
InterrogateModuleDef def
const
 

Writes the database to the indicated stream for later reading.

Definition at line 971 of file interrogateDatabase.cxx.


Member Data Documentation

GlobalFunctions InterrogateDatabase::_all_functions [private]
 

Definition at line 149 of file interrogateDatabase.h.

Referenced by get_all_type(), get_num_global_functions(), and update_type().

GlobalTypes InterrogateDatabase::_all_types [private]
 

Definition at line 146 of file interrogateDatabase.h.

Referenced by get_global_type(), and get_num_global_types().

int InterrogateDatabase::_current_major_version = 2 [static, private]
 

Definition at line 30 of file interrogateDatabase.cxx.

Referenced by remap_indices().

int InterrogateDatabase::_current_minor_version = 2 [static, private]
 

Definition at line 31 of file interrogateDatabase.cxx.

Referenced by remap_indices(), and remove_type().

ElementMap InterrogateDatabase::_element_map [private]
 

Definition at line 142 of file interrogateDatabase.h.

Referenced by add_type(), get_file_minor_version(), get_type(), and update_element().

Lookup InterrogateDatabase::_elements_by_name [private]
 

Definition at line 184 of file interrogateDatabase.h.

Referenced by lookup_type_by_true_name().

Lookup InterrogateDatabase::_elements_by_scoped_name [private]
 

Definition at line 185 of file interrogateDatabase.h.

Referenced by lookup_manifest_by_name().

int InterrogateDatabase::_file_major_version = 0 [static, private]
 

Definition at line 28 of file interrogateDatabase.cxx.

Referenced by remap_indices().

int InterrogateDatabase::_file_minor_version = 0 [static, private]
 

Definition at line 29 of file interrogateDatabase.cxx.

Referenced by get_element(), and remap_indices().

FunctionMap InterrogateDatabase::_function_map [private]
 

Definition at line 135 of file interrogateDatabase.h.

Referenced by add_function(), get_current_minor_version(), get_global_manifest(), and update_wrapper().

GlobalElements InterrogateDatabase::_global_elements [private]
 

Definition at line 153 of file interrogateDatabase.h.

Referenced by get_file_minor_version(), and get_num_all_functions().

GlobalFunctions InterrogateDatabase::_global_functions [private]
 

Definition at line 148 of file interrogateDatabase.h.

Referenced by get_num_all_types().

GlobalManifests InterrogateDatabase::_global_manifests [private]
 

Definition at line 151 of file interrogateDatabase.h.

Referenced by get_file_major_version(), and get_global_function().

InterrogateDatabase * InterrogateDatabase::_global_ptr = NULL [static, private]
 

Definition at line 27 of file interrogateDatabase.cxx.

Referenced by InterrogateDatabase().

GlobalTypes InterrogateDatabase::_global_types [private]
 

Definition at line 145 of file interrogateDatabase.h.

Referenced by get_wrapper_by_unique_name().

int InterrogateDatabase::_lookups_fresh [private]
 

Definition at line 178 of file interrogateDatabase.h.

ManifestMap InterrogateDatabase::_manifest_map [private]
 

Definition at line 140 of file interrogateDatabase.h.

Referenced by get_file_major_version(), and get_global_element().

Lookup InterrogateDatabase::_manifests_by_name [private]
 

Definition at line 183 of file interrogateDatabase.h.

Modules InterrogateDatabase::_modules [private]
 

Definition at line 158 of file interrogateDatabase.h.

Referenced by request_module().

ModulesByHash InterrogateDatabase::_modules_by_hash [private]
 

Definition at line 160 of file interrogateDatabase.h.

Referenced by get_wrapper().

int InterrogateDatabase::_next_index [private]
 

Definition at line 167 of file interrogateDatabase.h.

Referenced by remap_indices(), and request_module().

Requests InterrogateDatabase::_requests [private]
 

Definition at line 165 of file interrogateDatabase.h.

Referenced by remap_indices().

TypeMap InterrogateDatabase::_type_map [private]
 

Definition at line 133 of file interrogateDatabase.h.

Referenced by get_current_major_version(), and merge_from().

Lookup InterrogateDatabase::_types_by_name [private]
 

Definition at line 180 of file interrogateDatabase.h.

Referenced by check_latest().

Lookup InterrogateDatabase::_types_by_scoped_name [private]
 

Definition at line 181 of file interrogateDatabase.h.

Referenced by lookup_type_by_name().

Lookup InterrogateDatabase::_types_by_true_name [private]
 

Definition at line 182 of file interrogateDatabase.h.

Referenced by merge_from().

FunctionWrapperMap InterrogateDatabase::_wrapper_map [private]
 

Definition at line 137 of file interrogateDatabase.h.

Referenced by add_element(), add_function(), get_num_global_elements(), and update_manifest().


The documentation for this class was generated from the following files:
Generated on Thu May 1 22:13:37 2003 for DTool by doxygen1.3