From 004fa309d6ede28ec8ab195647a2cbee490e104f Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 25 Nov 2017 20:02:46 +0100 Subject: First commit --- src/diagram/Statement.hpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/diagram/Statement.hpp (limited to 'src/diagram/Statement.hpp') diff --git a/src/diagram/Statement.hpp b/src/diagram/Statement.hpp new file mode 100644 index 0000000..a90e88d --- /dev/null +++ b/src/diagram/Statement.hpp @@ -0,0 +1,60 @@ +/* + * Statement.h + * + * Created on: Nov 23, 2017 + * Author: naopross + */ + +#ifndef SRC_STATEMENT_H_ +#define SRC_STATEMENT_H_ + +#include + +namespace samb { + + +/* Possible types of statement, according to the NS diagram paper + * + * PROCESS, + * DECISION, + * SWITCH, + * WHILE, + * UNTIL, + * SCOPE, + * PARALLEL, + */ + +/* this class should behave like a std::list, or a std::map storing the data + * with a tree structure, BUT it is not a tree because allows 2 notes to point + * at a single node + * + * Normal Tree: Statements: + * A - B - C - D A - B - C - D - G + * \ \ / + * E - F E - F + * + * Because a statement contains branching elmeents. (if / switch) + */ +class Statement { +private: + Statement *next; + Statement *prev; + +public: + const enum Type { + PROCESS, + DECISION, + SWITCH, + WHILE, + UNTIL, + SCOPE, + PARALLEL, + } m_type; + + Statement(Type type, Statement *prev): m_type(type), m_prev(prev); + virtual ~Statement(); +}; + +} /* namespace samb */ + +#endif /* SRC_STATEMENT_H_ */ -- cgit v1.2.1