summaryrefslogtreecommitdiff
path: root/src/model/GraphNode.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/GraphNode.hpp')
-rw-r--r--src/model/GraphNode.hpp34
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_ */