MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
GraphTypes.hpp
1 #pragma once
2 
3 #include <QByteArray>
4 #include <QVariant>
5 #include <utility>
6 
7 #include "Export.hpp"
8 
9 namespace Showcase
10 {
16  typedef QByteArray NodeId;
17 
20  typedef std::pair<NodeId, NodeId> EdgeId;
21 
24  typedef QByteArray PropertyKey;
25  typedef QVariant PropertyValue;
26  typedef std::map<PropertyKey, PropertyValue> PropertyMap;
27 
28  class Property
29  {
30  public:
31  Property() {}
32 
33  Property(const PropertyKey& k, const PropertyValue& v)
34  : key(k), value(v) {}
35 
36  Property(const Property &prop)
37  : key(prop.key), value(prop.value) {}
38 
39  PropertyKey key;
40  PropertyValue value;
41  };
42 
43 
47 
48  class SHOWCASE_API GraphNode
49  {
50  public:
51  static const NodeId& emptyId();
52 
53  GraphNode(const NodeId& nid=emptyId()) : id(nid) {}
54  GraphNode(const GraphNode& node) : id(node.id) {}
55 
56  NodeId id;
57  };
58 
59  class SHOWCASE_API GraphEdge
60  {
61  public:
62  static const EdgeId& emptyId();
63 
64  GraphEdge(const EdgeId& eid) : id(eid) {}
65  GraphEdge(const GraphEdge& edge) : id(edge.id) {}
66  EdgeId id;
67  };
68 
69 }