Poco::CodeGeneration

class MethodPropertyFilter

File Information

Library: CodeGeneration
Package: CodeGeneration
Header: Poco/CodeGeneration/MethodPropertyFilter.h

Description

A MethodPropertyFilter filters methods according to properties. It works as a decorator, checking if a property is set at the method. If not it will simply ignore all method calls related to that method. It will not filter variables, includes, only methods excl. constructor and destructor are checked.

Inheritance

Direct Base Classes: CodeGenerator

All Base Classes: CodeGenerator

Member Summary

Member Functions: addFwdDecl, addIncludeFile, addSystemIncludeFile, copyright, endFile, includes, libraryName, methodEnd, methodStart, nameSpace, structEnd, structStart, systemIncludes, usePocoIncludeStyle, variable, variablesEnd, variablesStart, writeDefaultHeader, writeFwdDecls, writeImplementation, writeInclude, writeIncludes, writeMethodImplementation, writeNameSpaceBegin, writeNameSpaceEnd, writeSystemInclude, writeTypeDef, writeUsing

Inherited Functions: addFwdDecl, addIncludeFile, addSrcIncludeFile, addSystemIncludeFile, copyright, endFile, includes, libraryName, methodEnd, methodStart, nameSpace, structEnd, structStart, systemIncludes, usePocoIncludeStyle, variable, variablesEnd, variablesStart, writeDefaultHeader, writeFwdDecls, writeImplementation, writeInclude, writeIncludes, writeMethodImplementation, writeNameSpaceBegin, writeNameSpaceEnd, writeSystemInclude, writeTypeDef, writeUsing

Constructors

MethodPropertyFilter

MethodPropertyFilter(
    CodeGenerator * pGen,
    const CodeGenerator::Properties & properties
);

Creates a MethodPropertyFilter decorating another CodeGenerator. Takes ownership of the pointer which must not be 0. properties contains the properties that each method must match to be generated.

MethodPropertyFilter

MethodPropertyFilter(
    CodeGenerator * pGen,
    const std::string & prop
);

Creates a MethodPropertyFilter decorating another CodeGenerator. Takes ownership of the pointer which must not be 0. Convenience constructor which takes exactly one property.

Destructor

~MethodPropertyFilter virtual

~MethodPropertyFilter();

Destroys the MethodPropertyFilter.

Member Functions

addFwdDecl virtual inline

void addFwdDecl(
    const std::string & inclFile,
    const std::string & className,
    const std::string namespacePrefix
);

Adds a fwd decl.

addIncludeFile virtual inline

void addIncludeFile(
    const std::string & incFile
);

Adds an include file to the CodeGenerator. A call to this method is only meaningful until structStart was not called. Duplicate includes will be ignored. Contains the include path only, e.g. "include/MyClass.h" (without enclosing ")

addSystemIncludeFile virtual inline

void addSystemIncludeFile(
    const std::string & incFile
);

Adds a system include file.

copyright virtual inline

const std::string & copyright() const;

endFile virtual inline

void endFile();

includes virtual inline

const CodeGenerator::IncludeSet & includes() const;

libraryName virtual inline

const std::string & libraryName() const;

methodEnd virtual

void methodEnd(
    const Poco::CppParser::Function * pFunc,
    const CodeGenerator::Properties & properties
);

methodStart virtual

void methodStart(
    const Poco::CppParser::Function * pFunc,
    const CodeGenerator::Properties & properties
);

nameSpace virtual inline

const std::string & nameSpace() const;

structEnd virtual inline

void structEnd();

structStart virtual inline

void structStart(
    const Poco::CppParser::Struct * pStruct,
    const CodeGenerator::Properties & properties
);

systemIncludes virtual inline

const CodeGenerator::IncludeSet & systemIncludes() const;

usePocoIncludeStyle virtual inline

bool usePocoIncludeStyle() const;

variable virtual inline

void variable(
    const Poco::CppParser::Variable * pVar
);

variablesEnd virtual inline

void variablesEnd();

variablesStart virtual inline

void variablesStart();

writeDefaultHeader virtual inline

void writeDefaultHeader(
    const Poco::CppParser::Struct * pStruct,
    const std::string & className,
    const std::string & libraryName,
    const std::string & package
);

Writes the default header, e.g. copyright notice, no include namespace open or anything else is written This is always the first method that is called!

writeFwdDecls inline

void writeFwdDecls(
    const CodeGenerator::FwdDecls & decl
);

writeImplementation virtual inline

void writeImplementation(
    const std::string & code
);

writeInclude virtual inline

void writeInclude(
    const std::string & include,
    bool toHeader
);

writeIncludes virtual inline

void writeIncludes();

Convenience Functions which calls for all include files writeInclude, also writes fwdDecls.

writeMethodImplementation virtual

void writeMethodImplementation(
    const std::string & code
);

writeNameSpaceBegin virtual inline

void writeNameSpaceBegin(
    const std::string & ns
);

writeNameSpaceEnd virtual inline

void writeNameSpaceEnd(
    const std::string & ns
);

writeSystemInclude virtual inline

void writeSystemInclude(
    const std::string & include
);

writeTypeDef virtual inline

void writeTypeDef(
    const Poco::CppParser::TypeDef * pType
);

writeUsing virtual inline

void writeUsing(
    const Poco::CppParser::TypeAlias * pType
);

Securely control IoT edge devices from anywhere   Connect a Device