-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBinary_Expr_Node.cpp
75 lines (66 loc) · 1.41 KB
/
Binary_Expr_Node.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Honor Pledge:
//
// I pledge that I have neither given nor
// received any help on this assignment.
//
// blakbenn
#include "Binary_Expr_Node.h"
#include <memory>
//
// Constructor
//
Binary_Expr_Node::Binary_Expr_Node (void):
rightChild(nullptr),
leftChild(nullptr),
Parent(nullptr)
{
}
//
// Destructor
//
Binary_Expr_Node::~Binary_Expr_Node (void)
{
//PROXY PATTERN TAKES CARE OF DESTRUCTION
}
//
// getRightChild
//
std::shared_ptr<Expr_Node> Binary_Expr_Node::getRightChild(void) //shared_ptr used for Proxy Pattern
{
return this->rightChild;
}
//
// getLeftChild
//
std::shared_ptr<Expr_Node> Binary_Expr_Node::getLeftChild(void) //shared_ptr used for Proxy Pattern
{
return this->leftChild;
}
//
// setRightChild
//
void Binary_Expr_Node::setRightChild(std::shared_ptr<Expr_Node> node) //shared_ptr used for Proxy Pattern
{
this->rightChild = node;
}
//
// setLeftChild
//
void Binary_Expr_Node::setLeftChild(std::shared_ptr<Expr_Node> node) //shared_ptr used for Proxy Pattern
{
this->leftChild = node;
}
//
// getParent
//
std::shared_ptr<Expr_Node> Binary_Expr_Node::getParent(void) //shared_ptr used for Proxy Pattern
{
return this->Parent;
}
//
// setParent
//
void Binary_Expr_Node::setParent(std::shared_ptr<Expr_Node> node) //shared_ptr used for Proxy Pattern
{
this->Parent = node;
}