Puma Reference Manual Puma: Puma::CFunctionInfo Class Reference



Puma::CFunctionInfo Class Reference

Semantic information about a function, method, overloaded operator, or user conversion function. More...

#include <Puma/CFunctionInfo.h>

Inheritance diagram for Puma::CFunctionInfo:
Inheritance graph

List of all members.

Public Member Functions

 CFunctionInfo ()
 Constructor.
 ~CFunctionInfo ()
 Destructor.
CFunctionInfoDefObject () const
 Get the semantic object of the function definition.
CTypeFunctionTypeInfo () const
 Get the type information for the function.
CTypeInfoConversionType () const
 Get the conversion type if this is a conversion function.
CTypeInfoReturnType () const
 Get the return type of the function.
CTemplateInfoTemplateInfo () const
 Get the template information if this is a function template.
CRecordRecord () const
 Get the class or union if this is a method of a class or union.
CNamespaceInfoNamespace () 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.
CLabelInfoLabel (unsigned n) const
 Get the n-th jump label.
CLabelInfoLabel (const char *name) const
 Get the jump label with the given name.
CArgumentInfoArgument (unsigned n) const
 Get the n-th function parameter.
CArgumentInfoArgument (const char *name) const
 Get the function parameter with the given name.
CTreeDefaultArgument (unsigned n) const
 Get the default argument of the n-th function parameter.
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.
CArgumentInfonewArgument ()
 Create a new function parameter.
CLabelInfonewLabel ()
 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.
bool isDefaultConstructor () const
 Check if this is a default constructor.
bool isCopyConstructor () const
 Check if this is a copy constructor.
bool isCopyAssignOperator () const
 Check if this is a copy assignment operator.
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.

Detailed Description

Semantic information about a function, method, overloaded operator, or user conversion function.


Constructor & Destructor Documentation

Puma::CFunctionInfo::CFunctionInfo ( ObjectId  id) [inline, protected]

Constructor.

Parameters:
idThe object type.
Puma::CFunctionInfo::CFunctionInfo ( ) [inline]

Constructor.

Puma::CFunctionInfo::~CFunctionInfo ( )

Destructor.

If the object type is CObjectInfo::FUNCTION_INFO, then CObjectInfo::CleanUp() is called.


Member Function Documentation

void Puma::CFunctionInfo::addArgument ( CArgumentInfo info)

Add a function parameter.

Parameters:
infoThe function parameter.
void Puma::CFunctionInfo::addLabel ( CLabelInfo label)

Add a jump label.

Parameters:
labelThe jump label.
CArgumentInfo * Puma::CFunctionInfo::Argument ( unsigned  n) const [inline]

Get the n-th function parameter.

Parameters:
nThe index of the function parameter.
Returns:
The function parameter or NULL if n is invalid.
CArgumentInfo* Puma::CFunctionInfo::Argument ( const char *  name) const

Get the function parameter with the given name.

Parameters:
nameThe name of the function parameter.
Returns:
The function parameter or NULL if no such parameter.
unsigned Puma::CFunctionInfo::Arguments ( ) const [inline]

Get the number of function parameters.

CTypeInfo * Puma::CFunctionInfo::ConversionType ( ) const [inline]

Get the conversion type if this is a conversion function.

Returns:
The conversion type or NULL if not a conversion function.
void Puma::CFunctionInfo::ConversionType ( CTypeInfo type) [inline]

Set the conversion type of a conversion function.

Parameters:
typeThe conversion type.
CTree* Puma::CFunctionInfo::DefaultArgument ( unsigned  n) const

Get the default argument of the n-th function parameter.

Parameters:
nThe index of the function parameter.
Returns:
The syntax tree node of the default argument or NULL if the n-th parameter has no default argument.
CFunctionInfo* Puma::CFunctionInfo::DefObject ( ) const

Get the semantic object of the function definition.

See also:
CObjectInfo::DefObject()

Reimplemented from Puma::CObjectInfo.

void Puma::CFunctionInfo::deleteArgument ( const CArgumentInfo info)

Remove and destroy the given function parameter.

Parameters:
infoThe function parameter.
void Puma::CFunctionInfo::deleteLabel ( const CLabelInfo info)

Remove and destroy the given jump label.

Parameters:
infoThe jump label.
bool Puma::CFunctionInfo::hasDefaultArgument ( unsigned  n) const

Check if the n-th function parameter has a default argument.

Parameters:
nThe index of the function parameter.
bool Puma::CFunctionInfo::hasEllipsis ( ) const

Check if the function accepts a variable argument list.

bool Puma::CFunctionInfo::hasSameNameAndArgs ( const CFunctionInfo fi) const

Check if the given function has the same name and parameter types as this function.

Parameters:
fiThe function to compare with.
bool Puma::CFunctionInfo::isConstructor ( ) const [inline]

Check if this is a constructor.

void Puma::CFunctionInfo::isConstructor ( bool  v) [inline]

Set whether the function is a constructor.

Parameters:
vtrue if the function is a constructor.
bool Puma::CFunctionInfo::isConversion ( ) const [inline]

Check if this is a conversion function.

void Puma::CFunctionInfo::isConversion ( bool  v) [inline]

Set whether the function is a conversion function.

Parameters:
vtrue if the function is a conversion function.
bool Puma::CFunctionInfo::isCopyAssignOperator ( ) const

Check if this is a copy assignment operator.

bool Puma::CFunctionInfo::isCopyConstructor ( ) const

Check if this is a copy constructor.

bool Puma::CFunctionInfo::isDefaultConstructor ( ) const

Check if this is a default constructor.

bool Puma::CFunctionInfo::isDefined ( ) const

Check if the function is defined.

bool Puma::CFunctionInfo::isDestructor ( ) const [inline]

Check if this is a destructor.

void Puma::CFunctionInfo::isDestructor ( bool  v) [inline]

Set whether the function is a destructor.

Parameters:
vtrue if the function is a destructor.
bool Puma::CFunctionInfo::isFctDef ( ) const

Check if this is a function definition.

bool Puma::CFunctionInfo::isMethod ( ) const [inline]

Check if this is a method of a class or union.

Reimplemented from Puma::CScopeInfo.

bool Puma::CFunctionInfo::isOperator ( ) const [inline]

Check if this is an overloaded operator.

void Puma::CFunctionInfo::isOperator ( bool  v) [inline]

Set whether the function is an overloaded operator.

Parameters:
vtrue if the function is an overloaded operator.
bool Puma::CFunctionInfo::isPureVirtual ( ) const

Check if the function is pure virtual.

bool Puma::CFunctionInfo::isStaticMethod ( ) const [inline]

Check if this is a static method of a class or union.

bool Puma::CFunctionInfo::isTemplate ( ) const [inline]

Check if this is a function template.

Reimplemented from Puma::CObjectInfo.

void Puma::CFunctionInfo::isTemplate ( bool  v) [inline]

Set whether the function is a function template.

Parameters:
vtrue if the function is a template.
CLabelInfo* Puma::CFunctionInfo::Label ( const char *  name) const

Get the jump label with the given name.

Parameters:
nameThe name of the jump label.
Returns:
The label or NULL if no such label.
CLabelInfo * Puma::CFunctionInfo::Label ( unsigned  n) const [inline]

Get the n-th jump label.

Parameters:
nThe index of the jump label.
Returns:
The label or NULL if n is invalid.
unsigned Puma::CFunctionInfo::Labels ( ) const [inline]

Get the number of jump labels defined in the function body.

CNamespaceInfo* Puma::CFunctionInfo::Namespace ( ) const

Get the namespace if this function is declared in a namespace.

Returns:
The namespace or NULL if not declared in a namespace.
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.

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.

void Puma::CFunctionInfo::QualifiedScope ( CStructure scope) [inline]

Set the qualification scope of a class/union method or function declared in a namespace.

Parameters:
scopeThe qualification scope.
CRecord* Puma::CFunctionInfo::Record ( ) const

Get the class or union if this is a method of a class or union.

Returns:
The class/union or NULL if not a method.

Reimplemented from Puma::CObjectInfo.

void Puma::CFunctionInfo::removeArgument ( const CArgumentInfo info)

Remove the given function parameter.

Parameters:
infoThe function parameter.
void Puma::CFunctionInfo::removeLabel ( const CLabelInfo label)

Remove the given jump label.

Parameters:
labelThe jump label.
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.

Returns:
The template information or NULL if not a function template.

Reimplemented from Puma::CObjectInfo.

void Puma::CFunctionInfo::TemplateInfo ( CTemplateInfo info) [inline]

Set the template information of a function template.

Parameters:
infoThe template information.
CTypeFunction * Puma::CFunctionInfo::TypeInfo ( ) const [inline]

Get the type information for the function.

Reimplemented from Puma::CObjectInfo.