aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagram/Statement.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-11-28 15:05:02 +0100
committerNao Pross <naopross@thearcway.org>2017-11-28 15:05:02 +0100
commit12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56 (patch)
tree466f7d2756b0619921e2d9d061862c8443649ed3 /src/diagram/Statement.cpp
parentUpdate header ifdefs to match and clean up comments (diff)
downloadOrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.tar.gz
OrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.zip
New data structure for Structogram and Statements
Diffstat (limited to 'src/diagram/Statement.cpp')
-rw-r--r--src/diagram/Statement.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/diagram/Statement.cpp b/src/diagram/Statement.cpp
index 60be094..d708dd9 100644
--- a/src/diagram/Statement.cpp
+++ b/src/diagram/Statement.cpp
@@ -9,17 +9,14 @@
namespace samb {
-Statement::pointer Statement::makeStatement(Statement::Type t) {
- return std::make_shared<Statement>(Statement(t, "", nullptr, nullptr));
-}
-
-bool Statement::operator==(const Statement& other) {
- return (this->type == other.type) && (this->text == other.text) &&
- (this->next == other.next) && (this->scope == other.scope);
-}
+/* Statement */
+Statement::Statement(Type t, const std::string& text, Statement::pointer p): type(t), m_text(text), m_next(p) {}
-
-Statement::Statement(Type t, std::string txt, Statement::pointer p, Statement::pointer s): type(t), text(txt), next(p), scope(s) {}
Statement::~Statement() {}
+bool Statement::operator==(const Statement& other) const {
+ // comparison by pointers
+ return (this == &other);
+}
+
} /* namespace samb */