-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInteger_Node.h
75 lines (58 loc) · 1.36 KB
/
Integer_Node.h
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
#ifndef _INTEGER_NODE_H_
#define _INTEGER_NODE_H_
#include "Expr_Node.h"
#include "Visitor.h"
#include <memory>
/**
* @class Integer_Node
*
* Handles all integer numbers, both positive and negative
*/
class Integer_Node : public Expr_Node
{
public:
/// Constructor
Integer_Node (int number);
/// Destructor
virtual ~Integer_Node (void);
/**
* accept
*
* traverses the tree
* @param[in] &Visitor a reference to the visitor class
*
*/
virtual void accept (Visitor & visitor);
/**
* Priority
*
*
* @return priority an integer giving the priority of the operator
*/
virtual int Priority (void);
/**
* getParent
*
* @return *Expr_Node a pointer to the parent node
*/
virtual std::shared_ptr<Expr_Node> getParent (void); //shared_ptr used for Proxy Pattern
/**
* setParent
*
* @param[in] *Expr_Node the node to be placed as the left child
*/
virtual void setParent ( std::shared_ptr<Expr_Node> node); //shared_ptr used for Proxy Pattern
///getter for int_value
int getValue (void);
protected:
std::shared_ptr<Expr_Node> Parent; //shared_ptr used for Proxy Pattern
private:
int int_value;
};
#endif // !defined _INTEGER_NODE_H_