-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoublylinkedlistnode.h
More file actions
executable file
·68 lines (48 loc) · 1.46 KB
/
Copy pathdoublylinkedlistnode.h
File metadata and controls
executable file
·68 lines (48 loc) · 1.46 KB
1
/***************************************************************************** ** File: doublylinkedlistnode.h ** ** Author: Robb T. Koether ** ** Date: Mar 8, 2007 ** ** Purpose: This file defines the DoublyLinkedListNode template class ** *****************************************************************************/#ifndef DOUBLYLINKEDLISTNODE_H#define DOUBLYLINKEDLISTNODE_H// Header files#include <iostream>// Forward class definitionstemplate <class T>class DoublyLinkedList;template <class T>class CircLinkedList;using namespace std;/***************************************************************************** ** The DoublyLinkedListNode class definition ** *****************************************************************************/template <class T>class DoublyLinkedListNode{// Friends friend class DoublyLinkedList<T>; friend class CircLinkedList<T>;// Public member functions public: T& value() {return data;} DoublyLinkedListNode<T>* nextNode() {return next;} DoublyLinkedListNode<T>* prevNode() {return prev;}// Private member functions private: DoublyLinkedListNode(const T& value = T()) {data = value; next = prev = NULL;}// Data members private: T data; DoublyLinkedListNode<T>* next; DoublyLinkedListNode<T>* prev;};#endif