aboutsummaryrefslogtreecommitdiffstats
path: root/include/diagram/branch.h
blob: 2024d78393761ded129143549ce629f645317269 (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
#ifndef DIAGRAM_BRANCHSTATEMENT_H
#define DIAGRAM_BRANCHSTATEMENT_H

#include "diagram/statement.h"

#include <map>
#include <QString>

namespace samb {

/* Implementation for Statement::DECISION, Statement::SWITCH
 */
class Branch : public Statement
{
public:
    Branch(Type t, const QString &condition, pointer next);

    /* accessors */
    std::map<QString, pointer>& branches() { return _branches; }
    std::size_t branchesCount() const { return _branchesCount; }

    inline const QString& condition() const { return text(); }
    inline void condition(const QString &condition) { return text(condition); }

private:
    std::map<QString, pointer> _branches;
    std::size_t _branchesCount = 0;
};

} /* namespace samb */

#endif /* DIAGRAM_BRANCHSTATEMENT_H */