aboutsummaryrefslogtreecommitdiffstats
path: root/include/diagram/branchstatement.hpp
blob: b7cc495e2e532b23626ee10d98054d4740236c37 (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
/*
 * BranchStatement.hpp
 *
 *  Created on: Nov 28, 2017
 *      Author: naopross
 */

#ifndef SRC_DIAGRAM_BRANCHSTATEMENT_HPP_
#define SRC_DIAGRAM_BRANCHSTATEMENT_HPP_

#include "Statement.hpp"

#include <map>

namespace samb {

class BranchStatement: public Statement {
public:
    BranchStatement(Type t, const std::string& condition, pointer next);

    /* accessors */
    const std::map<std::string, pointer>& branches() const { return m_branches; }
    std::size_t branchesCount() const { return m_branchesCount; }

    inline const std::string& condition() const { return text(); }
    inline void condition(const std::string& condition) { return text(condition); }

private:
    std::map<std::string, pointer> m_branches;
    std::size_t m_branchesCount = 0;
};

} /* namespace samb */

#endif /* SRC_DIAGRAM_BRANCHSTATEMENT_HPP_ */