Poco::CppParser

class Function

Library: CppParser
Package: SymbolTable
Header: Poco/CppParser/Function.h

Description

This class represents a (member) function declaration.

Inheritance

Direct Base Classes: Decl

All Base Classes: Decl, Symbol

Member Summary

Member Functions: addParameter, begin, countParameters, end, flags, getOverridden, getReturnParameter, isConst, isConstructor, isDestructor, isFunction, isMethod, isVirtual, kind, makeConst, makeInline, makePureVirtual, signature, toString

Inherited Functions: addDocumentation, attrs, declaration, extractName, fullName, getAccess, getAttributes, getDocumentation, getFile, getLibrary, getLineNumber, getPackage, hasAttr, id, isIdent, isPrivate, isProtected, isPublic, kind, name, nameSpace, setAccess, setAttributes, setDocumentation, setFile, setLibrary, setLineNumber, setPackage, toString

Types

Iterator

typedef Parameters::const_iterator Iterator;

Parameters

typedef std::vector < Parameter * > Parameters;

Enumerations

Flags

FN_STATIC = 1

The function is static.

FN_VIRTUAL = 2

The function is virtual.

FN_INLINE = 4

The function is inline.

FN_CONST = 8

The function is const.

FN_TEMPLATE = 16

The function is a template.

FN_PURE_VIRTUAL = 32

The function is pure virtual.

Constructors

Function

Function(
    const std::string & decl,
    NameSpace * pNameSpace
);

Creates the Function.

Destructor

~Function virtual

~Function();

Destroys the Function.

Member Functions

addParameter

void addParameter(
    Parameter * pParam
);

Adds a parameter to the function.

begin

Iterator begin() const;

Returns an iterator for iterating over the Function's Parameter's.

countParameters

int countParameters() const;

Returns the number of parameters.

end

Iterator end() const;

Returns an iterator for iterating over the Function's Parameter's.

flags inline

int flags() const;

Returns the function's flags.

getOverridden

Function * getOverridden() const;

If the function is virtual and overrides a function in a base class, the base class function is returned. Otherwise, null is returned.

getReturnParameter inline

const std::string & getReturnParameter() const;

isConst inline

bool isConst() const;

Returns true iff the method is const.

isConstructor

bool isConstructor() const;

Returns true iff the function is a constructor.

isDestructor

bool isDestructor() const;

Returns true iff the function is a destructor.

isFunction

bool isFunction() const;

Returns true iff the function is not a member of a class (a freestanding function).

isMethod

bool isMethod() const;

Returns true iff the function is a method (it's part of a Struct and it's neither a constructor nor a destructor).

isVirtual

bool isVirtual() const;

Returns true if the method is virtual. Also examines base classes to check for a virtual function with the same signature.

kind

Symbol::Kind kind() const;

makeConst

void makeConst();

Sets the FN_CONST flag.

makeInline

void makeInline();

Sets the FN_INLINE flag.

makePureVirtual

void makePureVirtual();

Sets the FN_PURE_VIRTUAL flag.

signature

std::string signature() const;

Returns the signature of the function.

toString virtual

std::string toString() const;

See also: Poco::CppParser::Decl::toString()