-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.h
More file actions
49 lines (40 loc) · 788 Bytes
/
Copy pathnode.h
File metadata and controls
49 lines (40 loc) · 788 Bytes
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
#ifndef NODE_H
#define NODE_H
#include <iostream>
#include <string>
#include <new>
using namespace std;
template <typename T>
class Node {
private:
T object;
Node<T> *nextPtr;
public:
Node (const T &object =Node());
void setObject(const T&);
T & getObject();
void setNextPtr(Node<T> *nextPtr);
Node<T>* getNextPtr() const;
};
template <typename T>
Node<T>::Node(const T &object){
this->object = object;
this->nextPtr = 0;
}
template <typename T>
void Node <T>::setObject(const T &object){
this->object=object;
}
template <typename T>
T& Node <T>::getObject(){
return object;
}
template <typename T>
void Node<T>::setNextPtr(Node<T> *nextPtr){
this->nextPtr=nextPtr;
}
template <typename T>
Node<T>* Node<T>::getNextPtr() const{
return nextPtr;
}
#endif