diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-03-06 00:11:17 +0000 |
---|---|---|
committer | andreas <andreas@daaaf23c-2e50-4459-9457-1e69db5a47bf> | 2014-03-06 00:11:17 +0000 |
commit | d99095f4a181357bf0c6d10846351eb0b58b1ccf (patch) | |
tree | 74daacc842023b14e27aa49403ee8d4aaa8bb172 /src/model/GraphNode.hpp | |
parent | f098dc45183d2b7a99e65b62448f59d12cc3c056 (diff) |
started to implement rudimentary XML reader (implemented expectOneOf function), changed some conventions in the used files (namespaces, include guards), moved anchor class from domain to document package, removed everything that does not work now from the CMakeLists.txt
git-svn-id: file:///var/local/svn/basicwriter@24 daaaf23c-2e50-4459-9457-1e69db5a47bf
Diffstat (limited to 'src/model/GraphNode.hpp')
-rw-r--r-- | src/model/GraphNode.hpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/model/GraphNode.hpp b/src/model/GraphNode.hpp index 39770dd..8ce1a39 100644 --- a/src/model/GraphNode.hpp +++ b/src/model/GraphNode.hpp @@ -16,34 +16,39 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _GRAPH_NODE_HPP_ -#define _GRAPH_NODE_HPP_ +#ifndef _OUSIA_MODEL_GRAPH_NODE_HPP_ +#define _OUSIA_MODEL_GRAPH_NODE_HPP_ #include <string> #include <memory> namespace ousia { +namespace model { + +enum class GraphNodeType { + None, Domain, Class, Annotation, Structure, ClassCategory, + AnnotationCategory +}; class GraphNode { private: - std::string name; + GraphNodeType type; std::shared_ptr<GraphNode> parent; + std::string name; -public: - GraphNode(); - - GraphNode(std::shared_ptr<GraphNode> parent); +protected: + GraphNode(GraphNodeType type, std::shared_ptr<GraphNode> parent = nullptr, + const std::string &name = ""); - GraphNode(const std::string &name, std::shared_ptr<GraphNode> parent = nullptr); +public: + const std::string getFullyQualifiedName(); const std::string& getName() { return name; } - const std::string getFullyQualifiedName(); - void setName(const std::string &name) { this->name = name; @@ -51,7 +56,7 @@ public: std::shared_ptr<GraphNode> getParent() { - return std::shared_ptr<GraphNode>(parent); + return parent; } void setParent(std::shared_ptr<GraphNode> parent) @@ -59,10 +64,15 @@ public: this->parent = parent; } + GraphNodeType getType() + { + return type; + } }; } +} -#endif /* _GRAPH_NODE_HPP_ */ +#endif /* _OUSIA_MODEL_GRAPH_NODE_HPP_ */ |