umbrello: umbrello/assocrules.h Source File

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

assocrules.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-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef ASSOCRULES_H
12 #define ASSOCRULES_H
13
14 #include "umlobject.h"
15 #include "widgetbase.h"
16
17 class UMLWidget;
18
25 class AssocRules
26 {
27 public:
28
29 AssocRules();
30 ~AssocRules();
31
32 static bool allowAssociation(Uml::AssociationType::Enum assocType, UMLWidget * widget);
33 static bool allowAssociation(Uml::AssociationType::Enum assocType,
34 UMLWidget * widgetA, UMLWidget * widgetB);
35
36 static bool allowRole(Uml::AssociationType::Enum assocType);
37
38 static bool allowMultiplicity(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType);
39
40 static bool allowSelf(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType);
41
42 static Uml::AssociationType::Enum isGeneralisationOrRealisation(UMLWidget* widgetA, UMLWidget* widgetB);
43
44 typedef enum {All, Java} Language;
45 typedef enum {Any, UML1, UML2 } Level;
46
47 private:
48 class Assoc_Rule {
49 public:
50 bool isValid() const;
51 Language language;
52 Uml::AssociationType::Enum assoc_type;
53 WidgetBase::WidgetType widgetA_type;
54 WidgetBase::WidgetType widgetB_type;
55 bool role;
56 bool multiplicity;
57 bool bidirectional;
58 bool self;
59 Level level;
60 };
61
62 static Assoc_Rule m_AssocRules[];
63 static int m_nNumRules;
64 };
65
66 #endif
AssocRules::Assoc_Rule
Definition: assocrules.h:48
AssocRules::Assoc_Rule::language
Language language
language rule applies to
Definition: assocrules.h:51
AssocRules::Assoc_Rule::widgetA_type
WidgetBase::WidgetType widgetA_type
type of role A widget
Definition: assocrules.h:53
AssocRules::Assoc_Rule::level
Level level
UML level.
Definition: assocrules.h:59
AssocRules::Assoc_Rule::bidirectional
bool bidirectional
can have an association of same type going between widget each way
Definition: assocrules.h:57
AssocRules::Assoc_Rule::widgetB_type
WidgetBase::WidgetType widgetB_type
type of role B widget
Definition: assocrules.h:54
AssocRules::Assoc_Rule::role
bool role
role text
Definition: assocrules.h:55
AssocRules::Assoc_Rule::isValid
bool isValid() const
< Structure to help determine association rules.
Definition: assocrules.cpp:537
AssocRules::Assoc_Rule::assoc_type
Uml::AssociationType::Enum assoc_type
association type
Definition: assocrules.h:52
AssocRules::Assoc_Rule::multiplicity
bool multiplicity
multiplicity text on association
Definition: assocrules.h:56
AssocRules
Definition: assocrules.h:26
AssocRules::allowMultiplicity
static bool allowMultiplicity(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition: assocrules.cpp:345
AssocRules::allowAssociation
static bool allowAssociation(Uml::AssociationType::Enum assocType, UMLWidget *widget)
Definition: assocrules.cpp:51
AssocRules::m_AssocRules
static Assoc_Rule m_AssocRules[]
Container that holds all the rules.
Definition: assocrules.h:62
AssocRules::allowRole
static bool allowRole(Uml::AssociationType::Enum assocType)
Definition: assocrules.cpp:329
AssocRules::~AssocRules
~AssocRules()
Definition: assocrules.cpp:43
AssocRules::AssocRules
AssocRules()
Definition: assocrules.cpp:36
AssocRules::m_nNumRules
static int m_nNumRules
The number of rules known about.
Definition: assocrules.h:63
AssocRules::isGeneralisationOrRealisation
static Uml::AssociationType::Enum isGeneralisationOrRealisation(UMLWidget *widgetA, UMLWidget *widgetB)
Definition: assocrules.cpp:379
AssocRules::allowSelf
static bool allowSelf(Uml::AssociationType::Enum assocType, WidgetBase::WidgetType widgetType)
Definition: assocrules.cpp:361
AssocRules::Language
Language
Definition: assocrules.h:44
AssocRules::Java
@ Java
Definition: assocrules.h:44
AssocRules::All
@ All
Definition: assocrules.h:44
AssocRules::Level
Level
Definition: assocrules.h:45
AssocRules::UML2
@ UML2
Definition: assocrules.h:45
AssocRules::Any
@ Any
Definition: assocrules.h:45
AssocRules::UML1
@ UML1
Definition: assocrules.h:45
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:111
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
umlobject.h
widgetbase.h