home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / OS Queues / OSQueue.h < prev    next >
Encoding:
Text File  |  1998-04-17  |  524 b   |  35 lines  |  [TEXT/CWIE]

  1. // OSQueue.h
  2.  
  3. #ifndef OSQueue_h
  4. #define OSQueue_h
  5.  
  6. #ifndef OSQueueBase_h
  7. #include "OSQueueBase.h"
  8. #endif
  9. #ifndef OSQueueLink_h
  10. #include "OSQueueLink.h"
  11. #endif
  12.  
  13. template < class Target >
  14. class OSQueue: private OSQueueBase
  15.   {
  16.     public:
  17.         OSQueueBase::IsEmpty;
  18.         
  19.         void Put( OSQueueLink<Target>& link )
  20.           {
  21.             OSQueueBase::Put( link );
  22.           }
  23.         
  24.         Target *Get()
  25.           {
  26.             OSQueueLinkBase *got = OSQueueBase::Get();
  27.             if ( got == 0 )
  28.                 return 0;
  29.             
  30.             return *static_cast< OSQueueLink<Target>* >( got );
  31.           }
  32.   };
  33.  
  34. #endif
  35.