#include <cppFunctionType.h>
Inheritance diagram for CPPFunctionType:
Public Types | |
enum | Flags { F_const_method = 0x01, F_operator_typecast = 0x02, F_constructor = 0x04, F_destructor = 0x08, F_method_pointer = 0x10 } |
typedef vector< CPPTypedef * > | Typedefs |
typedef map< CPPDeclaration *, CPPDeclaration * > | SubstDecl |
typedef set< CPPDeclaration * > | Instantiations |
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 | |
CPPFunctionType (CPPType *return_type, CPPParameterList *parameters, int flags) | |
CPPFunctionType (const CPPFunctionType ©) | |
void | operator= (const CPPFunctionType ©) |
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 CPPType * | resolve_type (CPPScope *current_scope, CPPScope *global_scope) |
If this CPPType object is a forward reference or other nonspecified reference to a type that might now be known a real type, returns the real type. | |
virtual bool | is_tbd () const |
Returns true if the type, or any nested type within the type, is a CPPTBDType and thus isn't fully determined right now. | |
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 additional parameter allows us to specify the number of parameters we wish to show the default values for. | |
virtual void | output_instance (ostream &out, int indent_level, CPPScope *scope, bool complete, const string &prename, const string &name) const |
Formats a C++-looking line that defines an instance of the given type, with the indicated name. | |
void | output_instance (ostream &out, int indent_level, CPPScope *scope, bool complete, const string &prename, const string &name, int num_default_parameters) const |
The additional parameter allows us to specify the number of parameters we wish to show the default values for. | |
int | get_num_default_parameters () const |
Returns the number of parameters in the list that may take default values. | |
virtual SubType | get_subtype () const |
virtual CPPFunctionType * | as_function_type () |
bool | is_equivalent_function (const CPPFunctionType &other) const |
This is similar to is_equal(), except it is more forgiving: it considers the functions to be equivalent only if the return type and the types of all parameters match. | |
bool | has_typedef_name () const |
Returns true if the type has even been typedef'ed and therefore has a simple name available to stand for it. | |
string | get_typedef_name (CPPScope *scope=NULL) const |
Returns a string that can be used to name the type, if has_typedef_name() returned true. | |
virtual string | get_simple_name () const |
Returns a fundametal one-word name for the type. | |
virtual string | get_local_name (CPPScope *scope=NULL) const |
Returns the compilable, correct name for this type within the indicated scope. | |
virtual string | get_fully_scoped_name () const |
Returns the compilable, correct name for the type, with completely explicit scoping. | |
virtual string | get_preferred_name () const |
Returns the best name to use for the type from a programmer's point of view. | |
virtual bool | is_incomplete () const |
Returns true if the type has not yet been fully specified, false if it has. | |
virtual bool | is_equivalent (const CPPType &other) const |
This is a little more forgiving than is_equal(): it returns true if the types appear to be referring to the same thing, even if they may have different pointers or somewhat different definitions. | |
void | output_instance (ostream &out, const string &name, CPPScope *scope) const |
Formats a C++-looking line that defines an instance of the given type, with the indicated name. | |
virtual CPPType * | as_type () |
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 * | instantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
virtual CPPDeclaration * | substitute_decl (SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) |
virtual CPPInstance * | as_instance () |
virtual CPPClassTemplateParameter * | as_class_template_parameter () |
virtual CPPTypedef * | as_typedef () |
virtual CPPTypeDeclaration * | as_type_declaration () |
virtual CPPExpression * | as_expression () |
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 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 | |
CPPType * | new_type (CPPType *type) |
This should be called whenever a new CPPType object is created. | |
void | record_preferred_name_for (const CPPType *type, const string &name) |
Records a global typedef name associated with the indicated Type. | |
string | get_preferred_name_for (const CPPType *type) |
Returns the previously-stored "preferred" name associated with the type, if any, or empty string if no name is associated. | |
Public Attributes | |
CPPType * | _return_type |
CPPParameterList * | _parameters |
int | _flags |
CPPIdentifier * | _class_owner |
Typedefs | _typedefs |
CPPTypeDeclaration * | _declaration |
Instantiations | _instantiations |
CPPVisibility | _vis |
CPPTemplateScope * | _template_scope |
CPPFile | _file |
CPPCommentBlock * | _leading_comment |
Protected Types | |
typedef set< CPPType *, CPPTypeCompare > | Types |
typedef map< string, string > | PreferredNames |
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. | |
Static Protected Attributes | |
Types | _types |
PreferredNames | _preferred_names |
|
Reimplemented in CPPInstance. Definition at line 118 of file cppDeclaration.h. |
|
|
|
Definition at line 113 of file cppDeclaration.h. Referenced by CPPScope::is_fully_specified(). |
|
|
|
|
|
Definition at line 40 of file cppFunctionType.h. |
|
Definition at line 71 of file cppDeclaration.h. Referenced by CPPUsing::output(), CPPFunctionGroup::output(), CPPClassTemplateParameter::output(), and output_instance(). |
|
Definition at line 36 of file cppFunctionType.cxx. References _class_owner, CPPParameterList::_parameters, _parameters, NULL, and CPPSimpleType::T_void. |
|
Definition at line 64 of file cppFunctionType.cxx. |
|
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 from CPPDeclaration. Definition at line 353 of file cppFunctionType.cxx. References _flags, _parameters, _return_type, and NULL. |
|
Reimplemented in CPPInstance. Definition at line 207 of file cppDeclaration.cxx. References NULL. Referenced by CPPExpression::CPPExpression(), and CPPTypedef::CPPTypedef(). |
|
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 from CPPDeclaration. Reimplemented in CPPTypeProxy. Definition at line 297 of file cppType.cxx. |
|
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. |
|
Returns the compilable, correct name for the type, with completely explicit scoping.
Reimplemented in CPPExtensionType, CPPTBDType, and CPPTypeProxy. Definition at line 175 of file cppType.cxx. References CPPDeclaration::get_subtype(), and CPPDeclaration::is_equal(). Referenced by CPPType::output_instance(). |
|
Returns the compilable, correct name for this type within the indicated scope. If the scope is NULL, within the scope the type is declared in. Reimplemented in CPPExtensionType, CPPTBDType, and CPPTypeProxy. Definition at line 158 of file cppType.cxx. Referenced by FunctionRemap::get_parameter_name(), CPPType::get_simple_name(), CPPTypeProxy::get_typedef_name(), CPPType::has_typedef_name(), TypeManager::is_pointable(), ParameterRemapConcreteToPointer::pass_parameter(), and InterfaceMakerPythonObj::write_function_for(). |
|
Returns the number of parameters in the list that may take default values.
Definition at line 316 of file cppFunctionType.cxx. |
|
Returns the best name to use for the type from a programmer's point of view. This will typically be a typedef name if one is available, or the full C++ name if it is not. The typedef may or may not be visible within the current scope, so this type name may not be compilable. Reimplemented in CPPSimpleType, and CPPTypeProxy. Definition at line 198 of file cppType.cxx. References CPPDeclaration::output(). |
|
Returns the previously-stored "preferred" name associated with the type, if any, or empty string if no name is associated.
Definition at line 377 of file cppType.cxx. Referenced by CPPType::get_simple_name(). |
|
Returns a fundametal one-word name for the type. This name will not include any scoping operators or template parameters, so it may not be a compilable reference to the type. Reimplemented in CPPExtensionType, CPPTBDType, and CPPTypeProxy. Definition at line 141 of file cppType.cxx. References CPPType::get_local_name(), and CPPType::get_preferred_name_for(). Referenced by CPPTypeProxy::has_typedef_name(), and InterfaceMakerPythonObj::synthesize_this_parameter(). |
|
Implements CPPDeclaration. Definition at line 341 of file cppFunctionType.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(). |
|
Returns a string that can be used to name the type, if has_typedef_name() returned true. This will be the first typedef name applied to the type. Reimplemented in CPPTypeProxy. Definition at line 118 of file cppType.cxx. References CPPDeclaration::output(), and ostringstream::str(). |
|
Returns true if the type has even been typedef'ed and therefore has a simple name available to stand for it. Extension types are all implicitly typedef'ed on declaration. Reimplemented in CPPTypeProxy. Definition at line 101 of file cppType.cxx. References CPPType::get_local_name(). |
|
Reimplemented in CPPInstance, and CPPStructType. Definition at line 174 of file cppDeclaration.cxx. References NULL. |
|
Called by CPPDeclaration() to determine whether this type is equivalent to another type of the same type.
Reimplemented from CPPDeclaration. Definition at line 399 of file cppFunctionType.cxx. |
|
This is a little more forgiving than is_equal(): it returns true if the types appear to be referring to the same thing, even if they may have different pointers or somewhat different definitions. It's useful for parameter matching, etc. Reimplemented in CPPArrayType, CPPConstType, CPPExtensionType, CPPPointerType, and CPPReferenceType. Definition at line 239 of file cppType.cxx. Referenced by CPPExtensionType::substitute_decl(). |
|
This is similar to is_equal(), except it is more forgiving: it considers the functions to be equivalent only if the return type and the types of all parameters match.
Definition at line 372 of file cppFunctionType.cxx. |
|
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 104 of file cppFunctionType.cxx. |
|
Returns true if the type has not yet been fully specified, false if it has.
Reimplemented in CPPEnumType, CPPExtensionType, CPPStructType, and CPPTypeProxy. Definition at line 218 of file cppType.cxx. Referenced by CPPTypeProxy::get_local_name(). |
|
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 from CPPDeclaration. Definition at line 429 of file cppFunctionType.cxx. |
|
Returns true if the type, or any nested type within the type, is a CPPTBDType and thus isn't fully determined right now. In this case, calling resolve_type() may or may not resolve the type. Reimplemented from CPPType. Definition at line 188 of file cppFunctionType.cxx. References _flags, _parameters, _return_type, F_const_method, CPPParameterList::output(), and CPPDeclaration::output(). |
|
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(). |
|
This should be called whenever a new CPPType object is created. It will uniquify the type pointers by checking to see if some equivalent CPPType object has previously been created; if it has, it returns the old object and deletes the new one. Otherwise, it stores the new one and returns it. Definition at line 321 of file cppType.cxx. Referenced by CPPInstanceIdentifier::add_array_modifier(), CPPEnumType::CPPEnumType(), InterrogateBuilder::get_getter(), CPPInstance::get_local_name(), CPPInstance::get_simple_name(), CPPArrayType::is_fully_specified(), CPPPreprocessor::should_ignore_manifest(), and TypeManager::unwrap_const_reference(). |
|
Definition at line 92 of file cppDeclaration.cxx. |
|
Definition at line 104 of file cppDeclaration.cxx. References CPPDeclaration::_template_scope, and NULL. |
|
Definition at line 81 of file cppFunctionType.cxx. References _parameters, _return_type, CPPParameterList::is_fully_specified(), and CPPDeclaration::is_fully_specified(). |
|
Definition at line 77 of file cppDeclaration.cxx. |
|
The additional parameter allows us to specify the number of parameters we wish to show the default values for. If num_default_parameters is >= 0, it indicates the number of default parameter values to show on output. Otherwise, all parameter values are shown. Definition at line 226 of file cppFunctionType.cxx. References _flags, _parameters, _return_type, F_const_method, F_constructor, F_destructor, CPPParameterList::output(), CPPType::output_instance(), and ostringstream::str(). |
|
Implements CPPDeclaration. Definition at line 203 of file cppFunctionType.cxx. References output_instance(). |
|
Formats a C++-looking line that defines an instance of the given type, with the indicated name. In most cases this will be "type name", but some types have special exceptions. Definition at line 262 of file cppType.cxx. References CPPType::_preferred_names, and CPPType::get_fully_scoped_name(). Referenced by CPPTypeProxy::get_fully_scoped_name(), CPPReferenceType::is_equivalent(), CPPPointerType::output(), output(), FunctionWriterPtrToPython::write_prototype(), FunctionWriterPtrFromPython::write_prototype(), FunctionWriterPtrFromPython::~FunctionWriterPtrFromPython(), and FunctionWriterPtrToPython::~FunctionWriterPtrToPython(). |
|
The additional parameter allows us to specify the number of parameters we wish to show the default values for. If num_default_parameters is >= 0, it indicates the number of default parameter values to show on output. Otherwise, all parameter values are shown. Definition at line 277 of file cppFunctionType.cxx. References CPPDeclaration::ST_function, and CPPDeclaration::SubType. |
|
Formats a C++-looking line that defines an instance of the given type, with the indicated name. In most cases this will be "type name", but some types have special exceptions. Reimplemented from CPPType. Definition at line 252 of file cppFunctionType.cxx. References CPPParameterList::_parameters, _parameters, and NULL. Referenced by output(). |
|
Records a global typedef name associated with the indicated Type. This will be taken as the "preferred" name for this class, should anyone ask. Definition at line 355 of file cppType.cxx. |
|
If this CPPType object is a forward reference or other nonspecified reference to a type that might now be known a real type, returns the real type. Otherwise returns the type itself. Reimplemented from CPPType. Definition at line 159 of file cppFunctionType.cxx. References _parameters, _return_type, CPPParameterList::is_tbd(), and CPPType::is_tbd(). |
|
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(). |
|
Definition at line 118 of file cppFunctionType.cxx. |
|
Definition at line 88 of file cppFunctionType.h. Referenced by CPPFunctionType(), CPPInstanceIdentifier::get_scope(), and CPPPointerType::output(). |
|
Definition at line 87 of file cppType.h. Referenced by TypeManager::is_pointer_to_base(). |
|
Definition at line 149 of file cppDeclaration.h. Referenced by InterrogateBuilder::remap_indices(), InterrogateBuilder::scan_function(), and CPPScope::write(). |
|
Definition at line 55 of file cppFunctionType.h. Referenced by as_function_type(), FunctionRemap::get_parameter_expr(), CPPInstanceIdentifier::get_scope(), is_tbd(), CPPPointerType::output(), output(), and TypeManager::wrap_const_reference(). |
|
Reimplemented in CPPInstance. Definition at line 119 of file cppDeclaration.h. |
|
Definition at line 150 of file cppDeclaration.h. Referenced by CPPDeclaration::CPPDeclaration(), and CPPScope::set_current_vis(). |
|
Definition at line 54 of file cppFunctionType.h. Referenced by as_function_type(), CPPFunctionType(), TypeManager::is_const_pointer_to_base(), is_tbd(), operator=(), output(), output_instance(), and resolve_type(). |
|
Definition at line 27 of file cppType.cxx. Referenced by CPPType::output_instance(). |
|
Definition at line 53 of file cppFunctionType.h. Referenced by as_function_type(), TypeManager::is_const_pointer_to_base(), is_tbd(), operator=(), output(), resolve_type(), and CPPFunctionGroup::~CPPFunctionGroup(). |
|
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 52 of file cppType.h. Referenced by CPPType::is_tbd(). |
|
Definition at line 26 of file cppType.cxx. |
|
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(). |