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

  1. #ifndef __RWBTRDICT_H__
  2. #define __RWBTRDICT_H__
  3. pragma push_align_members(64);
  4.  
  5. /*
  6.  * RWBTreeDictionary --- Dictionary implemented as an in memory B-Tree
  7.  *
  8.  * $Header:   E:/vcs/rw/btrdict.h_v   1.2   18 Feb 1992 09:54:08   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.  * $Log:   E:/vcs/rw/btrdict.h_v  $
  22.  * 
  23.  *    Rev 1.2   18 Feb 1992 09:54:08   KEFFER
  24.  * 
  25.  *    Rev 1.1   28 Oct 1991 09:08:08   keffer
  26.  * Changed inclusions to <rw/xxx.h>
  27.  * 
  28.  *    Rev 1.0   28 Jul 1991 08:12:36   keffer
  29.  * Tools.h++ V4.0.5 PVCS baseline version
  30.  *
  31.  */
  32.  
  33. /*
  34.  * For the storage and retrieval of (key, value) pairs.
  35.  */
  36.  
  37. #include "rw/btree.h"
  38. #include "rw/colclass.h"
  39.  
  40. class RWExport RWBTreeDictionary : public RWBTree {
  41. public:
  42.   RWBTreeDictionary();
  43.   ~RWBTreeDictionary();
  44.  
  45.   void                applyToKeyAndValue(RWapplyKeyAndValue, void*);
  46.   virtual void            clear();
  47.   virtual void            clearAndDestroy();
  48.   virtual RWCollectable*    find(const RWCollectable* key) const;  // Returns value 
  49.   RWCollectable*        findKeyAndValue(const RWCollectable* key, RWCollectable*& value) const;
  50.   RWCollectable*        findValue(const RWCollectable*) const;    // Returns value
  51.   RWCollectable*        findValue(const RWCollectable*, RWCollectable*) const; // Replace value.
  52.   RWCollectable*        insertKeyAndValue(RWCollectable* key, RWCollectable* val);
  53.   virtual ClassID        isA() const {return __RWBTREEDICTIONARY;}
  54.   virtual RWCollectable*    newSpecies() const;
  55.   virtual RWCollectable*    remove(const RWCollectable* key); // Returns value
  56.   virtual void            removeAndDestroy(const RWCollectable*); 
  57.   RWCollectable*        removeKeyAndValue(const RWCollectable* key, RWCollectable*& value);
  58. };
  59.  
  60. pragma pop_align_members();
  61. #endif /* __RWBTRDICT_H__ */
  62.