umbrello/umbrello
#include <cppcodegenerator.h>
Public Slots | |
virtual void | checkAddUMLObject (UMLObject *obj) |
virtual void | checkRemoveUMLObject (UMLObject *obj) |
virtual void | syncCodeToDocument () |
Public Slots inherited from CodeGenerator | |
virtual void | checkAddUMLObject (UMLObject *obj) |
virtual void | checkRemoveUMLObject (UMLObject *obj) |
virtual void | syncCodeToDocument () |
Static Public Attributes | |
static const bool | DEFAULT_BUILD_MAKEFILE = false |
Protected Member Functions | |
CPPHeaderCodeDocument * | findHeaderCodeDocumentByClassifier (UMLClassifier *classifier) |
CPPMakefileCodeDocument * | newMakefileCodeDocument () |
Protected Member Functions inherited from CodeGenerator | |
bool | openFile (QFile &file, const QString &name) |
QString | overwritableName (const QString &name, const QString &extension) |
void | writeListedCodeDocsToFile (CodeDocumentList *docs) |
Additional Inherited Members | |
Signals inherited from CodeGenerator | |
void | codeGenerated (UMLClassifier *concept, bool generated) |
void | showGeneratedFile (const QString &filename) |
Static Public Member Functions inherited from CodeGenerator | |
static QString | cleanName (const QString &name) |
static void | findObjectsRelated (UMLClassifier *c, UMLPackageList &cList) |
static QString | formatDoc (const QString &text, const QString &linePrefix=" *", int lineWidth=80) |
static QString | formatSourceCode (const QString &code, const QString &indentation) |
Protected Attributes inherited from CodeGenerator | |
bool | m_applyToAllRemaining |
QHash< QString, CodeDocument * > | m_codeDocumentDictionary |
UMLDoc * | m_document |
Detailed Description
Definition at line 26 of file cppcodegenerator.h.
Constructor & Destructor Documentation
CPPCodeGenerator::CPPCodeGenerator | ( | ) |
Basic Constructor.
Definition at line 36 of file cppcodegenerator.cpp.
|
virtual |
Destructor.
Definition at line 49 of file cppcodegenerator.cpp.
Member Function Documentation
bool CPPCodeGenerator::addHeaderCodeDocument | ( | CPPHeaderCodeDocument * | doc | ) |
Add a header CodeDocument object from m_headercodedocumentVector List.
- Parameters
-
doc the header code document
- Returns
- success status
Definition at line 92 of file cppcodegenerator.cpp.
|
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
-
obj the UML object
Definition at line 340 of file cppcodegenerator.cpp.
|
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
-
obj the UML object
Definition at line 367 of file cppcodegenerator.cpp.
|
virtual |
Add the default stereotypes for c++ (constructor, int etc)
Reimplemented from CodeGenerator.
Definition at line 408 of file cppcodegenerator.cpp.
|
virtual |
Add C++ primitives as datatypes.
- Returns
- a string list of C++ datatypes
Reimplemented from CodeGenerator.
Definition at line 391 of file cppcodegenerator.cpp.
|
protected |
Find a cppheadercodedocument by the given classifier.
- Parameters
-
classifier UML classifier
- Returns
- CPPHeaderCodeDocument object
Definition at line 263 of file cppcodegenerator.cpp.
QString CPPCodeGenerator::fixTypeName | ( | const QString & | name | ) |
Change the following dataTypes to the ones the user really wants in their code.
Not yet complete.
- Parameters
-
name type name
- Returns
- clean name
Definition at line 172 of file cppcodegenerator.cpp.
|
virtual |
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 CodeGenerator.
Definition at line 135 of file cppcodegenerator.cpp.
bool CPPCodeGenerator::getCreateProjectMakefile | ( | ) |
Get the value of m_createMakefile.
- Returns
- the value of m_createMakefile
Definition at line 82 of file cppcodegenerator.cpp.
|
virtual |
Overloaded so that we may have both source and header documents for each classifier.
Reimplemented from CodeGenerator.
Definition at line 306 of file cppcodegenerator.cpp.
|
virtual |
Returns language identifier.
In this case "Cpp".
- Returns
- language identifier
Implements CodeGenerator.
Definition at line 60 of file cppcodegenerator.cpp.
|
virtual |
Generate classifier code document (source document version).
- Parameters
-
classifier the classifier for which the CodeDocument is to be created
- Returns
- created ClassifierCodeDocument object
Implements CodeGenerator.
Definition at line 274 of file cppcodegenerator.cpp.
CPPHeaderCodeDocument * CPPCodeGenerator::newHeaderClassifierCodeDocument | ( | UMLClassifier * | classifier | ) |
Generate header classifier code document.
- Parameters
-
classifier the classifier for which the CodeDocument is to be created
- Returns
- created CPPHeaderCodeDocument object
Definition at line 286 of file cppcodegenerator.cpp.
|
protected |
Create a new CPPMakefileCodeDocument.
- Returns
- CPPMakefileCodeDocument object
Definition at line 297 of file cppcodegenerator.cpp.
bool CPPCodeGenerator::removeHeaderCodeDocument | ( | CPPHeaderCodeDocument * | remove_object | ) |
Remove a header CodeDocument object from m_headercodedocumentVector List.
Definition at line 114 of file cppcodegenerator.cpp.
|
virtual |
Get list of reserved keywords.
- Returns
- a string list with reserve keywords of this language
Reimplemented from CodeGenerator.
Definition at line 400 of file cppcodegenerator.cpp.
|
virtual |
Save the XMI representation of this object.
Special method needed so that we write out the header code documents.
- Parameters
-
doc the document root the root element
Reimplemented from CodeGenerator.
Definition at line 183 of file cppcodegenerator.cpp.
void CPPCodeGenerator::setCreateProjectMakefile | ( | bool | buildIt | ) |
Set the value of m_createMakefile.
- Parameters
-
buildIt the new value to set for creating makefile
Definition at line 69 of file cppcodegenerator.cpp.
|
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.
Definition at line 208 of file cppcodegenerator.cpp.
|
virtual |
Write out all code documents to file as appropriate.
Reimplemented from CodeGenerator.
Definition at line 226 of file cppcodegenerator.cpp.
|
virtual |
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.
Definition at line 242 of file cppcodegenerator.cpp.
Member Data Documentation
|
static |
Definition at line 31 of file cppcodegenerator.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.