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

InterfaceMaker Class Reference

#include <interfaceMaker.h>

Inheritance diagram for InterfaceMaker:

InterfaceMakerC InterfaceMakerPython InterfaceMakerPythonObj InterfaceMakerPythonSimple List of all members.

Public Member Functions

 InterfaceMaker (InterrogateModuleDef *def)
virtual ~InterfaceMaker ()
virtual void generate_wrappers ()
virtual void write_includes (ostream &out)
virtual void write_prototypes (ostream &out)
virtual void write_functions (ostream &out)
virtual void write_module (ostream &out, InterrogateModuleDef *def)
virtual ParameterRemapremap_parameter (CPPType *struct_type, CPPType *param_type)
virtual bool synthesize_this_parameter ()
virtual bool separate_overloading ()
void get_function_remaps (vector< FunctionRemap * > &remaps)

Static Public Member Functions

ostreamindent (ostream &out, int indent_level)

Protected Types

typedef vector< Function * > Functions
typedef map< TypeIndex, Object * > Objects
typedef map< string, FunctionRemap * > WrappersByHash

Protected Member Functions

virtual FunctionRemapmake_function_remap (const InterrogateType &itype, const InterrogateFunction &ifunc, CPPInstance *cppfunc, int num_default_parameters)
virtual string get_wrapper_name (const InterrogateType &itype, const InterrogateFunction &ifunc, FunctionIndex func_index)
virtual string get_wrapper_prefix ()
virtual string get_unique_prefix ()
Functionrecord_function (const InterrogateType &itype, FunctionIndex func_index)
virtual void record_function_wrapper (InterrogateFunction &ifunc, FunctionWrapperIndex wrapper_index)
Objectrecord_object (TypeIndex type_index)
void hash_function_signature (FunctionRemap *remap)
string manage_return_value (ostream &out, int indent_level, FunctionRemap *remap, const string &return_expr) const
void output_ref (ostream &out, int indent_level, FunctionRemap *remap, const string &varname) const
void write_spam_message (ostream &out, FunctionRemap *remap) const

Protected Attributes

Functions _functions
Objects _objects
WrappersByHash _wrappers_by_hash
InterrogateModuleDef_def
FunctionWriters _function_writers

Member Typedef Documentation

typedef vector<Function *> InterfaceMaker::Functions [protected]
 

Definition at line 89 of file interfaceMaker.h.

typedef map<TypeIndex, Object *> InterfaceMaker::Objects [protected]
 

Definition at line 104 of file interfaceMaker.h.

typedef map<string, FunctionRemap *> InterfaceMaker::WrappersByHash [protected]
 

Definition at line 107 of file interfaceMaker.h.


Constructor & Destructor Documentation

InterfaceMaker::InterfaceMaker InterrogateModuleDef def  ) 
 

Definition at line 102 of file interfaceMaker.cxx.

References _def.

InterfaceMaker::~InterfaceMaker  )  [virtual]
 

Definition at line 113 of file interfaceMaker.cxx.

References _functions, and _objects.


Member Function Documentation

void InterfaceMaker::generate_wrappers  )  [virtual]
 

Definition at line 135 of file interfaceMaker.cxx.

References dummy_type, ElementIndex, FunctionIndex, InterrogateDatabase::get_all_type(), InterrogateDatabase::get_element(), InterrogateElement::get_getter(), InterrogateManifest::get_getter(), InterrogateDatabase::get_global_element(), InterrogateDatabase::get_global_function(), InterrogateDatabase::get_global_manifest(), InterrogateDatabase::get_manifest(), InterrogateDatabase::get_num_all_types(), InterrogateDatabase::get_num_global_elements(), InterrogateDatabase::get_num_global_functions(), InterrogateDatabase::get_num_global_manifests(), InterrogateDatabase::get_ptr(), InterrogateElement::get_setter(), InterrogateElement::has_getter(), InterrogateManifest::has_getter(), InterrogateElement::has_setter(), ManifestIndex, record_function(), record_object(), and TypeIndex.

void InterfaceMaker::get_function_remaps vector< FunctionRemap * > &  remaps  ) 
 

Definition at line 336 of file interfaceMaker.cxx.

References _functions, and InterfaceMaker::Function::_remaps.

string InterfaceMaker::get_unique_prefix  )  [protected, virtual]
 

Reimplemented in InterfaceMakerC, and InterfaceMakerPythonSimple.

Definition at line 432 of file interfaceMaker.cxx.

Referenced by make_function_remap().

string InterfaceMaker::get_wrapper_name const InterrogateType itype,
const InterrogateFunction ifunc,
FunctionIndex  func_index
[protected, virtual]
 

Definition at line 402 of file interfaceMaker.cxx.

References InterrogateBuilder::clean_identifier(), InterrogateFunction::get_scoped_name(), get_wrapper_prefix(), and ostringstream::str().

Referenced by record_function().

string InterfaceMaker::get_wrapper_prefix  )  [protected, virtual]
 

Reimplemented in InterfaceMakerC, InterfaceMakerPythonObj, and InterfaceMakerPythonSimple.

Definition at line 420 of file interfaceMaker.cxx.

Referenced by get_wrapper_name(), and make_function_remap().

void InterfaceMaker::hash_function_signature FunctionRemap remap  )  [protected]
 

Definition at line 697 of file interfaceMaker.cxx.

References FunctionRemap::_function_signature, FunctionRemap::_hash, _wrappers_by_hash, InterrogateBuilder::hash_string(), nout, and NULL.

Referenced by make_function_remap().

ostream & InterfaceMaker::indent ostream out,
int  indent_level
[static]
 

Definition at line 354 of file interfaceMaker.cxx.

Referenced by FunctionRemap::call_function(), manage_return_value(), output_ref(), InterfaceMakerPythonSimple::pack_return_value(), InterfaceMakerPythonObj::pack_return_value(), ParameterRemapBasicStringToString::prepare_return_expr(), InterfaceMakerPython::test_assert(), InterfaceMakerPythonSimple::write_function_instance(), and InterfaceMakerPythonObj::write_function_instance().

FunctionRemap * InterfaceMaker::make_function_remap const InterrogateType itype,
const InterrogateFunction ifunc,
CPPInstance cppfunc,
int  num_default_parameters
[protected, virtual]
 

Definition at line 368 of file interfaceMaker.cxx.

References _def, FunctionRemap::_hash, FunctionRemap::_is_valid, FunctionRemap::_unique_name, FunctionRemap::_wrapper_name, get_unique_prefix(), get_wrapper_prefix(), hash_function_signature(), InterrogateModuleDef::library_hash_name, NULL, and separate_overloading().

Referenced by record_function().

string InterfaceMaker::manage_return_value ostream out,
int  indent_level,
FunctionRemap remap,
const string &  return_expr
const [protected]
 

Definition at line 623 of file interfaceMaker.cxx.

References FunctionRemap::_manage_reference_count, FunctionRemap::_return_type, CPPType::get_local_name(), ParameterRemap::get_new_type(), ParameterRemap::get_temporary_type(), indent(), output_ref(), parser, ParameterRemap::temporary_to_return(), and type.

Referenced by InterfaceMakerPythonSimple::write_function_instance(), InterfaceMakerPythonObj::write_function_instance(), and InterfaceMakerC::write_function_instance().

void InterfaceMaker::output_ref ostream out,
int  indent_level,
FunctionRemap remap,
const string &  varname
const [protected]
 

Definition at line 665 of file interfaceMaker.cxx.

References FunctionRemap::_return_type, FunctionRemap::_type, CPPType::get_local_name(), ParameterRemap::get_new_type(), indent(), parser, FunctionRemap::T_constructor, and FunctionRemap::T_typecast.

Referenced by manage_return_value().

InterfaceMaker::Function * InterfaceMaker::record_function const InterrogateType itype,
FunctionIndex  func_index
[protected]
 

Definition at line 444 of file interfaceMaker.cxx.

References _functions, InterfaceMaker::Function::_has_this, FunctionRemap::_has_this, InterrogateFunction::_instances, CPPParameterList::_parameters, CPPFunctionType::_parameters, InterfaceMaker::Function::_remaps, CPPInstance::_type, CPPDeclaration::as_function_type(), FunctionWrapperIndex, InterrogateDatabase::get_function(), InterrogateDatabase::get_ptr(), get_wrapper_name(), make_function_remap(), FunctionRemap::make_wrapper_entry(), NULL, param, record_function_wrapper(), separate_overloading(), and InterrogateDatabase::update_function().

Referenced by generate_wrappers(), and record_object().

void InterfaceMaker::record_function_wrapper InterrogateFunction ifunc,
FunctionWrapperIndex  wrapper_index
[protected, virtual]
 

Reimplemented in InterfaceMakerC, and InterfaceMakerPythonSimple.

Definition at line 522 of file interfaceMaker.cxx.

Referenced by record_function().

InterfaceMaker::Object * InterfaceMaker::record_object TypeIndex  type_index  )  [protected]
 

Definition at line 533 of file interfaceMaker.cxx.

References InterfaceMaker::Object::_constructors, InterfaceMaker::Object::_destructor, InterfaceMaker::Object::_methods, _objects, assert, InterrogateType::derivation_get_downcast(), InterrogateType::derivation_get_upcast(), InterrogateType::derivation_has_downcast(), InterrogateType::derivation_has_upcast(), InterrogateType::destructor_is_inherited(), ElementIndex, FunctionIndex, InterrogateType::get_cast(), InterrogateType::get_constructor(), InterrogateType::get_derivation(), InterrogateType::get_destructor(), InterrogateDatabase::get_element(), InterrogateType::get_element(), InterrogateElement::get_getter(), InterrogateType::get_method(), InterrogateType::get_nested_type(), InterrogateDatabase::get_ptr(), InterrogateElement::get_setter(), InterrogateDatabase::get_type(), InterrogateType::has_destructor(), InterrogateElement::has_getter(), InterrogateElement::has_setter(), NULL, InterrogateType::number_of_casts(), InterrogateType::number_of_constructors(), InterrogateType::number_of_derivations(), InterrogateType::number_of_elements(), InterrogateType::number_of_methods(), InterrogateType::number_of_nested_types(), record_function(), and TypeIndex.

Referenced by generate_wrappers().

ParameterRemap * InterfaceMaker::remap_parameter CPPType struct_type,
CPPType param_type
[virtual]
 

Definition at line 237 of file interfaceMaker.cxx.

References CPPType::get_local_name(), TypeManager::is_basic_string_char(), TypeManager::is_char_pointer(), TypeManager::is_const_ref_to_basic_string_char(), TypeManager::is_const_ref_to_pointer_to_base(), TypeManager::is_const_ref_to_simple(), TypeManager::is_const_simple(), TypeManager::is_pointer(), TypeManager::is_pointer_to_base(), TypeManager::is_reference(), TypeManager::is_simple(), TypeManager::is_struct(), NULL, parser, and TypeManager::unwrap_reference().

Referenced by FunctionRemap::setup_properties().

bool InterfaceMaker::separate_overloading  )  [virtual]
 

Definition at line 322 of file interfaceMaker.cxx.

Referenced by make_function_remap(), and record_function().

bool InterfaceMaker::synthesize_this_parameter  )  [virtual]
 

Reimplemented in InterfaceMakerC, InterfaceMakerPythonObj, and InterfaceMakerPythonSimple.

Definition at line 306 of file interfaceMaker.cxx.

Referenced by FunctionRemap::setup_properties().

void InterfaceMaker::write_functions ostream out  )  [virtual]
 

Reimplemented in InterfaceMakerC, InterfaceMakerPythonObj, and InterfaceMakerPythonSimple.

Definition at line 209 of file interfaceMaker.cxx.

References _function_writers, and FunctionWriters::write_code().

Referenced by InterfaceMakerPythonSimple::write_functions(), InterfaceMakerPythonObj::write_functions(), and InterfaceMakerC::write_functions().

void InterfaceMaker::write_includes ostream out  )  [virtual]
 

Reimplemented in InterfaceMakerPython.

Definition at line 187 of file interfaceMaker.cxx.

Referenced by InterfaceMakerPython::write_includes().

void InterfaceMaker::write_module ostream out,
InterrogateModuleDef def
[virtual]
 

Reimplemented in InterfaceMakerPythonObj, and InterfaceMakerPythonSimple.

Definition at line 220 of file interfaceMaker.cxx.

Referenced by InterfaceMakerPythonSimple::write_module(), and InterfaceMakerPythonObj::write_module().

void InterfaceMaker::write_prototypes ostream out  )  [virtual]
 

Reimplemented in InterfaceMakerC, InterfaceMakerPythonObj, and InterfaceMakerPythonSimple.

Definition at line 198 of file interfaceMaker.cxx.

References _function_writers, and FunctionWriters::write_prototypes().

Referenced by InterfaceMakerPythonSimple::write_prototypes(), InterfaceMakerPythonObj::write_prototypes(), and InterfaceMakerC::write_prototypes().

void InterfaceMaker::write_spam_message ostream out,
FunctionRemap remap
const [protected]
 

Definition at line 765 of file interfaceMaker.cxx.

References ostringstream::str(), and FunctionRemap::write_orig_prototype().

Referenced by InterfaceMakerPythonSimple::write_function_instance(), and InterfaceMakerC::write_function_instance().


Member Data Documentation

InterrogateModuleDef* InterfaceMaker::_def [protected]
 

Definition at line 144 of file interfaceMaker.h.

Referenced by InterfaceMaker(), and make_function_remap().

FunctionWriters InterfaceMaker::_function_writers [protected]
 

Definition at line 146 of file interfaceMaker.h.

Referenced by InterfaceMakerPythonObj::get_ptr_from_python(), InterfaceMakerPythonObj::get_ptr_to_python(), write_functions(), and write_prototypes().

Functions InterfaceMaker::_functions [protected]
 

Definition at line 90 of file interfaceMaker.h.

Referenced by get_function_remaps(), record_function(), InterfaceMakerPythonSimple::write_functions(), InterfaceMakerPythonObj::write_functions(), InterfaceMakerC::write_functions(), InterfaceMakerPythonSimple::write_module(), InterfaceMakerPythonSimple::write_prototypes(), InterfaceMakerPythonObj::write_prototypes(), InterfaceMakerC::write_prototypes(), and ~InterfaceMaker().

Objects InterfaceMaker::_objects [protected]
 

Definition at line 105 of file interfaceMaker.h.

Referenced by record_object(), InterfaceMakerPythonObj::write_functions(), InterfaceMakerPythonObj::write_module(), and ~InterfaceMaker().

WrappersByHash InterfaceMaker::_wrappers_by_hash [protected]
 

Definition at line 108 of file interfaceMaker.h.

Referenced by hash_function_signature().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 01:34:58 2003 for DTool by doxygen1.3