Posted By

itsok2kry on 10/17/08


Tagged


Versions (?)

Linked List (LinkedNode.h)


 / Published in: C++
 

  1. template < class T >
  2. class LinkedList;
  3.  
  4. template < class T >
  5. class LinkedNode
  6. {
  7. private:
  8. T value; // our generic value
  9. LinkedList< T > * list; // the linked list we're part of
  10. LinkedNode< T > * previousNode; // the previous node
  11. LinkedNode< T > * nextNode; // the next node
  12.  
  13. public:
  14. LinkedNode< T >( LinkedList< T > plist, LinkedNode< T > pNode, T * val ); // constructor
  15. LinkedNode< T > * next( void ); // return the next node
  16. LinkedNode< T > * previous( void ); // return the previous node
  17. T getValue( void ); // return the value we're holding
  18. void setNextNode( LinkedNode< T > next );
  19.  
  20. };

Report this snippet  

You need to login to post a comment.