Poco::CodeGeneration

class CppGenerator

File Information

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

Description

Cpp implementation of the code generator

Inheritance

Direct Base Classes: CodeGenerator

All Base Classes: CodeGenerator

Member Summary

Member Functions: enableAttributes, enableTimestamps, endFile, methodEnd, methodStart, registerConstructorHint, structEnd, structStart, variable, variablesEnd, variablesStart, writeDefaultHeader, writeFwdDecls, writeImplementation, writeInclude, writeMethodImplementation, writeNameSpaceBegin, writeNameSpaceEnd, writeSrcInclude, writeSystemInclude, writeToHeader, 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

CppGenerator

CppGenerator(
    const std::string & nameSpace,
    const std::string & libraryName,
    bool usePocoIncludeStyle,
    const std::string & copyright,
    std::ostream & hOut,
    std::ostream & cppOut
);

Creates the CppGenerator.

Destructor

~CppGenerator virtual

~CppGenerator();

Destroys the CppGenerator.

Member Functions

enableAttributes

void enableAttributes(
    bool enable = true
);

Enable or disable (default) writing of attributes.

enableTimestamps

void enableTimestamps(
    bool enable = true
);

Enable (default) or disable timestamps in file headers.

endFile virtual

void endFile();

Closes the include guard

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
);

registerConstructorHint inline

void registerConstructorHint(
    const Poco::CppParser::Variable * pVar,
    const Poco::CppParser::Parameter * pParam
);

Register a hint which tells us which parameter of the constructor should be used to init a given member variable

registerConstructorHint

void registerConstructorHint(
    const Poco::CppParser::Variable * pVar,
    const std::string & val
);

Register a hint which tells us which constant value should be used to init a given member variable.

structEnd virtual

void structEnd();

structStart virtual

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

variable virtual

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

variablesEnd virtual

void variablesEnd();

variablesStart virtual

void variablesStart();

writeDefaultHeader virtual

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

Writes the default header, plus include guard

writeFwdDecls

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

writeImplementation virtual

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

writeInclude virtual

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

writeMethodImplementation virtual

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

writeNameSpaceBegin virtual

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

writeNameSpaceEnd virtual

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

writeSrcInclude

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

writeSystemInclude virtual

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

writeToHeader inline

void writeToHeader(
    const std::string & jsCode
);

writeTypeDef virtual

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

writeUsing virtual

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