Node.h

00001 #ifndef _NODE_H_
00002 #define _NODE_H_
00003 
00004 #include <memory.h>
00005 #include <windows.h>
00006 #include "ZakEngine/defines.h"
00007 
00008 namespace zak {
00009 
00010 template <class LIST_TYPE>
00011 
00012 class Node 
00013 {
00014 
00015 public:
00016 
00017         // set the value of an element
00018         void SetElement(LIST_TYPE Element) 
00019         {
00020                 m_Element = Element;
00021         }
00022 
00023         //Set the Next list pointer
00024         void SetNextNode(Node<LIST_TYPE> *pNext)
00025         {
00026                 m_pNext = pNext;
00027         }
00028 
00029         void SetPreviousNode(Node<LIST_TYPE> *pPrevious)
00030         {
00031                 m_pPrevious = pPrevious;
00032         }
00033         // Read Element 
00034         LIST_TYPE GetElement()
00035         {
00036                 return m_Element;
00037         }
00038 
00039         // Read Next
00040         Node<LIST_TYPE> *GetNextNode()
00041         {
00042                 return m_pNext;
00043         }
00044 
00045         Node<LIST_TYPE> *GetPreviousNode()
00046         {
00047                 return m_pPrevious;
00048         }
00049         
00050         // Constructor
00051         Node()
00052         {
00053                 m_pNext = NULL;
00054                 m_pPrevious = NULL;
00055         }
00056 
00057         // Copy Constructor
00058         Node(const Node<LIST_TYPE> &copyFrom)
00059         {
00060                 
00061         }
00062 
00063         // Constructor that initialize an element       
00064         Node(LIST_TYPE Element)
00065         {
00066                 m_Element = Element;
00067                 m_pNext = NULL;
00068                 m_pPrevious = NULL;
00069         }
00070 
00071         // Destructor
00072         ~Node()
00073         {
00074                 if (m_pNext != NULL) {
00075                         delete m_pNext;
00076                 }
00077         }
00078 
00079 private:
00080         LIST_TYPE                        m_Element;                     // type Element
00081         Node<LIST_TYPE>  *m_pNext;                      // pointer to next
00082         Node<LIST_TYPE>  *m_pPrevious;          // pointer to previous
00083 };
00084 
00085 } // end namespace
00086 
00087 #endif // _NODE_H_

Generado el Tue May 29 14:46:14 2007 para Zak Engine v1.1.0 por  doxygen 1.5.1-p1