diff options
author | Nao Pross <naopross@thearcway.org> | 2017-11-28 15:05:02 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2017-11-28 15:05:02 +0100 |
commit | 12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56 (patch) | |
tree | 466f7d2756b0619921e2d9d061862c8443649ed3 /src/diagram/Statement.cpp | |
parent | Update header ifdefs to match and clean up comments (diff) | |
download | OrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.tar.gz OrbitingYeti-12e86e71ca36a58d7e2ed64f0454b65ed6f7eb56.zip |
New data structure for Structogram and Statements
Diffstat (limited to '')
-rw-r--r-- | src/diagram/Statement.cpp | 17 |
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 */ |