From d99095f4a181357bf0c6d10846351eb0b58b1ccf Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 6 Mar 2014 00:11:17 +0000 Subject: 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 --- src/model/GraphNode.hpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'src/model/GraphNode.hpp') 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 . */ -#ifndef _GRAPH_NODE_HPP_ -#define _GRAPH_NODE_HPP_ +#ifndef _OUSIA_MODEL_GRAPH_NODE_HPP_ +#define _OUSIA_MODEL_GRAPH_NODE_HPP_ #include #include 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 parent; + std::string name; -public: - GraphNode(); - - GraphNode(std::shared_ptr parent); +protected: + GraphNode(GraphNodeType type, std::shared_ptr parent = nullptr, + const std::string &name = ""); - GraphNode(const std::string &name, std::shared_ptr 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 getParent() { - return std::shared_ptr(parent); + return parent; } void setParent(std::shared_ptr parent) @@ -59,10 +64,15 @@ public: this->parent = parent; } + GraphNodeType getType() + { + return type; + } }; +} } -#endif /* _GRAPH_NODE_HPP_ */ +#endif /* _OUSIA_MODEL_GRAPH_NODE_HPP_ */ -- cgit v1.2.3