-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.h
50 lines (45 loc) · 844 Bytes
/
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
/**
* @file : Node.h
* @author : Ethan Ward
* @date : 2015.02.12
* @brief: Creates Nodes and sets/gets their next pointers and values.
*/
#ifndef NODE_H
#define NODE_H
class Node {
public:
/**
* @pre None
* @post Creates and initializes a Node instance with m_next set to nullptr and m_value set to 0
* @return None
*/
Node();
/**
* @pre None
* @post Sets the value of a node to the number that is taken in.
* @return None
*/
void setValue(int val);
/**
* @pre None
* @post None
* @return Returns the value of a node
*/
int getValue();
/**
* @pre None
* @post Sets the pointer of a Node to the taken in Node pointer.
* @return None
*/
void setNext(Node* prev);
/**
* @pre None
* @post None
* @return Returns the pointer of a node.
*/
Node* getNext();
private:
int m_value;
Node* m_next;
};
#endif