home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ctdemo.zip / classes / @CLSLIB1.ZIP / cls / tutorial / splist.cpp < prev    next >
C/C++ Source or Header  |  1995-03-30  |  1KB  |  88 lines

  1. #ifndef INC_SPLIST
  2. #define INC_SPLIST
  3.  
  4. #ifndef __FIRST__
  5. #define __FIRST__
  6. #define __IMPL__SPLIST
  7. #endif
  8.  
  9. /////V Splist PCM f:\cls_ibm\cls\tutorial 1  PM 30.03.95 09:56:17
  10. /*
  11. /////H
  12. 20.10.94 19:37 PM 0 copied from: Splist TOS f:\cls_ibm\cls\tutorial 0 PM 19.10.94 00:26:00
  13. 30.03.95 10:34 PM 1 archived: Splist PCM f:\cls_ibm\cls\tutorial 1  PM 30.03.95 09:56:17
  14. /////
  15. */
  16.  
  17. /////1
  18. #undef inline
  19.  
  20. #include <bsa.h>
  21.  
  22. /////I Slist @ @ @ <void*> @ template pre class 
  23. #include <slist.cpp>
  24.  
  25.  
  26. #ifndef __INLINE__
  27. #define inline
  28. #endif
  29.  
  30. /////C Splist @ <class T> @ exercise template 
  31. template <class T>
  32. class Splist :
  33.  
  34. /////B Slist @ <void*> @ visible multiple 
  35. public  Slist<void*>
  36.  
  37. {
  38.  
  39. public:
  40.     inline void   append (T*);
  41.     inline T*  get ();
  42.     inline void   insert (T*);
  43. };
  44.  
  45.  
  46. /////2
  47. #undef inline
  48.  
  49.  
  50. #if (defined __INLINE__) || (defined __IMPL__SPLIST)
  51.  
  52. #ifndef __INLINE__
  53. #define inline
  54. #endif
  55.  
  56. /////F append @ @ public instance inline 
  57. template <class T> inline
  58. void Splist<T>:: append( T* p )
  59. {
  60.     Slist<void*>::append(p);
  61. }
  62.  
  63. /////F get @ @ public instance inline 
  64. template <class T> inline
  65. T* Splist<T>:: get()
  66. {
  67.     return (T*) Slist<void*>::get();
  68. }
  69.  
  70. /////F insert @ @ public instance inline 
  71. template <class T> inline
  72. void Splist<T>:: insert ( T* p )
  73. {
  74.     Slist<void*>::insert(p);
  75. }
  76.  
  77. /////
  78. #endif
  79.  
  80. /////3
  81. #undef inline
  82.  
  83. #ifdef __IMPL__SPLIST
  84. /////
  85. #endif
  86.  
  87. #endif
  88.