home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / SCL.EXE / GENNODE.H < prev    next >
C/C++ Source or Header  |  1994-07-20  |  2KB  |  70 lines

  1.  
  2. #ifndef gennode_h
  3. #define gennode_h
  4.  
  5. /*
  6. * NIST Utils Class Library
  7. * clutils/gennode.h
  8. * February, 1994
  9. * David Sauder
  10. * K. C. Morris
  11.  
  12. * Development of this software was funded by the United States Government,
  13. * and is not subject to copyright.
  14. */
  15.  
  16. /* $Id: gennode.h,v 2.0.1.2 1994/04/05 16:44:01 sauderd Exp $  */ 
  17.  
  18. #ifdef __O3DB__
  19. #include <OpenOODB.h>
  20. #endif
  21.  
  22. #include <iostream.h>
  23. class GenNodeList;
  24. class MgrNodeList;
  25. class DisplayNodeList;
  26.  
  27. //////////////////////////////////////////////////////////////////////////////
  28. // GenericNode
  29. // If you delete this object it first removes itself from any list it is in.
  30. //////////////////////////////////////////////////////////////////////////////
  31.  
  32. class GenericNode
  33. {
  34. friend GenNodeList;
  35. friend MgrNodeList;
  36. friend DisplayNodeList;
  37.  
  38. protected:
  39.     GenericNode *next;
  40.     GenericNode *prev;
  41. public:
  42.     GenericNode()    { next = 0; prev = 0; }
  43.     virtual ~GenericNode()    { Remove(); }
  44.     GenericNode *Next()    { return next; }
  45.     GenericNode *Prev()    { return prev; }
  46.     virtual void Append(GenNodeList *list);
  47.     virtual void Remove()
  48.     {
  49.     (next) ? (next->prev = prev) : 0;
  50.     (prev) ? (prev->next = next) : 0;
  51. /*
  52. //    if(next)
  53. //        next->prev = prev;
  54. //    if(prev)
  55. //        prev->next = next;
  56. */
  57.     next = 0;
  58.     prev = 0;
  59.  
  60.     }
  61. };
  62.  
  63. //////////////////////////////////////////////////////////////////////////////
  64. // GenericNode inline functions
  65. // these functions don't rely on any inline functions (its own or
  66. //    other classes) that aren't in this file
  67. //////////////////////////////////////////////////////////////////////////////
  68.  
  69. #endif
  70.