Puma Reference Manual | Puma: Puma::CFunctionInfo Class Reference |
#include <Puma/CFunctionInfo.h>
Public Member Functions | |
CFunctionInfo () | |
Constructor. | |
~CFunctionInfo () | |
Destructor. | |
CFunctionInfo * | DefObject () const |
Get the semantic object of the function definition. | |
CTypeFunction * | TypeInfo () const |
Get the type information for the function. | |
CTypeInfo * | ConversionType () const |
Get the conversion type if this is a conversion function. | |
CTypeInfo * | ReturnType () const |
Get the return type of the function. | |
CTemplateInfo * | TemplateInfo () const |
Get the template information if this is a function template. | |
CRecord * | Record () const |
Get the class or union if this is a method of a class or union. | |
CNamespaceInfo * | Namespace () const |
Get the namespace if this function is declared in a namespace. | |
unsigned | Labels () const |
Get the number of jump labels defined in the function body. | |
unsigned | Arguments () const |
Get the number of function parameters. | |
CLabelInfo * | Label (unsigned n) const |
Get the n-th jump label. | |
CLabelInfo * | Label (const char *name) const |
Get the jump label with the given name. | |
CArgumentInfo * | Argument (unsigned n) const |
Get the n-th function parameter. | |
CArgumentInfo * | Argument (const char *name) const |
Get the function parameter with the given name. | |
CTree * | DefaultArgument (unsigned n) const |
Get the default argument of the n-th function parameter. | |
CT_ExprList * | Init () const |
Get the initializer of the function. | |
void | ConversionType (CTypeInfo *type) |
Set the conversion type of a conversion function. | |
void | QualifiedScope (CStructure *scope) |
Set the qualification scope of a class/union method or function declared in a namespace. | |
void | addArgument (CArgumentInfo *info) |
Add a function parameter. | |
void | addLabel (CLabelInfo *label) |
Add a jump label. | |
void | removeArgument (const CArgumentInfo *info) |
Remove the given function parameter. | |
void | removeLabel (const CLabelInfo *label) |
Remove the given jump label. | |
void | TemplateInfo (CTemplateInfo *info) |
Set the template information of a function template. | |
void | isTemplate (bool v) |
Set whether the function is a function template. | |
CArgumentInfo * | newArgument () |
Create a new function parameter. | |
CLabelInfo * | newLabel () |
Create a new jump label. | |
void | deleteArgument (const CArgumentInfo *info) |
Remove and destroy the given function parameter. | |
void | deleteLabel (const CLabelInfo *info) |
Remove and destroy the given jump label. | |
bool | hasEllipsis () const |
Check if the function accepts a variable argument list. | |
bool | hasDefaultArgument (unsigned n) const |
Check if the n-th function parameter has a default argument. | |
bool | isFctDef () const |
Check if this is a function definition. | |
bool | isMethod () const |
Check if this is a method of a class or union. | |
bool | isStaticMethod () const |
Check if this is a static method of a class or union. | |
bool | isTemplate () const |
Check if this is a function template. | |
bool | isDefined () const |
Check if the function is defined. | |
bool | isDestructor () const |
Check if this is a destructor. | |
bool | isConstructor () const |
Check if this is a constructor. | |
bool | isOperator () const |
Check if this is an overloaded operator. | |
bool | isConversion () const |
Check if this is a conversion function. | |
bool | isPureVirtual () const |
Check if the function is pure virtual. | |
void | isDestructor (bool v) |
Set whether the function is a destructor. | |
void | isConstructor (bool v) |
Set whether the function is a constructor. | |
void | isOperator (bool v) |
Set whether the function is an overloaded operator. | |
void | isConversion (bool v) |
Set whether the function is a conversion function. | |
bool | hasSameNameAndArgs (const CFunctionInfo *fi) const |
Check if the given function has the same name and parameter types as this function. | |
bool | overridesVirtual () const |
Check if the function is a non-static member function and if in any of the base classes there is a function definition of a virtual function with the same name and argument types. | |
Protected Member Functions | |
CFunctionInfo (ObjectId id) | |
Constructor. |
Puma::CFunctionInfo::CFunctionInfo | ( | ObjectId | id | ) | [inline, protected] |
Constructor.
id | The object type. |
Puma::CFunctionInfo::CFunctionInfo | ( | ) | [inline] |
Constructor.
Puma::CFunctionInfo::~CFunctionInfo | ( | ) |
Destructor.
If the object type is CObjectInfo::FUNCTION_INFO, then CObjectInfo::CleanUp() is called.
CFunctionInfo* Puma::CFunctionInfo::DefObject | ( | ) | const |
Get the semantic object of the function definition.
Reimplemented from Puma::CObjectInfo.
CTypeFunction * Puma::CFunctionInfo::TypeInfo | ( | ) | const [inline] |
CTypeInfo * Puma::CFunctionInfo::ConversionType | ( | ) | const [inline] |
Get the conversion type if this is a conversion function.
CTypeInfo* Puma::CFunctionInfo::ReturnType | ( | ) | const |
Get the return type of the function.
CTemplateInfo * Puma::CFunctionInfo::TemplateInfo | ( | ) | const [inline] |
Get the template information if this is a function template.
Reimplemented from Puma::CObjectInfo.
CRecord* Puma::CFunctionInfo::Record | ( | ) | const |
Get the class or union if this is a method of a class or union.
Reimplemented from Puma::CObjectInfo.
CNamespaceInfo* Puma::CFunctionInfo::Namespace | ( | ) | const |
Get the namespace if this function is declared in a namespace.
unsigned Puma::CFunctionInfo::Labels | ( | ) | const [inline] |
Get the number of jump labels defined in the function body.
unsigned Puma::CFunctionInfo::Arguments | ( | ) | const [inline] |
Get the number of function parameters.
CLabelInfo * Puma::CFunctionInfo::Label | ( | unsigned | n | ) | const [inline] |
Get the n-th jump label.
n | The index of the jump label. |
CLabelInfo* Puma::CFunctionInfo::Label | ( | const char * | name | ) | const |
Get the jump label with the given name.
name | The name of the jump label. |
CArgumentInfo * Puma::CFunctionInfo::Argument | ( | unsigned | n | ) | const [inline] |
Get the n-th function parameter.
n | The index of the function parameter. |
CArgumentInfo* Puma::CFunctionInfo::Argument | ( | const char * | name | ) | const |
Get the function parameter with the given name.
name | The name of the function parameter. |
CTree* Puma::CFunctionInfo::DefaultArgument | ( | unsigned | n | ) | const |
Get the default argument of the n-th function parameter.
n | The index of the function parameter. |
CT_ExprList* Puma::CFunctionInfo::Init | ( | ) | const |
Get the initializer of the function.
Only pure virtual functions have an initializer ("=0").
Reimplemented from Puma::CObjectInfo.
void Puma::CFunctionInfo::ConversionType | ( | CTypeInfo * | type | ) | [inline] |
Set the conversion type of a conversion function.
type | The conversion type. |
void Puma::CFunctionInfo::QualifiedScope | ( | CStructure * | scope | ) | [inline] |
Set the qualification scope of a class/union method or function declared in a namespace.
scope | The qualification scope. |
void Puma::CFunctionInfo::addArgument | ( | CArgumentInfo * | info | ) |
Add a function parameter.
info | The function parameter. |
void Puma::CFunctionInfo::addLabel | ( | CLabelInfo * | label | ) |
Add a jump label.
label | The jump label. |
void Puma::CFunctionInfo::removeArgument | ( | const CArgumentInfo * | info | ) |
Remove the given function parameter.
info | The function parameter. |
void Puma::CFunctionInfo::removeLabel | ( | const CLabelInfo * | label | ) |
Remove the given jump label.
label | The jump label. |
void Puma::CFunctionInfo::TemplateInfo | ( | CTemplateInfo * | info | ) | [inline] |
Set the template information of a function template.
info | The template information. |
void Puma::CFunctionInfo::isTemplate | ( | bool | v | ) | [inline] |
Set whether the function is a function template.
v | true if the function is a template. |
CArgumentInfo* Puma::CFunctionInfo::newArgument | ( | ) |
Create a new function parameter.
The new function parameter is added to the function.
CLabelInfo* Puma::CFunctionInfo::newLabel | ( | ) |
Create a new jump label.
The new jump label is added to the function.
void Puma::CFunctionInfo::deleteArgument | ( | const CArgumentInfo * | info | ) |
Remove and destroy the given function parameter.
info | The function parameter. |
void Puma::CFunctionInfo::deleteLabel | ( | const CLabelInfo * | info | ) |
Remove and destroy the given jump label.
info | The jump label. |
bool Puma::CFunctionInfo::hasEllipsis | ( | ) | const |
Check if the function accepts a variable argument list.
bool Puma::CFunctionInfo::hasDefaultArgument | ( | unsigned | n | ) | const |
Check if the n-th function parameter has a default argument.
n | The index of the function parameter. |
bool Puma::CFunctionInfo::isFctDef | ( | ) | const |
Check if this is a function definition.
bool Puma::CFunctionInfo::isMethod | ( | ) | const [inline] |
bool Puma::CFunctionInfo::isStaticMethod | ( | ) | const [inline] |
Check if this is a static method of a class or union.
bool Puma::CFunctionInfo::isTemplate | ( | ) | const [inline] |
bool Puma::CFunctionInfo::isDefined | ( | ) | const |
Check if the function is defined.
bool Puma::CFunctionInfo::isDestructor | ( | ) | const [inline] |
Check if this is a destructor.
bool Puma::CFunctionInfo::isConstructor | ( | ) | const [inline] |
Check if this is a constructor.
bool Puma::CFunctionInfo::isOperator | ( | ) | const [inline] |
Check if this is an overloaded operator.
bool Puma::CFunctionInfo::isConversion | ( | ) | const [inline] |
Check if this is a conversion function.
bool Puma::CFunctionInfo::isPureVirtual | ( | ) | const |
Check if the function is pure virtual.
void Puma::CFunctionInfo::isDestructor | ( | bool | v | ) | [inline] |
Set whether the function is a destructor.
v | true if the function is a destructor. |
void Puma::CFunctionInfo::isConstructor | ( | bool | v | ) | [inline] |
Set whether the function is a constructor.
v | true if the function is a constructor. |
void Puma::CFunctionInfo::isOperator | ( | bool | v | ) | [inline] |
Set whether the function is an overloaded operator.
v | true if the function is an overloaded operator. |
void Puma::CFunctionInfo::isConversion | ( | bool | v | ) | [inline] |
Set whether the function is a conversion function.
v | true if the function is a conversion function. |
bool Puma::CFunctionInfo::hasSameNameAndArgs | ( | const CFunctionInfo * | fi | ) | const |
Check if the given function has the same name and parameter types as this function.
fi | The function to compare with. |
bool Puma::CFunctionInfo::overridesVirtual | ( | ) | const |
Check if the function is a non-static member function and if in any of the base classes there is a function definition of a virtual function with the same name and argument types.