diff options
Diffstat (limited to '')
-rw-r--r-- | include/diagram/branchstatement.h | 30 | ||||
-rw-r--r-- | include/diagram/branchstatement.hpp | 35 |
2 files changed, 30 insertions, 35 deletions
diff --git a/include/diagram/branchstatement.h b/include/diagram/branchstatement.h new file mode 100644 index 0000000..6c5e416 --- /dev/null +++ b/include/diagram/branchstatement.h @@ -0,0 +1,30 @@ +#ifndef DIAGRAM_BRANCHSTATEMENT_H +#define DIAGRAM_BRANCHSTATEMENT_H + +#include "diagram/statement.h" + +#include <map> +#include <QString> + +namespace samb { + +class BranchStatement : public Statement +{ +public: + BranchStatement(Type t, const QString &condition, pointer next); + + /* accessors */ + const std::map<QString, pointer>& branches() const { 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 */ diff --git a/include/diagram/branchstatement.hpp b/include/diagram/branchstatement.hpp deleted file mode 100644 index b7cc495..0000000 --- a/include/diagram/branchstatement.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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_ */ |