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
Destroys the MethodPropertyFilter.
Member Functions
addFwdDecl
void addFwdDecl(
const std::string & inclFile,
const std::string & className,
const std::string namespacePrefix
);
Adds a fwd decl.
addIncludeFile
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
void addSystemIncludeFile(
const std::string & incFile
);
Adds a system include file.
copyright
const std::string & copyright() const;
endFile
void endFile();
includes
const CodeGenerator::IncludeSet & includes() const;
libraryName
const std::string & libraryName() const;
methodEnd
void methodEnd(
const Poco::CppParser::Function * pFunc,
const CodeGenerator::Properties & properties
);
methodStart
void methodStart(
const Poco::CppParser::Function * pFunc,
const CodeGenerator::Properties & properties
);
nameSpace
const std::string & nameSpace() const;
structEnd
void structEnd();
structStart
void structStart(
const Poco::CppParser::Struct * pStruct,
const CodeGenerator::Properties & properties
);
systemIncludes
const CodeGenerator::IncludeSet & systemIncludes() const;
usePocoIncludeStyle
bool usePocoIncludeStyle() const;
variable
void variable(
const Poco::CppParser::Variable * pVar
);
variablesEnd
void variablesEnd();
variablesStart
void variablesStart();
writeDefaultHeader
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
void writeFwdDecls(
const CodeGenerator::FwdDecls & decl
);
writeImplementation
void writeImplementation(
const std::string & code
);
writeInclude
void writeInclude(
const std::string & include,
bool toHeader
);
writeIncludes
void writeIncludes();
Convenience Functions which calls for all include files writeInclude, also writes fwdDecls.
writeMethodImplementation
void writeMethodImplementation(
const std::string & code
);
writeNameSpaceBegin
void writeNameSpaceBegin(
const std::string & ns
);
writeNameSpaceEnd
void writeNameSpaceEnd(
const std::string & ns
);
writeSystemInclude
void writeSystemInclude(
const std::string & include
);
writeTypeDef
void writeTypeDef(
const Poco::CppParser::TypeDef * pType
);
writeUsing
void writeUsing(
const Poco::CppParser::TypeAlias * pType
);