diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:44:32 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-26 23:44:32 +0100 |
commit | 3b058bd31ba2783a8ef85b9f72d994a02cb3529b (patch) | |
tree | 3be2af332ecdc511ee45097c829f4b934d0adc1c | |
parent | Implementation for Structogram iterator and Statement type (diff) | |
download | OrbitingYeti-3b058bd31ba2783a8ef85b9f72d994a02cb3529b.tar.gz OrbitingYeti-3b058bd31ba2783a8ef85b9f72d994a02cb3529b.zip |
Update header ifdefs to match and clean up comments
-rw-r--r-- | src/diagram/Statement.hpp | 11 | ||||
-rw-r--r-- | src/diagram/Structogram.cpp | 6 | ||||
-rw-r--r-- | src/diagram/Structogram.hpp | 6 |
3 files changed, 9 insertions, 14 deletions
diff --git a/src/diagram/Statement.hpp b/src/diagram/Statement.hpp index 8c41714..1781a97 100644 --- a/src/diagram/Statement.hpp +++ b/src/diagram/Statement.hpp @@ -5,8 +5,8 @@ * Author: naopross */ -#ifndef SRC_STATEMENT_H_ -#define SRC_STATEMENT_H_ +#ifndef SRC_DIAGRAM_STATEMENT_H_ +#define SRC_DIAGRAM_STATEMENT_H_ #include <string> #include <memory> @@ -61,12 +61,9 @@ struct Statement { std::string text; pointer next; - pointer scope; // TODO: make iterator look for this + pointer scope; // TODO: make iterator aware of scope static Statement::pointer makeStatement(Type t); -// static Statement::pointer makeProcess(); -// static Statement::pointer makeLoop(Type t, std::string condition); -// static Statement::pointer makeBranching(Type t, std::string condition); virtual ~Statement(); bool operator==(const Statement& other); @@ -77,4 +74,4 @@ private: } /* namespace samb */ -#endif /* SRC_STATEMENT_H_ */ +#endif /* SRC_DIAGRAM_STATEMENT_H_ */ diff --git a/src/diagram/Structogram.cpp b/src/diagram/Structogram.cpp index a21c62d..0575748 100644 --- a/src/diagram/Structogram.cpp +++ b/src/diagram/Structogram.cpp @@ -89,6 +89,8 @@ Structogram::iterator Structogram::insert_after(Structogram::iterator it, Statem throw std::invalid_argument("structogram: attempt to insert a null statement"); } + // TODO: update m_tail + statement->next = it->next; it->next = statement; m_size++; @@ -96,10 +98,6 @@ Structogram::iterator Structogram::insert_after(Structogram::iterator it, Statem return ++it; } -//Structogram::iterator Structogram::insert_after(Structogram::iterator it, Statement::pointer statement) { -// return insert(++it, statement); -//} - Structogram::iterator Structogram::erase_after(iterator it) { // TODO: error handling IE return a std::pair<iterator, bool> diff --git a/src/diagram/Structogram.hpp b/src/diagram/Structogram.hpp index 9318ee4..7b036f0 100644 --- a/src/diagram/Structogram.hpp +++ b/src/diagram/Structogram.hpp @@ -5,8 +5,8 @@ * Author: naopross */ -#ifndef STRUCTOGRAM_H_ -#define STRUCTOGRAM_H_ +#ifndef SRC_DIAGRAM_STRUCTOGRAM_H_ +#define SRC_DIAGRAM_STRUCTOGRAM_H_ #include <iostream> #include <list> @@ -68,4 +68,4 @@ private: } /* namespace structograms */ -#endif /* STRUCTOGRAM_H_ */ +#endif /* SRC_DIAGRAM_STRUCTOGRAM_H_ */ |