'privPointLoc'
Node.h
1 
7 #ifndef PRIVPOINTLOC_NODE_H
8 #define PRIVPOINTLOC_NODE_H
9 
10 #include <iostream>
11 #include <fstream>
12 #include <string>
13 #include "Tree.h"
14 #include <vector>
15 #include <helib/helib.h>
16 #include "Encryptor.h"
17 #include "PrivPointUtil.h"
18 
19 class Tree;
20 class Segment;
21 
28 enum NodeType {x, y, leaf};
29 
30 class Node {
31 public:
32  Node(Tree *, Segment *, NodeType);
33 
39  Node * getLeft();
40 
46  Node * getRight();
47 
53  Segment * getSegment();
54 
60  void setLeft(Node *);
61 
67  void setRight(Node *);
68 
74  void setSegment(Segment *);
75 
81  Tree * getTree();
82 
88  int getMatrixIndex();
89 
95  std::string getMatrixLabel();
96 
102  void setMatrixParams(int, std::string);
103 
109  int getValue();
110 
116  void setValue(int);
117 
123  NodeType getNodeType();
124 
130  void setNodeType(NodeType);
131 
132 
139  bool getIsRight();
140 
147  void setIsRight(bool);
148 
154  void addPathLabel(std::string);
155 
161  std::vector<std::string> getPathLabels();
162 
172  void evaluateNode(Encryptor &, PrivPointUtil *, helib::Ctxt, int, int);
173 
179  helib::Ctxt getNodeResult();
180 private:
181  Node * left;
182  Node * right;
183  Segment * s;
184  Tree * tree;
185  int value;
186  NodeType type;
187  bool isRight; // if NodeType x, is it right or left? Needed for printing the adjacency map
188  int matrixIndex;
189  std::string matrixLabel; // for printing the adjacency matrix
190  std::vector<std::string> pathLabels; // for parallel processing of privPointLoc
191  helib::Ctxt * result;
192 };
193 
194 #endif /*PRIVPOINTLOC_NODE_H*/
void setSegment(Segment *)
Definition: Node.h:30
Definition: Encryptor.h:12
void setValue(int)
Definition: Node.cpp:14
int getMatrixIndex()
Definition: Node.cpp:72
std::vector< std::string > getPathLabels()
Definition: Node.cpp:85
Node * getRight()
Definition: Node.cpp:36
Tree * getTree()
Definition: Node.cpp:55
Node * getLeft()
Definition: Node.cpp:31
void setMatrixParams(int, std::string)
Definition: Node.cpp:67
int getValue()
Definition: Node.cpp:18
Segment * getSegment()
Definition: Node.cpp:50
void setNodeType(NodeType)
Definition: Node.cpp:22
void setIsRight(bool)
Definition: Node.cpp:59
std::string getMatrixLabel()
Definition: Node.cpp:76
Definition: Tree.h:21
Definition: Segment.h:16
void evaluateNode(Encryptor &, PrivPointUtil *, helib::Ctxt, int, int)
Definition: Node.cpp:89
void addPathLabel(std::string)
Definition: Node.cpp:81
helib::Ctxt getNodeResult()
Definition: Node.cpp:152
Definition: PrivPointUtil.h:11
NodeType getNodeType()
Definition: Node.cpp:26
void setLeft(Node *)
Definition: Node.cpp:41
bool getIsRight()
Definition: Node.cpp:63
void setRight(Node *)
Definition: Node.cpp:46