umbrello: umbrello/codegenerators/ada/adawriter.h Source File

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

adawriter.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002 Oliver Kellogg <okellogg@users.sourceforge.net> *
8 * copyright (C) 2003-2020 *
9 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
10 ***************************************************************************/
11
12 #ifndef ADAWRITER_H
13 #define ADAWRITER_H
14
15 #include "simplecodegenerator.h"
16 #include "umlclassifierlist.h"
17
18 #include <QMap>
19
20 class UMLAssociation;
21 class UMLOperation;
22 class QTextStream;
23 class QFile;
24
32 class AdaWriter : public SimpleCodeGenerator
33 {
34 Q_OBJECT
35 public:
36
37 AdaWriter();
38 virtual ~AdaWriter();
39
40 virtual void writeClass(UMLClassifier *c);
41
42 virtual Uml::ProgrammingLanguage::Enum language() const;
43
44 QStringList defaultDatatypes();
45
46 virtual bool isReservedKeyword(const QString & rPossiblyReservedKeyword);
47
48 virtual QStringList reservedKeywords() const;
49
50 private:
51
52 void declareClass(UMLClassifier *c, QTextStream &ada);
53
54 void writeOperation(UMLOperation *op, QTextStream &ada, bool is_comment = false);
55
56 void computeAssocTypeAndRole(UMLClassifier *c,
57 UMLAssociation *a,
58 QString& typeName, QString& roleName);
59
60 static bool isOOClass(UMLClassifier *c);
61
62 QString className(UMLClassifier *c, bool inOwnScope = true);
63
64 static QString packageName(UMLPackage *p);
65
66 void finalizeRun();
67
68 static const QString defaultPackageSuffix;
69
70 typedef QMap<QString, QFile*> PackageFileMap;
71
76 PackageFileMap m_pkgsGenerated;
77
83 UMLClassifierList m_classesGenerated;
84 };
85
86 #endif // ADAWRITER_H
UMLObject::asUMLClassifier
UMLClassifier * asUMLClassifier()
Definition: umlobject.cpp:1308
template.h
UMLClassifier::getOpList
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Definition: classifier.cpp:939
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:79
Uml::Visibility::Implementation
@ Implementation
Definition: basictypes.h:80
Uml::ProgrammingLanguage::Enum
Enum
Definition: basictypes.h:288
UMLClassifier::isInterface
bool isInterface() const
Definition: classifier.cpp:118
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
AdaWriter::reservedKeywords
virtual QStringList reservedKeywords() const
Definition: adawriter.cpp:542
AdaWriter::m_pkgsGenerated
PackageFileMap m_pkgsGenerated
Definition: adawriter.h:76
UMLAttributeList
Definition: umlattributelist.h:26
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
CodeGenerator::getHeadingFile
virtual QString getHeadingFile(const QString &file)
Definition: codegenerator.cpp:407
UMLOperation::getParmList
UMLAttributeList getParmList() const
Definition: operation.cpp:178
UMLTemplate::getTypeName
virtual QString getTypeName() const
Definition: template.cpp:80
CodeGenerator::cleanName
static QString cleanName(const QString &name)
Definition: codegenerator.cpp:549
adawriter.h
UMLClassifier::getFilteredList
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Definition: classifier.cpp:998
UMLObject::ot_Class
@ ot_Class
Definition: umlobject.h:89
operation.h
UMLClassifierListItem::getType
UMLClassifier * getType() const
Definition: classifierlistitem.cpp:102
AdaWriter::finalizeRun
void finalizeRun()
Definition: adawriter.cpp:668
UMLAttribute::getInitialValue
QString getInitialValue() const
Definition: attribute.cpp:99
AdaWriter::writeOperation
void writeOperation(UMLOperation *op, QTextStream &ada, bool is_comment=false)
Definition: adawriter.cpp:445
UMLClassifierListItem::getTypeName
virtual QString getTypeName() const
Definition: classifierlistitem.cpp:112
AdaWriter::AdaWriter
AdaWriter()
Definition: adawriter.cpp:40
Uml::RoleType::A
@ A
Definition: basictypes.h:256
Uml::ModelType::Logical
@ Logical
Definition: basictypes.h:93
CodeGenerator::findObjectsRelated
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Definition: codegenerator.cpp:622
UMLObject::ot_Interface
@ ot_Interface
Definition: umlobject.h:86
association.h
UMLObject::umlParent
UMLObject * umlParent() const
Definition: umlobject.cpp:670
AdaWriter::className
QString className(UMLClassifier *c, bool inOwnScope=true)
Definition: adawriter.cpp:88
SimpleCodeGenerator::overwritableName
QString overwritableName(UMLPackage *concept, const QString &name, const QString &ext)
Definition: simplecodegenerator.cpp:167
UMLObject::umlPackage
UMLPackage * umlPackage() const
Definition: umlobject.cpp:645
UMLObject::isStatic
bool isStatic() const
Definition: umlobject.cpp:366
UMLClassifier::getTemplateList
UMLTemplateList getTemplateList() const
Definition: classifier.cpp:1148
Uml::ParameterDirection::Enum
Enum
Definition: basictypes.h:273
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
AdaWriter::writeClass
virtual void writeClass(UMLClassifier *c)
Definition: adawriter.cpp:211
AdaWriter::language
virtual Uml::ProgrammingLanguage::Enum language() const
Definition: adawriter.cpp:57
SimpleCodeGenerator::indent
QString indent()
Definition: simplecodegenerator.cpp:76
AdaWriter::isOOClass
static bool isOOClass(UMLClassifier *c)
Definition: adawriter.cpp:65
AdaWriter::declareClass
void declareClass(UMLClassifier *c, QTextStream &ada)
Definition: adawriter.cpp:177
UMLObject::isAbstract
bool isAbstract() const
Definition: umlobject.cpp:348
UMLObject::asUMLEnum
UMLEnum * asUMLEnum()
Definition: umlobject.cpp:1315
SimpleCodeGenerator::m_indentLevel
int m_indentLevel
Definition: simplecodegenerator.h:86
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
Uml::ParameterDirection::InOut
@ InOut
Definition: basictypes.h:275
CodeGenerator::forceDoc
bool forceDoc() const
Definition: codegenerator.cpp:765
UMLObject::ot_EnumLiteral
@ ot_EnumLiteral
Definition: umlobject.h:94
umlclassifierlistitemlist.h
AdaWriter::m_classesGenerated
UMLClassifierList m_classesGenerated
Definition: adawriter.h:83
Uml::AssociationType::Aggregation
@ Aggregation
Definition: basictypes.h:125
AdaWriter::isReservedKeyword
virtual bool isReservedKeyword(const QString &rPossiblyReservedKeyword)
Definition: adawriter.cpp:525
Uml::Visibility::Public
@ Public
Definition: basictypes.h:77
UMLAttribute::getParmKind
Uml::ParameterDirection::Enum getParmKind() const
Definition: attribute.cpp:122
classifierlistitem.h
CodeGenerator::showGeneratedFile
void showGeneratedFile(const QString &filename)
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
attribute.h
a
QString a
Definition: petalnode.cpp:18
SimpleCodeGenerator::m_endl
QString m_endl
Definition: simplecodegenerator.h:87
UMLObject::fullyQualifiedName
virtual QString fullyQualifiedName(const QString &separator=QString(), bool includeRoot=false) const
Definition: umlobject.cpp:227
folder.h
umlclassifierlist.h
AdaWriter::packageName
static QString packageName(UMLPackage *p)
Definition: adawriter.cpp:112
CodeGenerator::formatDoc
static QString formatDoc(const QString &text, const QString &linePrefix=QLatin1String(" *"), int lineWidth=80)
Definition: codegenerator.cpp:712
Uml::ProgrammingLanguage::Ada
@ Ada
Definition: basictypes.h:290
uDebug
#define uDebug()
Definition: debug_utils.h:122
SimpleCodeGenerator
Definition: simplecodegenerator.h:33
AdaWriter
Definition: adawriter.h:32
Uml::RoleType::B
@ B
Definition: basictypes.h:257
Uml::ParameterDirection::Out
@ Out
Definition: basictypes.h:276
UMLObject::toString
static QString toString(ObjectType ot)
Definition: umlobject.cpp:1124
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:123
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
AdaWriter::defaultDatatypes
QStringList defaultDatatypes()
Definition: adawriter.cpp:502
UMLAttribute
Sets up attribute information.
Definition: attribute.h:27
UMLClassifier::getAttributeList
UMLAttributeList getAttributeList() const
Definition: classifier.cpp:436
AdaWriter::PackageFileMap
QMap< QString, QFile * > PackageFileMap
Definition: adawriter.h:70
UMLPackageList
QList< UMLPackage * > UMLPackageList
Definition: umlpackagelist.h:17
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
Uml::Visibility::Enum
Enum
Definition: basictypes.h:76
UMLClassifierListItemList
Definition: umlclassifierlistitemlist.h:26
CodeGenerator::codeGenerated
void codeGenerated(UMLClassifier *concept, bool generated)
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
UMLOperation
Definition: operation.h:24
UMLObject::ot_Enum
@ ot_Enum
Definition: umlobject.h:88
uml.h
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:39
debug_utils.h
UMLAssociation
Sets up association information.
Definition: association.h:32
UMLObject::isUMLDatatype
bool isUMLDatatype()
Definition: umlobject.h:206
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
AdaWriter::~AdaWriter
virtual ~AdaWriter()
Definition: adawriter.cpp:49
Uml::AssociationType::Composition
@ Composition
Definition: basictypes.h:134
UMLTemplateList
QList< UMLTemplate * > UMLTemplateList
Definition: umltemplatelist.h:18
UMLTemplate
Sets up template information.
Definition: template.h:26
simplecodegenerator.h
AdaWriter::defaultPackageSuffix
static const QString defaultPackageSuffix
Definition: adawriter.h:68
Uml::Visibility::Private
@ Private
Definition: basictypes.h:78
CodeGenerator::forceSections
bool forceSections() const
Definition: codegenerator.cpp:775
Uml::Visibility::Protected
@ Protected
Definition: basictypes.h:79
UMLObject::stereotype
QString stereotype(bool includeAdornments=false) const
Definition: umlobject.cpp:558
UMLOperationList
QList< UMLOperation * > UMLOperationList
Definition: umloperationlist.h:18
umltemplatelist.h
UMLClassifierListItem
A base class for classifier list items (e.g. attributes)
Definition: classifierlistitem.h:29
UMLEnum
Non-graphical Information for an Enum.
Definition: enum.h:28
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
umldoc.h
AdaWriter::computeAssocTypeAndRole
void computeAssocTypeAndRole(UMLClassifier *c, UMLAssociation *a, QString &typeName, QString &roleName)
Definition: adawriter.cpp:144
CodeGenerator::openFile
bool openFile(QFile &file, const QString &name)
Definition: codegenerator.cpp:523
UMLPackage
Non-graphical information for a Package.
Definition: package.h:32
enum.h