#include <cppInstance.h>
Inheritance diagram for CPPInstance:
Public Types | |
enum | StorageClass { SC_static = 0x001, SC_extern = 0x002, SC_c_binding = 0x004, SC_virtual = 0x008, SC_inline = 0x010, SC_explicit = 0x020, SC_register = 0x040, SC_pure_virtual = 0x080, SC_volatile = 0x100, SC_mutable = 0x200, SC_inherited_virtual = 0x400 } |
typedef map< CPPDeclaration *, CPPDeclaration * > | SubstDecl |
enum | SubType { ST_instance, ST_typedef, ST_type_declaration, ST_expression, ST_type, ST_namespace, ST_using, ST_simple, ST_pointer, ST_reference, ST_array, ST_const, ST_function, ST_function_group, ST_extension, ST_struct, ST_enum, ST_class_template_parameter, ST_tbd, ST_type_proxy } |
Public Member Functions | |
CPPInstance (CPPType *type, const string &name, int storage_class=0) | |
CPPInstance (CPPType *type, CPPIdentifier *ident, int storage_class=0) | |
CPPInstance (CPPType *type, CPPInstanceIdentifier *ii, int storage_class, const CPPFile &file) | |
Constructs a new CPPInstance object that defines a variable of the indicated type according to the type and the InstanceIdentifier. | |
CPPInstance (const CPPInstance ©) | |
~CPPInstance () | |
bool | operator== (const CPPInstance &other) const |
bool | operator!= (const CPPInstance &other) const |
bool | operator< (const CPPInstance &other) const |
void | set_initializer (CPPExpression *initializer) |
Sets the value of the expression that is used to initialize the variable, or the default value for a parameter. | |
bool | is_scoped () const |
CPPScope * | get_scope (CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
string | get_simple_name () const |
string | get_local_name (CPPScope *scope=NULL) const |
string | get_fully_scoped_name () const |
void | check_for_constructor (CPPScope *current_scope, CPPScope *global_scope) |
If this is a function type instance, checks whether the function name matches the class name (or ~name), and if so, flags it as a constructor (or destructor). | |
virtual CPPDeclaration * | instantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
virtual bool | is_fully_specified () const |
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated. | |
virtual CPPDeclaration * | substitute_decl (SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) |
virtual void | output (ostream &out, int indent_level, CPPScope *scope, bool complete) const |
void | output (ostream &out, int indent_level, CPPScope *scope, bool complete, int num_default_parameters) const |
The extra parameter comes into play only when we happen to be outputting a function prototype. | |
virtual SubType | get_subtype () const |
virtual CPPInstance * | as_instance () |
bool | operator== (const CPPDeclaration &other) const |
bool | operator!= (const CPPDeclaration &other) const |
bool | operator< (const CPPDeclaration &other) const |
bool | is_template () const |
Returns true if this is a template declaration of some kind: a template function or a template class, typically. | |
CPPTemplateScope * | get_template_scope () const |
If is_template(), above, returns true, this returns the CPPTemplateScope in which this particular template declaration is defined. | |
virtual CPPDeclaration * | substitute_decl (SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) |
virtual CPPClassTemplateParameter * | as_class_template_parameter () |
virtual CPPTypedef * | as_typedef () |
virtual CPPTypeDeclaration * | as_type_declaration () |
virtual CPPExpression * | as_expression () |
virtual CPPType * | as_type () |
virtual CPPNamespace * | as_namespace () |
virtual CPPUsing * | as_using () |
virtual CPPSimpleType * | as_simple_type () |
virtual CPPPointerType * | as_pointer_type () |
virtual CPPReferenceType * | as_reference_type () |
virtual CPPArrayType * | as_array_type () |
virtual CPPConstType * | as_const_type () |
virtual CPPFunctionType * | as_function_type () |
virtual CPPFunctionGroup * | as_function_group () |
virtual CPPExtensionType * | as_extension_type () |
virtual CPPStructType * | as_struct_type () |
virtual CPPEnumType * | as_enum_type () |
virtual CPPTBDType * | as_tbd_type () |
virtual CPPTypeProxy * | as_type_proxy () |
Static Public Member Functions | |
CPPInstance * | make_typecast_function (CPPInstance *inst, CPPIdentifier *ident, CPPParameterList *parameters, int function_flags) |
Constructs and returns a new CPPInstance object that corresponds to a function prototype declaration for a typecast method, whose return type is implicit in the identifier type. | |
Public Attributes | |
CPPType * | _type |
CPPIdentifier * | _ident |
CPPExpression * | _initializer |
int | _storage_class |
CPPVisibility | _vis |
CPPTemplateScope * | _template_scope |
CPPFile | _file |
CPPCommentBlock * | _leading_comment |
Protected Member Functions | |
virtual bool | is_equal (const CPPDeclaration *other) const |
Called by CPPDeclaration to determine whether this type is equivalent to another type of the same type. | |
virtual bool | is_less (const CPPDeclaration *other) const |
Called by CPPDeclaration to determine whether this type should be ordered before another type of the same type, in an arbitrary but fixed ordering. | |
Private Types | |
typedef map< const CPPTemplateParameterList *, CPPInstance *, CPPTPLCompare > | Instantiations |
Private Attributes | |
Instantiations | _instantiations |
|
Reimplemented from CPPDeclaration. Definition at line 116 of file cppInstance.h. |
|
Definition at line 113 of file cppDeclaration.h. Referenced by CPPScope::is_fully_specified(). |
|
Definition at line 48 of file cppInstance.h. |
|
Definition at line 71 of file cppDeclaration.h. Referenced by CPPUsing::output(), CPPFunctionGroup::output(), CPPClassTemplateParameter::output(), and CPPFunctionType::output_instance(). |
|
Definition at line 46 of file cppInstance.cxx. References _initializer, and NULL. Referenced by CPPTypedef::CPPTypedef(). |
|
Definition at line 63 of file cppInstance.cxx. |
|
Constructs a new CPPInstance object that defines a variable of the indicated type according to the type and the InstanceIdentifier. The InstanceIdentifier pointer is deallocated. Definition at line 87 of file cppInstance.cxx. |
|
Definition at line 107 of file cppInstance.cxx. |
|
Definition at line 125 of file cppInstance.cxx. References CPPFunctionType::F_operator_typecast. |
|
Reimplemented in CPPArrayType, and CPPTypeProxy. Definition at line 339 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(). |
|
Reimplemented in CPPClassTemplateParameter. Definition at line 219 of file cppDeclaration.cxx. References NULL. |
|
|
Reimplemented in CPPEnumType, and CPPTypeProxy. Definition at line 411 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_reference_type(). |
|
Reimplemented in CPPExpression. Definition at line 255 of file cppDeclaration.cxx. References NULL. |
|
Reimplemented in CPPExtensionType, and CPPTypeProxy. Definition at line 387 of file cppDeclaration.cxx. Referenced by TypeManager::is_simple(). |
|
Reimplemented in CPPFunctionGroup. Definition at line 375 of file cppDeclaration.cxx. |
|
Reimplemented in CPPFunctionType, and CPPTypeProxy. Definition at line 363 of file cppDeclaration.cxx. Referenced by CPPStructType::check_virtual(), CPPInstanceIdentifier::get_scope(), get_simple_name(), InterrogateBuilder::in_noinclude(), TypeManager::is_const_pointer_to_base(), CPPPointerType::output(), TypeManager::unwrap(), TypeManager::wrap_const_reference(), and CPPFunctionGroup::~CPPFunctionGroup(). |
|
Reimplemented from CPPDeclaration. Definition at line 635 of file cppInstance.cxx. |
|
Reimplemented in CPPNamespace. Definition at line 279 of file cppDeclaration.cxx. References NULL. |
|
Reimplemented in CPPPointerType, and CPPTypeProxy. Definition at line 315 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(), TypeManager::is_const_ref_to_simple(), and CPPTypeProxy::output_instance(). |
|
Reimplemented in CPPReferenceType, and CPPTypeProxy. Definition at line 327 of file cppDeclaration.cxx. References NULL. Referenced by InterrogateBuilder::insert_param_list(), TypeManager::involves_unpublished(), TypeManager::is_const_ref_to_enum(), TypeManager::is_reference_count(), and CPPTypeProxy::output(). |
|
Reimplemented in CPPSimpleType, and CPPTypeProxy. Definition at line 303 of file cppDeclaration.cxx. References NULL. Referenced by TypeManager::is_basic_string_char(), TypeManager::is_char_pointer(), TypeManager::is_const_basic_string_char(), and TypeManager::is_const_simple(). |
|
Reimplemented in CPPStructType, and CPPTypeProxy. Definition at line 399 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_pointer_type(), CPPScope::find_scope(), InterrogateBuilder::get_getter(), and TypeManager::wrap_const_pointer(). |
|
Reimplemented in CPPTBDType, and CPPTypeProxy. Definition at line 423 of file cppDeclaration.cxx. Referenced by CPPTypeProxy::as_array_type(). |
|
Reimplemented in CPPType, and CPPTypeProxy. Definition at line 267 of file cppDeclaration.cxx. References NULL. Referenced by CPPIdentifier::get_scope(), CPPTemplateParameterList::get_string(), CPPReferenceType::is_fully_specified(), CPPPointerType::is_fully_specified(), CPPConstType::is_fully_specified(), CPPArrayType::is_tbd(), and CPPScope::write(). |
|
Reimplemented in CPPTypeDeclaration. Definition at line 243 of file cppDeclaration.cxx. References NULL. |
|
Reimplemented in CPPTypeProxy. Definition at line 435 of file cppDeclaration.cxx. |
|
Reimplemented in CPPTypedef. Definition at line 231 of file cppDeclaration.cxx. Referenced by CPPTypedef::CPPTypedef(). |
|
Reimplemented in CPPUsing. Definition at line 291 of file cppDeclaration.cxx. |
|
If this is a function type instance, checks whether the function name matches the class name (or ~name), and if so, flags it as a constructor (or destructor).
Definition at line 377 of file cppInstance.cxx. References _instantiations. |
|
Definition at line 356 of file cppInstance.cxx. |
|
Definition at line 340 of file cppInstance.cxx. References _type, and CPPType::new_type(). Referenced by get_simple_name(), and TypeManager::wrap_pointer(). |
|
Definition at line 307 of file cppInstance.cxx. References _ident, CPPIdentifier::get_fully_scoped_name(), and NULL. Referenced by get_simple_name(), and InterrogateBuilder::in_noinclude(). |
|
Definition at line 324 of file cppInstance.cxx. References _type, CPPDeclaration::as_function_type(), current_scope, CPPScope::get_local_name(), get_local_name(), get_scope(), global_scope, CPPType::new_type(), and NULL. Referenced by InterfaceMakerPythonObj::write_function_for(). |
|
Implements CPPDeclaration. Reimplemented in CPPTypeDeclaration, and CPPTypedef. Definition at line 623 of file cppInstance.cxx. |
|
If is_template(), above, returns true, this returns the CPPTemplateScope in which this particular template declaration is defined. This scope includes the information about the template parameters. Definition at line 143 of file cppDeclaration.cxx. References NULL, and CPPPreprocessor::warning(). |
|
Reimplemented from CPPDeclaration. Definition at line 417 of file cppInstance.cxx. References _ident, _initializer, _type, CPPDeclaration::is_fully_specified(), CPPIdentifier::is_fully_specified(), and NULL. |
|
Called by CPPDeclaration to determine whether this type is equivalent to another type of the same type.
Reimplemented in CPPArrayType, CPPClassTemplateParameter, CPPConstType, CPPExpression, CPPFunctionType, CPPPointerType, CPPReferenceType, CPPSimpleType, CPPStructType, and CPPTBDType. Definition at line 451 of file cppDeclaration.cxx. Referenced by CPPType::get_fully_scoped_name(), and CPPDeclaration::~CPPDeclaration(). |
|
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.
Reimplemented from CPPDeclaration. Definition at line 480 of file cppInstance.cxx. |
|
Called by CPPDeclaration to determine whether this type should be ordered before another type of the same type, in an arbitrary but fixed ordering.
Reimplemented in CPPArrayType, CPPClassTemplateParameter, CPPConstType, CPPExpression, CPPFunctionType, CPPPointerType, CPPReferenceType, CPPSimpleType, CPPStructType, and CPPTBDType. Definition at line 468 of file cppDeclaration.cxx. |
|
Definition at line 291 of file cppInstance.cxx. References _ident, CPPIdentifier::get_local_name(), and NULL. Referenced by InterrogateBuilder::in_noinclude(). |
|
Returns true if this is a template declaration of some kind: a template function or a template class, typically.
Definition at line 124 of file cppDeclaration.cxx. Referenced by InterrogateBuilder::remap_indices(), and InterrogateBuilder::scan_function(). |
|
Constructs and returns a new CPPInstance object that corresponds to a function prototype declaration for a typecast method, whose return type is implicit in the identifier type.
Definition at line 145 of file cppInstance.cxx. References _storage_class. |
|
Definition at line 92 of file cppDeclaration.cxx. |
|
Definition at line 204 of file cppInstance.cxx. |
|
Definition at line 104 of file cppDeclaration.cxx. References CPPDeclaration::_template_scope, and NULL. |
|
Definition at line 216 of file cppInstance.cxx. |
|
Definition at line 77 of file cppDeclaration.cxx. |
|
Definition at line 166 of file cppInstance.cxx. |
|
The extra parameter comes into play only when we happen to be outputting a function prototype. See CPPFunctionType::output(). Definition at line 558 of file cppInstance.cxx. |
|
Implements CPPDeclaration. Reimplemented in CPPTypeDeclaration, and CPPTypedef. Definition at line 541 of file cppInstance.cxx. References _initializer, and NULL. Referenced by CPPTypedef::substitute_decl(). |
|
Sets the value of the expression that is used to initialize the variable, or the default value for a parameter. If a non-null expression is set on a function declaration, it implies that the function is pure virtual. Definition at line 269 of file cppInstance.cxx. References _ident, current_scope, and NULL. |
|
Definition at line 191 of file cppDeclaration.cxx. Referenced by CPPReferenceType::is_fully_specified(), CPPPointerType::is_fully_specified(), CPPConstType::is_fully_specified(), CPPArrayType::is_tbd(), and CPPScope::write(). |
|
Reimplemented in CPPTypeDeclaration, and CPPTypedef. Definition at line 499 of file cppInstance.cxx. References _storage_class, and SC_extern. Referenced by CPPTypedef::CPPTypedef(). |
|
Definition at line 149 of file cppDeclaration.h. Referenced by InterrogateBuilder::remap_indices(), InterrogateBuilder::scan_function(), and CPPScope::write(). |
|
Definition at line 110 of file cppInstance.h. Referenced by get_scope(), instantiate(), is_scoped(), and set_initializer(). |
|
Definition at line 111 of file cppInstance.h. Referenced by CPPEnumType::CPPEnumType(), CPPInstance(), instantiate(), and output(). |
|
Reimplemented from CPPDeclaration. Definition at line 117 of file cppInstance.h. Referenced by check_for_constructor(). |
|
Definition at line 150 of file cppDeclaration.h. Referenced by CPPDeclaration::CPPDeclaration(), and CPPScope::set_current_vis(). |
|
Definition at line 113 of file cppInstance.h. Referenced by make_typecast_function(), and substitute_decl(). |
|
Definition at line 148 of file cppDeclaration.h. Referenced by CPPTemplateScope::add_declaration(), CPPTemplateScope::add_enum_value(), CPPTemplateScope::CPPTemplateScope(), and CPPDeclaration::operator<(). |
|
Definition at line 109 of file cppInstance.h. Referenced by CPPStructType::check_virtual(), CPPInstance(), get_local_name(), get_simple_name(), InterrogateBuilder::in_noinclude(), instantiate(), CPPParameterList::substitute_decl(), TypeManager::unwrap(), and TypeManager::wrap_const_reference(). |
|
Definition at line 147 of file cppDeclaration.h. Referenced by CPPScope::get_local_name(), TypeManager::is_pointer_to_base(), InterrogateBuilder::remap_indices(), InterrogateBuilder::scan_function(), and TypeManager::wrap_const_reference(). |