forked from EleanorWhite/HamsterDB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampleUse.cpp
More file actions
55 lines (43 loc) · 830 Bytes
/
Copy pathexampleUse.cpp
File metadata and controls
55 lines (43 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "node.hpp"
#include "database.hpp"
using namespace std;
int main()
{
class Person : public Node{
public:
std::string primaryKey;
int age;
double llamas;
};
Person p;
p.primaryKey = "Nelll";
p.age = 12;
p.llamas = 3.4;
Database d;
//
d.addNode(p);
//
Person m;
p.primaryKey = "Mackenzie";
p.age = 14;
p.llamas = 5.2;
//
d.addNode(m);
Person * mp = new Person;
*mp = m;
p.addRelationship(mp, "Friendships!", false);
//
std::list<Node> nodeList = d.getNodeWithRelationship(m, "Friendships!");
//
//d.getRelationship(p, m);
//Person * mp = new Person;
//*mp = m;
//Person * pp = p;
//p.addRelationship(mp, "Friends", false);
//cout << p.getRelationship(mp) << endl;
//
//p.getNodesWithRel("Friends", false);
//p.removeRelationship(mp, "Friends", false);
//
//cout << p.getRelationship(mp) << endl;
}