home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 6.ddi / MWHC.006 / B1 < prev    next >
Encoding:
Text File  |  1992-06-07  |  2.7 KB  |  72 lines

  1. #ifndef  __RWGQUEUE_H__
  2. #define  __RWGQUEUE_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for General Queues, implemented as a singly-linked list.
  7.  *
  8.  * $Header:   E:/vcs/rw/gqueue.h_v   1.3   18 Feb 1992 19:23:00   KEFFER  $
  9.  *
  10.  ****************************************************************************
  11.  *
  12.  * Rogue Wave 
  13.  * P.O. Box 2328
  14.  * Corvallis, OR 97339
  15.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  16.  *
  17.  * Copyright (C) 1989, 1990, 1991. This software is subject to copyright 
  18.  * protection under the laws of the United States and other countries.
  19.  *
  20.  ***************************************************************************
  21.  *
  22.  * $Log:   E:/vcs/rw/gqueue.h_v  $
  23.  * 
  24.  *    Rev 1.3   18 Feb 1992 19:23:00   KEFFER
  25.  * Now includes "rw/generic.h".
  26.  * Class tag is now RWExport instead of huge.
  27.  * 
  28.  *    Rev 1.2   28 Oct 1991 09:08:14   keffer
  29.  * Changed inclusions to <rw/xxx.h>
  30.  * 
  31.  *    Rev 1.1   09 Oct 1991 18:34:32   keffer
  32.  * Ported to Zortech V3.0
  33.  * 
  34.  *    Rev 1.0   28 Jul 1991 08:11:20   keffer
  35.  * Tools.h++ V4.0.5 PVCS baseline version
  36.  *
  37.  */
  38.  
  39. #include "rw/slist.h"
  40. #include "rw/generic.h"
  41.  
  42. #define GQueue(type) name2(type,GQueue)
  43.  
  44. #define GQueuedeclare(type)                            \
  45. class RWExport GQueue(type) : private RWSlist {                    \
  46. public:                                        \
  47.   GQueue(type)() { }                                \
  48.   GQueue(type)(type* a) : RWSlist(a) { }                    \
  49.   GQueue(type)(const GQueue(type)& q) : RWSlist(q) { }                \
  50.   void operator=(const GQueue(type)& q) { RWSlist::operator=(q);}        \
  51.                                         \
  52.   type* append(type* a)        {return (type*)RWSlist::append(a);}        \
  53.   void clear() {RWSlist::clear();}                        \
  54.   RWBoolean contains(RWBoolean (*t)(const type*, const void*), const void* a) const    \
  55.     {return RWSlist::contains((RWtestGeneric)t, a);}                \
  56.   RWBoolean containsReference(const type* a) const                \
  57.     {return RWSlist::containsReference(a);}                    \
  58.   unsigned entries() const    {return RWSlist::entries();}            \
  59.   type* first() const        {return (type*)RWSlist::first(); }        \
  60.   type* get()            {return (type*)RWSlist::get(); }        \
  61.   type* insert(type* a)        {return (type*)RWSlist::append(a);}        \
  62.   RWBoolean isEmpty() const    {return RWSlist::isEmpty();}            \
  63.   type* last() const        {return (type*)RWSlist::last(); }        \
  64.   unsigned occurrencesOf(RWBoolean (*t)(const type*, const void*), const void* a) const\
  65.     {return RWSlist::occurrencesOf((RWtestGeneric)t, a);}            \
  66.   unsigned occurrencesOfReference(const type* a) const                \
  67.     {return RWSlist::occurrencesOfReference(a);}                \
  68. };                                                              
  69.                                                                 
  70. pragma pop_align_members();
  71. #endif /* __RWGQUEUE_H__ */
  72.