aboutsummaryrefslogtreecommitdiffstats
path: root/include/diagram/statement.h
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-12-19 01:54:28 +0100
committerNao Pross <naopross@thearcway.org>2017-12-19 01:54:28 +0100
commita7e74749a1c4edb2f8bc34c79e9bd1562de86ee9 (patch)
tree4282a5dfa9ef7d77823e3e8ef02a193c91e719d6 /include/diagram/statement.h
parentMoved to QtCreator project with QMake (diff)
downloadOrbitingYeti-a7e74749a1c4edb2f8bc34c79e9bd1562de86ee9.tar.gz
OrbitingYeti-a7e74749a1c4edb2f8bc34c79e9bd1562de86ee9.zip
Change to Qt5 conding conventions
Data structure changes: - Structogram is no longer just a scope, because it needs to store metadata - All structures now use QString instead of std::string, to integrate better in the Qt framework New code: - MainWindow ui code, building layout - MetadataDialog to change the metadata stored in the Structogram - Painter is a widget (still unimplemented) to show the structogram on the GUI
Diffstat (limited to '')
-rw-r--r--include/diagram/statement.h (renamed from include/diagram/statement.hpp)34
1 files changed, 15 insertions, 19 deletions
diff --git a/include/diagram/statement.hpp b/include/diagram/statement.h
index ab8c5b7..5cce908 100644
--- a/include/diagram/statement.hpp
+++ b/include/diagram/statement.h
@@ -1,16 +1,11 @@
-/*
- * Statement.h
- *
- * Created on: Nov 23, 2017
- * Author: naopross
- */
-
-#ifndef SRC_DIAGRAM_STATEMENT_H_
-#define SRC_DIAGRAM_STATEMENT_H_
+#ifndef DIAGRAM_STATEMENT_H
+#define DIAGRAM_STATEMENT_H
#include <string>
#include <memory>
+#include <QString>
+
namespace samb {
/* Possible types of statement, according to the NS diagram paper
@@ -28,7 +23,8 @@ namespace samb {
* (linked list), that is also a common interface for the various types of
* statements.
*/
-class Statement {
+class Statement
+{
public:
using pointer = std::shared_ptr<Statement>;
@@ -44,24 +40,24 @@ public:
const Type type;
- Statement(Type t, const std::string& text);
- Statement(Type t, const std::string& text, pointer next);
+ Statement(Type t, const QString &text);
+ Statement(Type t, const QString &text, pointer next);
virtual ~Statement();
bool operator==(const Statement& other) const;
/* accessors */
- void next(pointer next) { m_next = next; }
- pointer next() const { return m_next; }
+ void next(pointer next) { _next = next; }
+ pointer next() const { return _next; }
- void text(const std::string& text) { m_text = text; }
- const std::string& text() const { return m_text; }
+ void text(const QString &text) { _text = text; }
+ const QString& text() const { return _text; }
private:
- std::string m_text;
- pointer m_next;
+ QString _text;
+ pointer _next;
};
} /* namespace samb */
-#endif /* SRC_DIAGRAM_STATEMENT_H_ */
+#endif /* DIAGRAM_STATEMENT_H */