• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

CPPCodeGenerator Class Reference

#include <cppcodegenerator.h>

Inheritance diagram for CPPCodeGenerator:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual void checkAddUMLObject (UMLObject *obj)
virtual void checkRemoveUMLObject (UMLObject *obj)
virtual void syncCodeToDocument ()

Public Member Functions

 CPPCodeGenerator ()
virtual ~CPPCodeGenerator ()
bool addHeaderCodeDocument (CPPHeaderCodeDocument *doc)
virtual void createDefaultStereotypes ()
QStringList defaultDatatypes ()
QString fixTypeName (const QString &name)
virtual CodeViewerDialog * getCodeViewerDialog (QWidget *parent, CodeDocument *doc, Settings::CodeViewerState state)
bool getCreateProjectMakefile ()
Uml::Programming_Language getLanguage ()
void initFromParentDocument ()
CodeDocument * newClassifierCodeDocument (UMLClassifier *classifier)
CPPHeaderCodeDocument * newHeaderClassifierCodeDocument (UMLClassifier *classifier)
bool removeHeaderCodeDocument (CPPHeaderCodeDocument *remove_object)
virtual const QStringList reservedKeywords () const
virtual void saveToXMI (QDomDocument &doc, QDomElement &root)
void setCreateProjectMakefile (bool buildIt)
virtual void writeCodeToFile (UMLClassifierList &list)
virtual void writeCodeToFile ()

Static Public Attributes

static const bool DEFAULT_BUILD_MAKEFILE = false

Protected Member Functions

CPPHeaderCodeDocument * findHeaderCodeDocumentByClassifier (UMLClassifier *classifier)
CPPMakefileCodeDocument * newMakefileCodeDocument ()

Detailed Description

Definition at line 26 of file cppcodegenerator.h.


Constructor & Destructor Documentation

CPPCodeGenerator::CPPCodeGenerator (  ) 

Basic Constructor.

Definition at line 37 of file cppcodegenerator.cpp.

CPPCodeGenerator::~CPPCodeGenerator (  )  [virtual]

Destructor.

Definition at line 45 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 87 of file cppcodegenerator.cpp.

void CPPCodeGenerator::checkAddUMLObject ( UMLObject *  obj  )  [virtual, slot]

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

Reimplemented from CodeGenerator.

Definition at line 336 of file cppcodegenerator.cpp.

void CPPCodeGenerator::checkRemoveUMLObject ( UMLObject *  obj  )  [virtual, slot]

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

Reimplemented from CodeGenerator.

Definition at line 363 of file cppcodegenerator.cpp.

void CPPCodeGenerator::createDefaultStereotypes (  )  [virtual]

Add the default stereotypes for c++ (constructor, int etc).

Reimplemented from CodeGenerator.

Definition at line 417 of file cppcodegenerator.cpp.

QStringList CPPCodeGenerator::defaultDatatypes (  )  [virtual]

Add C++ primitives as datatypes.

Returns:
a string list of C++ datatypes

Reimplemented from CodeGenerator.

Definition at line 400 of file cppcodegenerator.cpp.

CPPHeaderCodeDocument * CPPCodeGenerator::findHeaderCodeDocumentByClassifier ( UMLClassifier *  classifier  )  [protected]

Find a cppheadercodedocument by the given classifier.

Parameters:
classifier UML classifier
Returns:
CPPHeaderCodeDocument object

Definition at line 259 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 168 of file cppcodegenerator.cpp.

CodeViewerDialog * CPPCodeGenerator::getCodeViewerDialog ( QWidget *  parent,
CodeDocument *  doc,
Settings::CodeViewerState  state 
) [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 131 of file cppcodegenerator.cpp.

bool CPPCodeGenerator::getCreateProjectMakefile (  ) 

Get the value of m_createMakefile.

Returns:
the value of m_createMakefile

Definition at line 77 of file cppcodegenerator.cpp.

Uml::Programming_Language CPPCodeGenerator::getLanguage (  )  [virtual]

Returns language identifier.

In this case "Cpp".

Returns:
language identifier

Implements CodeGenerator.

Definition at line 56 of file cppcodegenerator.cpp.

void CPPCodeGenerator::initFromParentDocument (  )  [virtual]

Overloaded so that we may have both source and header documents for each classifier.

Reimplemented from CodeGenerator.

Definition at line 302 of file cppcodegenerator.cpp.

CodeDocument * CPPCodeGenerator::newClassifierCodeDocument ( UMLClassifier *  classifier  )  [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 270 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 282 of file cppcodegenerator.cpp.

CPPMakefileCodeDocument * CPPCodeGenerator::newMakefileCodeDocument (  )  [protected]

Create a new CPPMakefileCodeDocument.

Returns:
CPPMakefileCodeDocument object

Definition at line 293 of file cppcodegenerator.cpp.

bool CPPCodeGenerator::removeHeaderCodeDocument ( CPPHeaderCodeDocument *  remove_object  ) 

Remove a header CodeDocument object from m_headercodedocumentVector List.

Definition at line 110 of file cppcodegenerator.cpp.

const QStringList CPPCodeGenerator::reservedKeywords (  )  const [virtual]

Get list of reserved keywords.

Returns:
a string list with reserve keywords of this language

Reimplemented from CodeGenerator.

Definition at line 409 of file cppcodegenerator.cpp.

void CPPCodeGenerator::saveToXMI ( QDomDocument &  doc,
QDomElement &  root 
) [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 179 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 65 of file cppcodegenerator.cpp.

void CPPCodeGenerator::syncCodeToDocument (  )  [virtual, slot]

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.

Reimplemented from CodeGenerator.

Definition at line 204 of file cppcodegenerator.cpp.

void CPPCodeGenerator::writeCodeToFile ( UMLClassifierList &  concepts  )  [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 238 of file cppcodegenerator.cpp.

void CPPCodeGenerator::writeCodeToFile (  )  [virtual]

Write out all code documents to file as appropriate.

Reimplemented from CodeGenerator.

Definition at line 222 of file cppcodegenerator.cpp.


Member Data Documentation

const bool CPPCodeGenerator::DEFAULT_BUILD_MAKEFILE = false [static]

Definition at line 31 of file cppcodegenerator.h.


The documentation for this class was generated from the following files:
  • cppcodegenerator.h
  • cppcodegenerator.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal