blob: 4b0b0ab4bbf3f3ff6b292cf9689f5e9a9fbe8d55 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
// Copyright (C) 2016 Jochen Becher
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "mdependency.h"
#include "mvisitor.h"
#include "mconstvisitor.h"
namespace qmt {
MDependency::MDependency()
{
}
MDependency::MDependency(const MDependency &rhs)
: MRelation(rhs),
m_direction(rhs.m_direction)
{
}
MDependency::~MDependency()
{
}
MDependency &MDependency::operator =(const MDependency &rhs)
{
if (this != &rhs) {
MRelation::operator=(rhs);
m_direction = rhs.m_direction;
}
return *this;
}
void MDependency::setDirection(MDependency::Direction direction)
{
m_direction = direction;
}
Uid MDependency::source() const
{
return m_direction == BToA ? endBUid() : endAUid();
}
void MDependency::setSource(const Uid &source)
{
if (m_direction == BToA)
setEndBUid(source);
else
setEndAUid(source);
}
Uid MDependency::target() const
{
return m_direction == BToA ? endAUid() : endBUid();
}
void MDependency::setTarget(const Uid &target)
{
if (m_direction == BToA)
setEndAUid(target);
else
setEndBUid(target);
}
void MDependency::accept(MVisitor *visitor)
{
visitor->visitMDependency(this);
}
void MDependency::accept(MConstVisitor *visitor) const
{
visitor->visitMDependency(this);
}
} // namespace qmt
|