umbrello: AdaWriter Class Reference

umbrello 2.39.1 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AdaWriter Class Reference

`#include <adawriter.h>`

Inheritance diagram for AdaWriter:

## Public Member Functions
| AdaWriter ()
virtual | ~AdaWriter ()
virtual void | writeClass (UMLClassifier *c)
virtual Uml::ProgrammingLanguage::Enum | language () const
QStringList | defaultDatatypes () const
virtual bool | isReservedKeyword (const QString &rPossiblyReservedKeyword)
virtual QStringList | reservedKeywords () const
Public Member Functions inherited from SimpleCodeGenerator
| SimpleCodeGenerator (bool createDirHierarchyForPackages=true)
virtual | ~SimpleCodeGenerator ()
void | writeCodeToFile (UMLClassifierList &concepts)
void | writeCodeToFile ()
Public Member Functions inherited from CodeGenerator
| CodeGenerator ()
virtual | ~CodeGenerator ()
bool | addCodeDocument (CodeDocument *add_object)
bool | removeCodeDocument (CodeDocument *remove_object)
CodeDocumentList * | getCodeDocumentList ()
QString | getUniqueID (CodeDocument *codeDoc)
virtual void | saveToXMI (QXmlStreamWriter &writer)
CodeDocument * | findCodeDocumentByID (const QString &id)
void | setIncludeHeadings (bool i)
bool | includeHeadings () const
void | setHeadingFileDir (const QString &)
QString | headingFileDir () const
void | setForceDoc (bool f)
bool | forceDoc () const
void | setSectionCommentPolicy (CodeGenerationPolicy::WriteSectionCommentsPolicy f)
bool | forceSections () const
virtual QString | getHeadingFile (const QString &file)
QString | findFileName (CodeDocument *codeDocument)
virtual void | loadFromXMI (QDomElement &element)
CodeDocument * | findCodeDocumentByClassifier (UMLClassifier *classifier)
virtual void | createDefaultStereotypes ()

## Private Types
typedef QMap< QString, QFile * > | PackageFileMap

## Private Member Functions
void | declareClass (UMLClassifier *c, QTextStream &ada)
void | writeOperation (UMLOperation *op, QTextStream &ada, bool is_comment=false)
void | computeAssocTypeAndRole (UMLClassifier *c, UMLAssociation *a, QString &typeName, QString &roleName)
QString | className (UMLClassifier *c, bool inOwnScope=true)
void | finalizeRun ()

## Static Private Member Functions
static bool | isOOClass (const UMLClassifier *c)
static QString | packageName (UMLPackage *p)

## Private Attributes
PackageFileMap | m_pkgsGenerated
UMLClassifierList | m_classesGenerated

## Static Private Attributes
static const QString | defaultPackageSuffix = QStringLiteral("_Holder")

## Additional Inherited Members
Public Types inherited from CodeGenerator
enum | GenerationState { Generated , Failed , Skipped }
Public Slots inherited from SimpleCodeGenerator
virtual void | syncCodeToDocument ()
Public Slots inherited from CodeGenerator
virtual void | syncCodeToDocument ()
Signals inherited from CodeGenerator
void | codeGenerated (UMLClassifier *classifier, bool generated)
void | codeGenerated (UMLClassifier *classifier, CodeGenerator::GenerationState result)
void | showGeneratedFile (const QString &filename)
Static Public Member Functions inherited from CodeGenerator
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)
Protected Member Functions inherited from SimpleCodeGenerator
QString | findFileName (UMLPackage *classifier, const QString &ext)
QString | overwritableName (UMLPackage *classifier, const QString &name, const QString &ext)
bool | hasDefaultValueAttr (UMLClassifier *c)
bool | hasAbstractOps (UMLClassifier *c)
QString | indent ()
virtual void | initFromParentDocument ()
Protected Member Functions inherited from CodeGenerator
QString | overwritableName (const QString &name, const QString &extension)
bool | openFile (QFile &file, const QString &name)
void | writeListedCodeDocsToFile (CodeDocumentList *docs)
Protected Attributes inherited from SimpleCodeGenerator
QString | className_
QString | fileName_
QMap< UMLPackage *, QString > | m_fileMap
bool | m_createDirHierarchyForPackages
QString | m_indentation
int | m_indentLevel
QString | m_endl
Protected Attributes inherited from CodeGenerator
QHash< QString, CodeDocument * > | m_codeDocumentDictionary
bool | m_applyToAllRemaining
UMLDoc * | m_document

## Detailed Description

Class AdaWriter is a code generator for UMLClassifier objects. Based on javawriter.h by Luis De la Parra Blum. Create an instance of this class, and feed it a UMLClassifier when calling writeClass and it will generate an Ada package spec for that concept.

## Member Typedef Documentation

## ◆ PackageFileMap

typedef QMap<QString, QFile*> AdaWriter::PackageFileMap
| private

## Constructor & Destructor Documentation

## ◆ AdaWriter()

AdaWriter::AdaWriter | ( |  | ) |

Basic Constructor

## ◆ ~AdaWriter()

AdaWriter::~AdaWriter | ( |  | ) |
| virtual

Empty Destructor

## Member Function Documentation

## ◆ className()

QString AdaWriter::className | ( | UMLClassifier * | c,
|  | bool | inOwnScope = true )
| private

Returns the class name.

## ◆ computeAssocTypeAndRole()

void AdaWriter::computeAssocTypeAndRole | ( | UMLClassifier * | c,
|  | UMLAssociation * | a,
|  | QString & | typeName,
|  | QString & | roleName )
| private

Compute the type and role name from the given association.

Parameters

  c | The UMLClassifier for which code is being generated.
  a | The UMLAssociation to analyze.
  typeName | Return value: type name.
  roleName | Return value: role name.

## ◆ declareClass()

void AdaWriter::declareClass | ( | UMLClassifier * | c,
|  | QTextStream & | ada )
| private

## ◆ defaultDatatypes()

QStringList AdaWriter::defaultDatatypes | ( |  | ) | const
| virtual

Returns the default datatypes.

Reimplemented from CodeGenerator.

## ◆ finalizeRun()

void AdaWriter::finalizeRun | ( |  | ) |
| privatevirtual

A single call to writeCodeToFile() usually entails processing many items (e.g. as classifiers) for which code is generated. This method is called after all code of one call to writeCodeToFile() has been generated. It can be reimplemented by concrete code generators to perform additional cleanups or other actions that can only be performed once all code has been written.

Reimplemented from CodeGenerator.

## ◆ isOOClass()

bool AdaWriter::isOOClass | ( | const UMLClassifier * | c | ) |
| staticprivate

Return true if `c' is a tagged type or Ada2005 interface.

## ◆ isReservedKeyword()

bool AdaWriter::isReservedKeyword | ( | const QString & | rPossiblyReservedKeyword | ) |
| virtual

Check whether the given string is a reserved word for the language of this code generator

Parameters

  rPossiblyReservedKeyword | The string to check.

Reimplemented from CodeGenerator.

## ◆ language()

Uml::ProgrammingLanguage::Enum AdaWriter::language | ( |  | ) | const
| virtual

Returns "Ada".

Returns
  the programming language identifier

Implements CodeGenerator.

## ◆ packageName()

QString AdaWriter::packageName | ( | UMLPackage * | p | ) |
| staticprivate

Returns the package name.

## ◆ reservedKeywords()

QStringList AdaWriter::reservedKeywords | ( |  | ) | const
| virtual

Get list of reserved keywords.

Returns
  the list of reserved keywords

Reimplemented from CodeGenerator.

## ◆ writeClass()

void AdaWriter::writeClass | ( | UMLClassifier * | c | ) |
| virtual

Call this method to generate Ada code for a UMLClassifier.

Parameters

  c | the class to generate code for

Implements SimpleCodeGenerator.

## ◆ writeOperation()

void AdaWriter::writeOperation | ( | UMLOperation * | op,
|  | QTextStream & | ada,
|  | bool | is_comment = false )
| private

Write one operation.

Parameters

  op | the class for which we are generating code
  ada | the stream associated with the output file
  is_comment | flag for a comment

## Member Data Documentation

## ◆ defaultPackageSuffix

const QString AdaWriter::defaultPackageSuffix = QStringLiteral("_Holder")
| staticprivate

## ◆ m_classesGenerated

UMLClassifierList AdaWriter::m_classesGenerated
| private

List of classifiers generated. Required for ensuring order of code generation which satisfies order of dependencies among classifiers.

## ◆ m_pkgsGenerated

PackageFileMap AdaWriter::m_pkgsGenerated
| private

Map package name to QFile. Required for closing opened files in finalizeRun().

The documentation for this class was generated from the following files:

- umbrello/codegenerators/ada/adawriter.h
- umbrello/codegenerators/ada/adawriter.cpp