forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListNode.h
34 lines (25 loc) · 818 Bytes
/
ListNode.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
/*
* Filename: ListNode.h
* Description: ListNode class definition
*/
#ifndef LISTNODE_H
#define LISTNODE_H
#include <iostream>
// next line needed because NULL is part of std namespace
using namespace std;
class ListNode {
public:
ListNode(); // Constructor
private:
int value;
ListNode *next, *previous; // for doubly linked lists
// List needs to be able to access/change ListNode's next and
// previous pointers
friend class List;
// ListItr needs to access/change ListNode as well
friend class ListItr;
// Not writing a destructor is fine in this case since there is no
// dynamically allocated memory in this class. No constructor is
// necessary, as an object will be set up by the List class.
};
#endif