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

  1. #ifndef  __RWGSLIST_H__
  2. #define  __RWGSLIST_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Declarations for General Singly-linked lists.
  7.  *
  8.  * $Header:   E:/vcs/rw/gslist.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/gslist.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:16   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 GSlist(type) name2(type,GSlist)
  43. #define GSlistIterator(type) name2(type,GSlistIterator)
  44.  
  45. #define GSlistdeclare(type)                            \
  46. class RWExport GSlist(type) : public RWSlist {                    \
  47. public:                                        \
  48.   GSlist(type)() { }                                \
  49.   GSlist(type)(type* a) : RWSlist(a) { }                    \
  50.   type* append(type* a)                                \
  51.     { return (type*)RWSlist::append(a); }                    \
  52.   type*& at(int i)                                \
  53.     { return (type*&)RWSlist::at(i); }                        \
  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.   void  apply(void (*ap)(type*, void*), void* x)                \
  59.     { RWSlist::apply((RWapplyGeneric)ap, x); }                    \
  60.   type* find(RWBoolean (*t)(const type*, const void*), const void* a) const    \
  61.     { return (type*)RWSlist::find((RWtestGeneric)t, a); }            \
  62.   type* findReference(const type* a) const                    \
  63.     { return (type*)RWSlist::findReference(a); }                \
  64.   type* first() const                                \
  65.     { return (type*)RWSlist::first(); }                        \
  66.   type* get()                                    \
  67.     { return (type*)RWSlist::get(); }                        \
  68.   type* insert(type* a)                                \
  69.     { return (type*)RWSlist::append(a); }                    \
  70.   type* insertAfter(int i, type* a)                        \
  71.     { return (type*)RWSlist::insertAfter(i,a); }                \
  72.   type* last() const                                \
  73.     { return (type*)RWSlist::last(); }                        \
  74.   unsigned occurrencesOf(RWBoolean (*t)(const type*, const void*), const void* a) const    \
  75.     { return RWSlist::occurrencesOf((RWtestGeneric)t, a); }            \
  76.   unsigned occurrencesOfReference(const type* a) const                \
  77.     { return RWSlist::occurrencesOfReference(a); }                \
  78.   type*  prepend(type* a)                            \
  79.     { return (type*)RWSlist::prepend(a); }                    \
  80.   type* remove(RWBoolean (*t)(const type*, const void*), const void* a)        \
  81.     { return (type*)RWSlist::remove((RWtestGeneric)t, a); }            \
  82.   type* removeReference(const type* a)                        \
  83.     { return (type*)RWSlist::removeReference(a); }                \
  84. };                                        \
  85.                                         \
  86. class RWExport GSlistIterator(type) : public RWSlistIterator {            \
  87. public:                                        \
  88.   GSlistIterator(type)(GSlist(type)& s) : RWSlistIterator(s) { }        \
  89.   type* findNext(RWBoolean (*t)(const type*, const void*), const void* a)    \
  90.     { return (type*)RWSlistIterator::findNext((RWtestGeneric)t, a); }        \
  91.   type* findNextReference(const type* a)                    \
  92.     { return (type*)RWSlistIterator::findNextReference(a); }            \
  93.   type* insertAfterPoint(type* a)                        \
  94.     { return (type*)RWSlistIterator::insertAfterPoint(a); }            \
  95.   type* key()                                    \
  96.     { return (type*)RWSlistIterator::key(); }                    \
  97.   type* operator()()                                \
  98.     { return (type*)RWSlistIterator::operator()(); }                \
  99.   type* remove()                                \
  100.     { return (type*)RWSlistIterator::remove(); }                \
  101.   type* removeNext(RWBoolean (*t)(const type*, const void*), const void* a)    \
  102.     { return (type*)RWSlistIterator::removeNext((RWtestGeneric)t, a); }        \
  103.   type* removeNextReference(const type* a)                    \
  104.     { return (type*)RWSlistIterator::removeNextReference(a); }            \
  105. };
  106.  
  107. pragma pop_align_members();
  108. #endif /* __RWGSLIST_H__ */
  109.