aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/modelinglib/qmt/model/mdependency.h
blob: 6bd6514681b01b1f938c17af81d13361ff9bbbc8 (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
// Copyright (C) 2016 Jochen Becher
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "mrelation.h"

namespace qmt {

class MObject;

class QMT_EXPORT MDependency : public MRelation
{
public:
    enum Direction {
        AToB,
        BToA,
        Bidirectional
    };

    MDependency();
    MDependency(const MDependency &rhs);
    ~MDependency() override;

    MDependency &operator=(const MDependency &rhs);

    Direction direction() const { return m_direction; }
    void setDirection(Direction direction);
    Uid source() const;
    void setSource(const Uid &source);
    Uid target() const;
    void setTarget(const Uid &target);

    void accept(MVisitor *visitor) override;
    void accept(MConstVisitor *visitor) const override;

private:
    Direction m_direction = AToB;
};

} // namespace qmt