aboutsummaryrefslogtreecommitdiffstats
path: root/include/diagram/branchstatement.h
blob: 3d8c385b1b2c3296936d5fe4dd30f3c4a548781f (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 BranchStatement : public Statement
{
public:
    BranchStatement(Type t, const QString &condition, pointer next);

    /* accessors */
    std::map<QString, pointer>& branches() { return _branches; }
    std::size_t branches_count() 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 */