-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.hpp
54 lines (40 loc) · 1.08 KB
/
Node.hpp
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
#ifndef Node_
#define Node_
#include <iostream>
template<class ItemType>
class Node {
public:
/*
Default Constructor
*/
Node();
/*
Parametarized Constructor
@param item - the item to be constructed
@param next_node - the next node to point to
*/
Node(const ItemType& item, Node<ItemType> *next_node = nullptr);
/*
Setter function for node item
@param anItem - the item to be set in item_
*/
void setItem(const ItemType &anItem);
/*
Setter function for pointer to next node in chain
@param nextNodePtr - the nextNodePtr to be set in next_
*/
void setNext(Node<ItemType> *nextNodePtr);
/*
@return returns the value for item_
*/
ItemType getItem() const;
/*
@return returns the value for next_
*/
Node<ItemType> *getNext() const;
private:
ItemType item_;
Node<ItemType> *next_;
};
#include "Node.cpp"
#endif