-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.cpp
More file actions
52 lines (40 loc) · 1.03 KB
/
Copy pathnode.cpp
File metadata and controls
52 lines (40 loc) · 1.03 KB
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
#include <string>
#include <iostream>
#include <vector>
#include <functional>
#include "node.h"
#include "edge.h"
bool Node::isLeaf() {
return leaf;
}
int Node::getIndex() {
return index;
}
std::vector<std::unique_ptr<Edge>> &Node::getEdges() {
return edges;
}
std::vector<std::unique_ptr<Record>> &Node::getRecords() {
return records;
}
int Node::addEdge(std::unique_ptr<Edge> e) {
edges.push_back(std::move(e));
return 0;
}
int Node::addRecord(std::unique_ptr<Record> r) {
records.push_back(std::move(r));
//std::cout << "Size of records vector is now: " << records.size() << std::endl;
//for (std::vector<std::unique_ptr<Record>>::iterator it2 = records.begin(); it2 != records.end(); it2++) {
// std::cout << "CURRENT RECORD NAME: " << (*it2)->getName() << std::endl;
// std::cout << "CURRENT CONTENT NAME: " << (*it2)->getContent() << std::endl;
// std::cout << "CURRENT RECORD TYPE: " << (*it2)->getType() << std::endl;
//}
return 0;
}
Node::Node(int i, bool l) {
index = i;
leaf = l;
}
Node::Node() {
}
Node::~Node() {
}