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

  1. #ifndef __RWSEQCLTN_H__
  2. #define __RWSEQCLTN_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * Abstract base class for sequenceable collections.
  7.  *
  8.  * $Header:   E:/vcs/rw/seqcltn.h_v   1.2   18 Feb 1992 09:54:44   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.  * This is an abstract base class, inherited by collections whose
  23.  * elements are ordered and accessible by an index.
  24.  *
  25.  * $Log:   E:/vcs/rw/seqcltn.h_v  $
  26.  * 
  27.  *    Rev 1.2   18 Feb 1992 09:54:44   KEFFER
  28.  * 
  29.  *    Rev 1.1   28 Oct 1991 09:08:22   keffer
  30.  * Changed inclusions to <rw/xxx.h>
  31.  * 
  32.  *    Rev 1.0   28 Jul 1991 08:16:54   keffer
  33.  * Tools.h++ V4.0.5 PVCS baseline version
  34.  *
  35.  */
  36.  
  37. #include "rw/colclass.h"
  38.  
  39. class RWExport RWSequenceable : public RWCollection {
  40.  
  41. public:
  42.  
  43.   /************ Virtual functions inherited from RWCollection *************/
  44.   virtual void            apply(RWapplyCollectable, void*) = 0;
  45.   virtual void            clear() = 0;
  46. //virtual void            clearAndDestroy();
  47. //virtual RWBoolean        contains(const RWCollectable*) const;
  48.   virtual unsigned        entries() const = 0;    // Total entries
  49.   virtual RWCollectable*    find(const RWCollectable*) const = 0;        // First occurrence
  50.   virtual RWCollectable*    insert(RWCollectable*) = 0;
  51.   virtual RWBoolean        isEmpty() const = 0;
  52.   virtual unsigned        occurrencesOf(const RWCollectable*) const = 0;
  53.   virtual RWCollectable*    remove(const RWCollectable*) = 0;    // Remove first occurrence
  54. //virtual void            removeAndDestroy(const RWCollectable*); 
  55.  
  56. public:
  57.  
  58.   /****************  Added virtual functions for RWSequenceables ****************/
  59.   virtual RWCollectable*    append(RWCollectable*) = 0;
  60.   virtual RWCollectable*&    at(int) = 0; // Some collections can use as lvalue
  61. #ifdef CONST_OVERLOADS
  62.   virtual const RWCollectable*    at(int) const = 0; // Cannot use as lvalue
  63. #endif
  64.   virtual RWCollectable*    first() const = 0;
  65.   virtual int            index(const RWCollectable*) const = 0;
  66.   virtual RWCollectable*    insertAfter(int, RWCollectable*) = 0;
  67.   virtual RWCollectable*    last() const = 0;
  68.   virtual RWCollectable*    prepend(RWCollectable*) = 0;
  69. };
  70.  
  71. pragma pop_align_members();
  72. #endif /* __RWSEQCLTN_H__ */
  73.