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

InterrogateType Class Reference

An internal representation of a type. More...

#include <interrogateType.h>

Inheritance diagram for InterrogateType:

InterrogateComponent List of all members.

Public Member Functions

 InterrogateType (InterrogateModuleDef *def=NULL)
 InterrogateType (const InterrogateType &copy)
void operator= (const InterrogateType &copy)
bool is_global () const
 Returns true if the type is marked as 'global'.

bool has_scoped_name () const
const string & get_scoped_name () const
bool has_true_name () const
const string & get_true_name () const
bool has_comment () const
const string & get_comment () const
bool is_nested () const
 Returns true if this type is nested within some class definition.

TypeIndex get_outer_class () const
 If is_nested() returns true, this is the class within which this type is defined.

bool is_atomic () const
AtomicToken get_atomic_token () const
bool is_unsigned () const
bool is_signed () const
bool is_long () const
bool is_longlong () const
bool is_short () const
bool is_wrapped () const
bool is_pointer () const
bool is_const () const
TypeIndex get_wrapped_type () const
bool is_enum () const
int number_of_enum_values () const
const string & get_enum_value_name (int n) const
const string & get_enum_value_scoped_name (int n) const
int get_enum_value (int n) const
bool is_struct () const
bool is_class () const
bool is_union () const
bool is_fully_defined () const
bool is_unpublished () const
 Returns true if the type is an unpublished type.

int number_of_constructors () const
FunctionIndex get_constructor (int n) const
bool has_destructor () const
bool destructor_is_inherited () const
FunctionIndex get_destructor () const
int number_of_elements () const
ElementIndex get_element (int n) const
int number_of_methods () const
FunctionIndex get_method (int n) const
int number_of_casts () const
FunctionIndex get_cast (int n) const
int number_of_derivations () const
TypeIndex get_derivation (int n) const
bool derivation_has_upcast (int n) const
FunctionIndex derivation_get_upcast (int n) const
bool derivation_downcast_is_impossible (int n) const
bool derivation_has_downcast (int n) const
FunctionIndex derivation_get_downcast (int n) const
int number_of_nested_types () const
TypeIndex get_nested_type (int n) const
void merge_with (const InterrogateType &other)
 Combines type with the other similar definition.

void output (ostream &out) const
 Formats the InterrogateType data for output to a data file.

void input (istream &in)
 Reads the data file as previously formatted by output().

void remap_indices (const IndexRemapper &remap)
 Remaps all internal index numbers according to the indicated map.

bool has_library_name () const
 Returns true if we have a known library name, false if we do not.

const char * get_library_name () const
 Returns the library name, if it is known, or NULL if it is not.

bool has_module_name () const
 Returns true if we have a known module name, false if we do not.

const char * get_module_name () const
 Returns the module name, if it is known, or NULL if it is not.

bool has_name () const
const string & get_name () const

Public Attributes

CPPType_cpptype
CPPScope_cppscope

Private Types

typedef vector< FunctionIndexFunctions
typedef vector< ElementIndexElements
typedef vector< DerivationDerivations
typedef vector< EnumValueEnumValues
typedef vector< TypeIndexTypes
enum  Flags {
  F_global = 0x000001, F_atomic = 0x000002, F_unsigned = 0x000004, F_signed = 0x000008,
  F_long = 0x000010, F_longlong = 0x000020, F_short = 0x000040, F_wrapped = 0x000080,
  F_pointer = 0x000100, F_const = 0x000200, F_struct = 0x000400, F_class = 0x000800,
  F_union = 0x001000, F_fully_defined = 0x002000, F_true_destructor = 0x004000, F_private_destructor = 0x008000,
  F_inherited_destructor = 0x010000, F_implicit_destructor = 0x020000, F_nested = 0x040000, F_enum = 0x080000,
  F_unpublished = 0x100000
}
enum  DerivationFlags { DF_upcast = 0x01, DF_downcast = 0x02, DF_downcast_impossible = 0x04 }

Private Attributes

int _flags
string _scoped_name
string _true_name
string _comment
TypeIndex _outer_class
AtomicToken _atomic_token
TypeIndex _wrapped_type
Functions _constructors
FunctionIndex _destructor
Elements _elements
Functions _methods
Functions _casts
Derivations _derivations
EnumValues _enum_values
Types _nested_types

Static Private Attributes

string _empty_string

Friends

class InterrogateBuilder

Detailed Description

An internal representation of a type.

Definition at line 42 of file interrogateType.h.


Member Typedef Documentation

typedef vector<Derivation> InterrogateType::Derivations [private]
 

Definition at line 183 of file interrogateType.h.

typedef vector<ElementIndex> InterrogateType::Elements [private]
 

Definition at line 156 of file interrogateType.h.

typedef vector<EnumValue> InterrogateType::EnumValues [private]
 

Definition at line 199 of file interrogateType.h.

typedef vector<FunctionIndex> InterrogateType::Functions [private]
 

Definition at line 152 of file interrogateType.h.

typedef vector<TypeIndex> InterrogateType::Types [private]
 

Definition at line 202 of file interrogateType.h.


Member Enumeration Documentation

enum InterrogateType::DerivationFlags [private]
 

Enumeration values:
DF_upcast 
DF_downcast 
DF_downcast_impossible 

Definition at line 161 of file interrogateType.h.

enum InterrogateType::Flags [private]
 

Enumeration values:
F_global 
F_atomic 
F_unsigned 
F_signed 
F_long 
F_longlong 
F_short 
F_wrapped 
F_pointer 
F_const 
F_struct 
F_class 
F_union 
F_fully_defined 
F_true_destructor 
F_private_destructor 
F_inherited_destructor 
F_implicit_destructor 
F_nested 
F_enum 
F_unpublished 

Definition at line 120 of file interrogateType.h.


Constructor & Destructor Documentation

InterrogateType::InterrogateType InterrogateModuleDef def = NULL  )  [inline]
 

Definition at line 31 of file interrogateType.I.

References _atomic_token, _cppscope, _cpptype, _destructor, _wrapped_type, AT_not_atomic, and NULL.

InterrogateType::InterrogateType const InterrogateType &  copy  )  [inline]
 

Definition at line 52 of file interrogateType.I.

References _flags, F_global, and INLINE.


Member Function Documentation

bool InterrogateType::derivation_downcast_is_impossible int  n  )  const [inline]
 

Definition at line 659 of file interrogateType.I.

Referenced by interrogate_type_get_upcast().

TypeIndex InterrogateType::derivation_get_downcast int  n  )  const [inline]
 

Definition at line 691 of file interrogateType.I.

Referenced by interrogate_type_derivation_has_downcast().

TypeIndex InterrogateType::derivation_get_upcast int  n  )  const [inline]
 

Definition at line 643 of file interrogateType.I.

Referenced by interrogate_type_derivation_has_upcast().

bool InterrogateType::derivation_has_downcast int  n  )  const [inline]
 

Definition at line 675 of file interrogateType.I.

Referenced by interrogate_type_derivation_downcast_is_impossible().

bool InterrogateType::derivation_has_upcast int  n  )  const [inline]
 

Definition at line 627 of file interrogateType.I.

References INLINE.

Referenced by interrogate_type_get_derivation().

bool InterrogateType::destructor_is_inherited  )  const [inline]
 

Definition at line 491 of file interrogateType.I.

References _derivations, and INLINE.

Referenced by interrogate_type_has_destructor().

AtomicToken InterrogateType::get_atomic_token  )  const [inline]
 

Definition at line 195 of file interrogateType.I.

References _flags, F_longlong, and INLINE.

Referenced by interrogate_type_is_atomic().

FunctionIndex InterrogateType::get_cast int  n  )  const [inline]
 

Definition at line 583 of file interrogateType.I.

Referenced by interrogate_type_number_of_casts().

const string & InterrogateType::get_comment  )  const [inline]
 

Definition at line 141 of file interrogateType.I.

Referenced by interrogate_type_has_comment().

FunctionIndex InterrogateType::get_constructor int  n  )  const [inline]
 

Definition at line 463 of file interrogateType.I.

Referenced by interrogate_type_number_of_constructors().

TypeIndex InterrogateType::get_derivation int  n  )  const [inline]
 

Definition at line 611 of file interrogateType.I.

Referenced by interrogate_type_number_of_derivations().

FunctionIndex InterrogateType::get_destructor  )  const [inline]
 

Definition at line 503 of file interrogateType.I.

References _derivations, INLINE, and TypeIndex.

Referenced by InterrogateBuilder::clean_identifier(), and interrogate_type_destructor_is_inherited().

ElementIndex InterrogateType::get_element int  n  )  const [inline]
 

Definition at line 527 of file interrogateType.I.

Referenced by interrogate_type_number_of_elements().

int InterrogateType::get_enum_value int  n  )  const [inline]
 

Definition at line 369 of file interrogateType.I.

References _constructors, and INLINE.

Referenced by interrogate_type_enum_value_scoped_name().

const string & InterrogateType::get_enum_value_name int  n  )  const [inline]
 

Definition at line 339 of file interrogateType.I.

References _flags, and F_union.

Referenced by interrogate_type_number_of_enum_values().

const string & InterrogateType::get_enum_value_scoped_name int  n  )  const [inline]
 

Definition at line 354 of file interrogateType.I.

References _flags, F_unpublished, and INLINE.

Referenced by interrogate_type_enum_value_name().

const char * InterrogateComponent::get_library_name  )  const [inline, inherited]
 

Returns the library name, if it is known, or NULL if it is not.

This is the name of the library that this particular component was built into. Typically this will be a one-to-one correspondance with an invocation of the interrogate command. Typical examples are "libutil" and "liblinmath".

Definition at line 98 of file interrogateComponent.I.

References InterrogateComponent::_def, INLINE, InterrogateModuleDef::module_name, and NULL.

Referenced by InterrogateComponent::operator=().

FunctionIndex InterrogateType::get_method int  n  )  const [inline]
 

Definition at line 555 of file interrogateType.I.

Referenced by interrogate_type_number_of_methods().

const char * InterrogateComponent::get_module_name  )  const [inline, inherited]
 

Returns the module name, if it is known, or NULL if it is not.

This is the name of the module that this particular component is associated with. This is a higher grouping than library. Typical examples are "panda" and "pandaegg".

Definition at line 138 of file interrogateComponent.I.

Referenced by interrogate_function_has_module_name(), and interrogate_type_has_module_name().

const string & InterrogateComponent::get_name  )  const [inline, inherited]
 

Definition at line 165 of file interrogateComponent.I.

Referenced by interrogate_function_python_wrapper(), interrogate_get_function(), interrogate_get_manifest_by_name(), interrogate_get_type_by_true_name(), and interrogate_manifest_get_int_value().

TypeIndex InterrogateType::get_nested_type int  n  )  const [inline]
 

Definition at line 719 of file interrogateType.I.

Referenced by interrogate_type_number_of_nested_types().

TypeIndex InterrogateType::get_outer_class  )  const [inline]
 

If is_nested() returns true, this is the class within which this type is defined.

Definition at line 171 of file interrogateType.I.

Referenced by interrogate_type_is_nested().

const string & InterrogateType::get_scoped_name  )  const [inline]
 

Definition at line 93 of file interrogateType.I.

References _true_name, and INLINE.

Referenced by interrogate_type_name().

const string & InterrogateType::get_true_name  )  const [inline]
 

Definition at line 117 of file interrogateType.I.

References _comment.

Referenced by interrogate_type_scoped_name(), and InterrogateDatabase::load_latest().

TypeIndex InterrogateType::get_wrapped_type  )  const [inline]
 

Definition at line 303 of file interrogateType.I.

References _enum_values, and INLINE.

Referenced by interrogate_type_is_const().

bool InterrogateType::has_comment  )  const [inline]
 

Definition at line 129 of file interrogateType.I.

References _flags, and F_nested.

Referenced by interrogate_type_outer_class().

bool InterrogateType::has_destructor  )  const [inline]
 

Definition at line 479 of file interrogateType.I.

References _casts, FunctionIndex, and INLINE.

Referenced by interrogate_type_get_constructor().

bool InterrogateComponent::has_library_name  )  const [inline, inherited]
 

Returns true if we have a known library name, false if we do not.

See get_library_name().

Definition at line 74 of file interrogateComponent.I.

References InterrogateComponent::_def, INLINE, InterrogateModuleDef::library_name, and NULL.

bool InterrogateComponent::has_module_name  )  const [inline, inherited]
 

Returns true if we have a known module name, false if we do not.

See get_module_name().

Definition at line 116 of file interrogateComponent.I.

References InterrogateComponent::_name, and INLINE.

Referenced by interrogate_function_class(), and interrogate_type_comment().

bool InterrogateComponent::has_name  )  const [inline, inherited]
 

Definition at line 153 of file interrogateComponent.I.

bool InterrogateType::has_scoped_name  )  const [inline]
 

Definition at line 81 of file interrogateType.I.

References _true_name, and INLINE.

bool InterrogateType::has_true_name  )  const [inline]
 

Definition at line 105 of file interrogateType.I.

References _comment, and INLINE.

void InterrogateType::input istream &  in  ) 
 

Reads the data file as previously formatted by output().

Reimplemented from InterrogateComponent.

Definition at line 185 of file interrogateType.cxx.

References _casts, _constructors, _derivations, _destructor, _elements, _methods, _nested_types, _outer_class, _wrapped_type, and IndexRemapper::map_from().

bool InterrogateType::is_atomic  )  const [inline]
 

Definition at line 183 of file interrogateType.I.

References _flags, F_long, and INLINE.

Referenced by interrogate_type_module_name().

bool InterrogateType::is_class  )  const [inline]
 

Definition at line 396 of file interrogateType.I.

References _destructor.

Referenced by interrogate_type_is_struct().

bool InterrogateType::is_const  )  const [inline]
 

Definition at line 291 of file interrogateType.I.

References _empty_string, _enum_values, and INLINE.

Referenced by interrogate_type_is_pointer().

bool InterrogateType::is_enum  )  const [inline]
 

Definition at line 315 of file interrogateType.I.

References _flags, F_struct, and INLINE.

Referenced by interrogate_type_wrapped_type().

bool InterrogateType::is_fully_defined  )  const [inline]
 

Definition at line 420 of file interrogateType.I.

References _elements, and INLINE.

Referenced by interrogate_type_is_union().

bool InterrogateType::is_global  )  const [inline]
 

Returns true if the type is marked as 'global'.

This means only that it should appear in the global type list.

Definition at line 69 of file interrogateType.I.

bool InterrogateType::is_long  )  const [inline]
 

Definition at line 231 of file interrogateType.I.

Referenced by interrogate_type_is_signed().

bool InterrogateType::is_longlong  )  const [inline]
 

Definition at line 243 of file interrogateType.I.

References _wrapped_type, INLINE, and TypeIndex.

Referenced by interrogate_type_is_long().

bool InterrogateType::is_nested  )  const [inline]
 

Returns true if this type is nested within some class definition.

Definition at line 156 of file interrogateType.I.

References _atomic_token, AtomicToken, and INLINE.

Referenced by interrogate_type_true_name().

bool InterrogateType::is_pointer  )  const [inline]
 

Definition at line 279 of file interrogateType.I.

References _empty_string, and _enum_values.

Referenced by interrogate_type_is_wrapped().

bool InterrogateType::is_short  )  const [inline]
 

Definition at line 255 of file interrogateType.I.

References _flags, F_enum, and INLINE.

Referenced by interrogate_type_is_longlong().

bool InterrogateType::is_signed  )  const [inline]
 

Definition at line 219 of file interrogateType.I.

References _flags, and F_wrapped.

Referenced by interrogate_type_is_unsigned().

bool InterrogateType::is_struct  )  const [inline]
 

Definition at line 384 of file interrogateType.I.

Referenced by interrogate_type_enum_value().

bool InterrogateType::is_union  )  const [inline]
 

Definition at line 408 of file interrogateType.I.

References _destructor, FunctionIndex, and INLINE.

Referenced by interrogate_type_is_class().

bool InterrogateType::is_unpublished  )  const [inline]
 

Returns true if the type is an unpublished type.

This either means the type is a nested type, and it is protected or private within its scope, or that its definition is simply not marked as 'published'.

Definition at line 439 of file interrogateType.I.

Referenced by interrogate_type_is_fully_defined().

bool InterrogateType::is_unsigned  )  const [inline]
 

Definition at line 207 of file interrogateType.I.

References _flags, F_short, and INLINE.

Referenced by interrogate_type_atomic_token().

bool InterrogateType::is_wrapped  )  const [inline]
 

Definition at line 267 of file interrogateType.I.

References _enum_values, and INLINE.

Referenced by interrogate_type_is_short().

void InterrogateType::merge_with const InterrogateType &  other  ) 
 

Combines type with the other similar definition.

If one type is "fully defined" and the other one isn't, the fully-defined type wins.

Definition at line 127 of file interrogateType.cxx.

References _atomic_token, _casts, _comment, _constructors, _derivations, _destructor, _elements, _enum_values, _flags, _methods, _nested_types, _outer_class, _scoped_name, _true_name, _wrapped_type, idf_output_string(), idf_output_vector(), and InterrogateComponent::output().

int InterrogateType::number_of_casts  )  const [inline]
 

Definition at line 571 of file interrogateType.I.

References _derivations, INLINE, and TypeIndex.

Referenced by interrogate_type_get_method().

int InterrogateType::number_of_constructors  )  const [inline]
 

Definition at line 451 of file interrogateType.I.

Referenced by interrogate_type_is_unpublished().

int InterrogateType::number_of_derivations  )  const [inline]
 

Definition at line 599 of file interrogateType.I.

References _nested_types, INLINE, and TypeIndex.

Referenced by interrogate_type_get_cast().

int InterrogateType::number_of_elements  )  const [inline]
 

Definition at line 515 of file interrogateType.I.

References _derivations, DF_upcast, and INLINE.

Referenced by interrogate_type_get_destructor().

int InterrogateType::number_of_enum_values  )  const [inline]
 

Definition at line 327 of file interrogateType.I.

References _flags, F_class, and INLINE.

Referenced by interrogate_type_is_enum().

int InterrogateType::number_of_methods  )  const [inline]
 

Definition at line 543 of file interrogateType.I.

References _derivations, DF_downcast_impossible, and INLINE.

Referenced by interrogate_type_get_element().

int InterrogateType::number_of_nested_types  )  const [inline]
 

Definition at line 707 of file interrogateType.I.

Referenced by interrogate_type_get_downcast().

void InterrogateType::operator= const InterrogateType &  copy  ) 
 

Definition at line 92 of file interrogateType.cxx.

void InterrogateType::output ostream &  out  )  const
 

Formats the InterrogateType data for output to a data file.

Reimplemented from InterrogateComponent.

Definition at line 154 of file interrogateType.cxx.

References _atomic_token, _casts, _comment, _constructors, _derivations, _destructor, _elements, _enum_values, _flags, _methods, _nested_types, _outer_class, _scoped_name, _true_name, _wrapped_type, idf_input_string(), idf_input_vector(), and InterrogateComponent::input().

void InterrogateType::remap_indices const IndexRemapper remap  ) 
 

Remaps all internal index numbers according to the indicated map.

This called from InterrogateDatabase::remap_indices().

Definition at line 223 of file interrogateType.cxx.


Friends And Related Function Documentation

friend class InterrogateBuilder [friend]
 

Reimplemented from InterrogateComponent.

Definition at line 216 of file interrogateType.h.


Member Data Documentation

AtomicToken InterrogateType::_atomic_token [private]
 

Definition at line 149 of file interrogateType.h.

Referenced by InterrogateBuilder::get_cast_function(), InterrogateType::EnumValue::input(), InterrogateType(), is_nested(), merge_with(), and output().

Functions InterrogateType::_casts [private]
 

Definition at line 159 of file interrogateType.h.

Referenced by has_destructor(), input(), merge_with(), and output().

string InterrogateType::_comment [private]
 

Definition at line 147 of file interrogateType.h.

Referenced by get_true_name(), has_true_name(), InterrogateType::EnumValue::input(), merge_with(), and output().

Functions InterrogateType::_constructors [private]
 

Definition at line 153 of file interrogateType.h.

Referenced by get_enum_value(), input(), InterrogateType::EnumValue::input(), merge_with(), and output().

CPPScope* InterrogateType::_cppscope
 

Definition at line 214 of file interrogateType.h.

Referenced by InterrogateType().

CPPType* InterrogateType::_cpptype
 

Definition at line 213 of file interrogateType.h.

Referenced by InterrogateType(), and InterfaceMakerPythonObj::synthesize_this_parameter().

Derivations InterrogateType::_derivations [private]
 

Definition at line 184 of file interrogateType.h.

Referenced by destructor_is_inherited(), get_destructor(), input(), merge_with(), number_of_casts(), number_of_elements(), number_of_methods(), and output().

FunctionIndex InterrogateType::_destructor [private]
 

Definition at line 154 of file interrogateType.h.

Referenced by input(), InterrogateType::EnumValue::input(), InterrogateType(), is_class(), is_union(), merge_with(), and output().

Elements InterrogateType::_elements [private]
 

Definition at line 157 of file interrogateType.h.

Referenced by input(), InterrogateType::EnumValue::input(), is_fully_defined(), merge_with(), and output().

string InterrogateType::_empty_string [static, private]
 

Definition at line 30 of file interrogateType.cxx.

Referenced by is_const(), and is_pointer().

EnumValues InterrogateType::_enum_values [private]
 

Definition at line 200 of file interrogateType.h.

Referenced by get_wrapped_type(), is_const(), is_pointer(), is_wrapped(), merge_with(), and output().

int InterrogateType::_flags [private]
 

Definition at line 144 of file interrogateType.h.

Referenced by get_atomic_token(), InterrogateBuilder::get_cast_function(), get_enum_value_name(), get_enum_value_scoped_name(), has_comment(), InterrogateType::EnumValue::input(), InterrogateType(), is_atomic(), is_enum(), is_short(), is_signed(), is_unsigned(), merge_with(), number_of_enum_values(), and output().

Functions InterrogateType::_methods [private]
 

Definition at line 158 of file interrogateType.h.

Referenced by input(), InterrogateType::EnumValue::input(), merge_with(), and output().

Types InterrogateType::_nested_types [private]
 

Definition at line 203 of file interrogateType.h.

Referenced by input(), merge_with(), number_of_derivations(), and output().

TypeIndex InterrogateType::_outer_class [private]
 

Definition at line 148 of file interrogateType.h.

Referenced by input(), InterrogateType::EnumValue::input(), merge_with(), and output().

string InterrogateType::_scoped_name [private]
 

Definition at line 145 of file interrogateType.h.

Referenced by InterrogateBuilder::get_cast_function(), InterrogateType::EnumValue::input(), merge_with(), and output().

string InterrogateType::_true_name [private]
 

Definition at line 146 of file interrogateType.h.

Referenced by InterrogateBuilder::get_cast_function(), get_scoped_name(), has_scoped_name(), InterrogateType::EnumValue::input(), merge_with(), and output().

TypeIndex InterrogateType::_wrapped_type [private]
 

Definition at line 150 of file interrogateType.h.

Referenced by input(), InterrogateType::EnumValue::input(), InterrogateType(), is_longlong(), merge_with(), and output().


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