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

  1. #ifndef  __RWGDLIST_H__
  2. #define  __RWGDLIST_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for General Doubly-linked lists.
  7.  *
  8.  * $Header:   E:/vcs/rw/gdlist.h_v   1.3   18 Feb 1992 19:22:58   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/gdlist.h_v  $
  23.  * 
  24.  *    Rev 1.3   18 Feb 1992 19:22:58   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:18   keffer
  35.  * Tools.h++ V4.0.5 PVCS baseline version
  36.  *
  37.  */
  38.  
  39. #include "rw/dlist.h"
  40. #include "rw/generic.h"
  41.  
  42. #define GDlist(type) name2(type,GDlist)
  43. #define GDlistIterator(type) name2(type,GDlistIterator)
  44.  
  45. #define GDlistdeclare(type)                            \
  46. class RWExport GDlist(type) : public RWDlist {                    \
  47. public:                                        \
  48.   GDlist(type)() { }                                \
  49.   GDlist(type)(type* a) : RWDlist(a) { }                    \
  50.   type* append(type* a)                                \
  51.     { return (type*)RWDlist::append(a); }                    \
  52.   type*& at(int i)                                \
  53.     { return (type*&)RWDlist::at(i); }                        \
  54.   RWBoolean contains( RWBoolean (*t)(const type*, const void*), const void* a) const\
  55.     { return RWDlist::contains((RWtestGeneric)t, a); }                \
  56.   RWBoolean containsReference(const type* a) const                \
  57.     { return RWDlist::containsReference(a); }                    \
  58.   void  apply(void (*ap)(type*, void*), void* x)                 \
  59.     { RWDlist::apply((RWapplyGeneric)ap, x); }                    \
  60.   type* find(RWBoolean (*t)(const type*, const void*), const void* a) const    \
  61.     { return (type*)RWDlist::find((RWtestGeneric)t, a); }            \
  62.   type* findReference(const type* a) const                    \
  63.     { return (type*)RWDlist::findReference(a); }                \
  64.   type* first() const                                \
  65.     { return (type*)RWDlist::first(); }                        \
  66.   type* get()                                    \
  67.     { return (type*)RWDlist::get(); }                        \
  68.   type* insert(type* a)                                \
  69.     { return (type*)RWDlist::append(a); }                    \
  70.   type* insertAfter(int i, type* a)                        \
  71.     { return (type*)RWDlist::insertAfter(i,a); }                \
  72.   type* last() const                                \
  73.     { return (type*)RWDlist::last(); }                        \
  74.   unsigned occurrencesOf(RWBoolean (*t)(const type*, const void*), const void* a) const    \
  75.     { return RWDlist::occurrencesOf((RWtestGeneric)t, a); }            \
  76.   unsigned occurrencesOfReference(const type* a) const                \
  77.     { return RWDlist::occurrencesOfReference(a); }                \
  78.   type*  prepend(type* a)                            \
  79.     { return (type*)RWDlist::prepend(a); }                    \
  80.   type* remove(RWBoolean (*t)(const type*, const void*), const void* a)        \
  81.     { return (type*)RWDlist::remove((RWtestGeneric)t, a); }            \
  82.   type* removeReference(const type* a)                        \
  83.     { return (type*)RWDlist::removeReference(a); }                \
  84. };                                        \
  85.                                         \
  86. class RWExport GDlistIterator(type) : public RWDlistIterator {            \
  87. public:                                        \
  88.   GDlistIterator(type)(GDlist(type)& s) : RWDlistIterator(s) { }        \
  89.   type* findNext(RWBoolean (*t)(const type*, const void*), const void* a)    \
  90.     { return (type*)RWDlistIterator::findNext((RWtestGeneric)t, a); }        \
  91.   type* findNextReference(const type* a)                    \
  92.     { return (type*)RWDlistIterator::findNextReference(a); }            \
  93.   type* insertAfterPoint(type* a)                        \
  94.     { return (type*)RWDlistIterator::insertAfterPoint(a); }            \
  95.   type* key() const {return (type*)RWDlistIterator::key();}            \
  96.   type* operator()() {return (type*)(RWDlistIterator::operator()()); }        \
  97.   type* remove() {return (type*)RWDlistIterator::remove();}            \
  98.   type* removeNext(RWBoolean (*t)(const type*, const void*), const void* a)    \
  99.     {return (type*)RWDlistIterator::removeNext((RWtestGeneric)t, a);}        \
  100.   type* removeNextReference(const type* a)                    \
  101.     {return (type*)RWDlistIterator::removeNextReference(a);}            \
  102. };
  103.  
  104. pragma pop_align_members();
  105. #endif /* __RWGDLIST_H__ */
  106.