#include <cppcodegenerator.h>
|
enum | GenerationState { Generated
, Failed
, Skipped
} |
|
void | codeGenerated (UMLClassifier *concept, bool generated) |
|
void | codeGenerated (UMLClassifier *concept, CodeGenerator::GenerationState result) |
|
void | showGeneratedFile (const QString &filename) |
|
static QString | cleanName (const QString &name) |
|
static QString | formatDoc (const QString &text, const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80) |
|
static QString | formatFullDocBlock (const QString &text, const QString &blockHeader=QStringLiteral("/* "), const QString &blockFooter=QStringLiteral(" */"), const QString &linePrefix=QStringLiteral(" *"), int lineWidth=80) |
|
static QString | formatSourceCode (const QString &code, const QString &indentation) |
|
static void | findObjectsRelated (UMLClassifier *c, UMLPackageList &cList) |
|
QHash< QString, CodeDocument * > | m_codeDocumentDictionary |
|
bool | m_applyToAllRemaining |
|
UMLDoc * | m_document |
|
◆ CPPCodeGenerator()
CPPCodeGenerator::CPPCodeGenerator |
( |
| ) |
|
◆ ~CPPCodeGenerator()
CPPCodeGenerator::~CPPCodeGenerator |
( |
| ) |
|
|
virtual |
◆ addHeaderCodeDocument()
Add a header CodeDocument object from m_headercodedocumentVector List
- Parameters
-
doc | the header code document |
- Returns
- success status
◆ checkAddUMLObject
void CPPCodeGenerator::checkAddUMLObject |
( |
UMLObject * |
obj | ) |
|
|
virtualslot |
Check for adding objects to the UMLDocument. They are need to be overridden here because unlike in the Java (or most other lang) we add 2 types of classifiercodedocument per classifier, e.g. a "source" and a "header" document. Need to worry about adding both source, and header documents for each classifier.
- Parameters
-
◆ checkRemoveUMLObject
void CPPCodeGenerator::checkRemoveUMLObject |
( |
UMLObject * |
obj | ) |
|
|
virtualslot |
Check for removing objects to the UMLDocument. they are need to be overridden here because unlike in the Java (or most other lang) we add 2 types of classifiercodedocument per classifier, e.g. a "source" and a "header" document. Need to worry about removing both source, and header documents for each classifier.
- Parameters
-
◆ createDefaultStereotypes()
void CPPCodeGenerator::createDefaultStereotypes |
( |
| ) |
|
|
virtual |
Add the default stereotypes for c++ (constructor, int etc)
Reimplemented from CodeGenerator.
◆ defaultDatatypes()
QStringList CPPCodeGenerator::defaultDatatypes |
( |
| ) |
const |
|
virtual |
Add C++ primitives as datatypes.
- Returns
- a string list of C++ datatypes
Reimplemented from CodeGenerator.
◆ findHeaderCodeDocumentByClassifier()
◆ fixTypeName()
QString CPPCodeGenerator::fixTypeName |
( |
const QString & |
name | ) |
|
Change the following dataTypes to the ones the user really wants in their code. Not yet complete.
- Parameters
-
- Returns
- clean name
◆ getCodeViewerDialog()
Get the editing dialog for this code document. In the C++ version, we need to make both source and header files as well as the makefile available.
- Parameters
-
parent | the parent widget |
doc | the code document |
state | the code viewer state |
- Returns
- the code viewer dialog object
Reimplemented from AdvancedCodeGenerator.
◆ getCreateProjectMakefile()
bool CPPCodeGenerator::getCreateProjectMakefile |
( |
| ) |
|
Get the value of m_createMakefile
- Returns
- the value of m_createMakefile
◆ initFromParentDocument()
void CPPCodeGenerator::initFromParentDocument |
( |
| ) |
|
|
virtual |
Overloaded so that we may have both source and header documents for each classifier.
Reimplemented from AdvancedCodeGenerator.
◆ language()
Returns language identifier. In this case "Cpp".
- Returns
- language identifier
Implements CodeGenerator.
◆ newClassifierCodeDocument()
◆ newHeaderClassifierCodeDocument()
Generate header classifier code document.
- Parameters
-
classifier | the classifier for which the CodeDocument is to be created |
- Returns
- created CPPHeaderCodeDocument object
◆ newMakefileCodeDocument()
◆ removeHeaderCodeDocument()
Remove a header CodeDocument object from m_headercodedocumentVector List
◆ reservedKeywords()
QStringList CPPCodeGenerator::reservedKeywords |
( |
| ) |
const |
|
virtual |
Get list of reserved keywords.
- Returns
- a string list with reserve keywords of this language
Reimplemented from CodeGenerator.
◆ saveToXMI()
void CPPCodeGenerator::saveToXMI |
( |
QXmlStreamWriter & |
writer | ) |
|
|
virtual |
Save the XMI representation of this object. Special method needed so that we write out the header code documents.
- Parameters
-
writer | QXmlStreamWriter serialization target |
Reimplemented from CodeGenerator.
◆ setCreateProjectMakefile()
void CPPCodeGenerator::setCreateProjectMakefile |
( |
bool |
buildIt | ) |
|
Set the value of m_createMakefile
- Parameters
-
buildIt | the new value to set for creating makefile |
◆ syncCodeToDocument
void CPPCodeGenerator::syncCodeToDocument |
( |
| ) |
|
|
virtualslot |
Force a synchronize of this code generator, and its present contents, to that of the parent UMLDocument. "UserGenerated" code will be preserved, but Autogenerated contents will be updated/replaced or removed as is apppropriate. Need to override parent method because we have header documents to consider too.
◆ writeCodeToFile() [1/2]
void CPPCodeGenerator::writeCodeToFile |
( |
| ) |
|
|
virtual |
Write out all code documents to file as appropriate.
Reimplemented from CodeGenerator.
◆ writeCodeToFile() [2/2]
this method is here to provide class wizard the ability to write out only those classes which are selected by the user. overridden because we need to be able to generate code for both the header and source documents
Reimplemented from CodeGenerator.
◆ DEFAULT_BUILD_MAKEFILE
const bool CPPCodeGenerator::DEFAULT_BUILD_MAKEFILE = false |
|
static |
◆ m_createMakefile
bool CPPCodeGenerator::m_createMakefile |
|
private |
◆ m_headercodedocumentVector
The documentation for this class was generated from the following files: