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, makeDefault, makeDelete, makeFinal, makeInline, makeNoexcept, makeOverride, 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.

FN_FINAL = 64

The function is final.

FN_OVERRIDE = 128

The function is override.

FN_NOEXCEPT = 256

The function is noexcept.

FN_DEFAULT = 512

The function is default.

FN_DELETE = 1024

The function has been deleted.

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 if and only if the method is const.

isConstructor

bool isConstructor() const;

Returns true if and only if the function is a constructor.

isDestructor

bool isDestructor() const;

Returns true if and only if the function is a destructor.

isFunction

bool isFunction() const;

Returns true if and only if the function is not a member of a class (a freestanding function).

isMethod

bool isMethod() const;

Returns true if and only if 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.

makeDefault

void makeDefault();

Sets the FN_DEFAULT flag.

makeDelete

void makeDelete();

Sets the FN_DELETE flag.

makeFinal

void makeFinal();

Sets the FN_FINAL flag.

makeInline

void makeInline();

Sets the FN_INLINE flag.

makeNoexcept

void makeNoexcept();

Sets the FN_NOEXCEPT flag.

makeOverride

void makeOverride();

Sets the FN_OVERRIDE 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;

Securely control IoT edge devices from anywhere   Connect a Device