-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cc
34 lines (25 loc) · 851 Bytes
/
main.cc
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
#include <iostream>
#include "gdb.h"
using namespace std;
int main()
{
GraphDatabase gdb;
gdb.insert_node(0, (void*)"Tom", 3);
gdb.insert_node(1, (void*)"Ria", 3);
gdb.insert_node(2, (void*)"Jay", 3);
gdb.insert_node(3, (void*)"Frank", 5);
gdb.insert_edge(0, 1, "father");
gdb.insert_edge(1, 2, "brother");
gdb.insert_edge(1, 3, "brother");
unsigned int res = gdb.get_node(0).get("father").get("brother")[0]->get_id();
cout << res << endl;
res = gdb.get_node(0).lazy_get("father").lazy_get("brother").query()[1]->get_id();
cout << res << endl;
gdb.persist();
Node* t = gdb.read_node(1);
cout << t->get_id() << endl;
//gdb.recover();
//unsigned int res = gdb.get_node(0).lazy_get("father").lazy_get("brother").query()[1]->get_id();
//cout << res << endl;
return 0;
}