aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagram/BranchStatement.hpp
blob: 1f07e5ab4f40014c6a6bff316f91d6e413c05b56 (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_ */