aboutsummaryrefslogtreecommitdiffstats
path: root/src/diagram/Statement.cpp
diff options
context:
space:
mode:
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 */