home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / DICTLIST.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  4KB  |  128 lines

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: odutils
  5. //
  6. //   CLASSES:   DictionaryList
  7. //
  8. //   ORIGINS: 82,27
  9. //
  10. //
  11. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12. //   All Rights Reserved
  13. //   Licensed Materials - Property of IBM
  14. //   US Government Users Restricted Rights - Use, duplication or
  15. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16. //       
  17. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. //   OR PERFORMANCE OF THIS SOFTWARE.
  24. //
  25. //====END_GENERATED_PROLOG========================================
  26. //
  27. // @(#) 1.3 com/src/utils/include/DictList.h, odutils, od96os2, odos29646d 7/15/96 17:59:59 [ 11/15/96 15:28:58 ]
  28. /*
  29.     File:        DictList.h
  30.  
  31.     Contains:    Definition of class DictionaryList
  32.  
  33.     Owned by:    Richard Rodseth
  34.  
  35.     Copyright:    ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  36.     
  37. */
  38.  
  39. #ifndef _DICTLIST_
  40. #define _DICTLIST_
  41.  
  42. #ifndef _ODTYPES_
  43. #include "ODTypes.h"
  44. #endif
  45.  
  46. #ifndef _PLFMDEF_
  47. #include "PlfmDef.h"
  48. #endif
  49.  
  50. #ifndef _LINKLIST_
  51. #include "LinkList.h"
  52. #endif
  53.  
  54. //==============================================================================
  55. // Theory of Operation
  56. //==============================================================================
  57.  
  58. // OrdereCollection is an ordered collection of elements of type void* (since
  59. // we can't use templates)
  60. // Duplicates are allowed.
  61.  
  62. //==============================================================================
  63. // Constants
  64. //==============================================================================
  65.  
  66. //==============================================================================
  67. // Scalar Types
  68. //==============================================================================
  69.  
  70. typedef void* KeyType;
  71. typedef void* ValueType;
  72.  
  73. //=====================================================================================
  74. // Classes defined in this interface
  75. //=====================================================================================
  76.  
  77. class DictionaryList;    
  78.  
  79. //=====================================================================================
  80. // Classes used by this interface
  81. //=====================================================================================
  82.  
  83. class Association; // Defined in implementation
  84.  
  85. //=====================================================================================
  86. // Global Variables
  87. //=====================================================================================
  88.  
  89.  
  90. //=====================================================================================
  91. // Class DictionaryList
  92. //=====================================================================================
  93.  
  94. class DictionaryList
  95. {
  96.     
  97.  
  98. public:
  99.  
  100.     DictionaryList();
  101.     virtual ~DictionaryList();
  102.  
  103.     ODVMethod void    AddPair(KeyType key, ValueType value);
  104.     
  105.     ODVMethod ODULong Count();
  106.     ODVMethod ODBoolean ContainsKey(KeyType key);
  107.     ODVMethod ValueType ValueAtKey(KeyType key);
  108.  
  109.     ODVMethod void    RemoveKey(KeyType key);
  110.     ODVMethod void    RemoveAll();            
  111.     ODVMethod void    DeleteKeys();
  112.     ODVMethod void    DeleteValues();
  113.     ODVMethod void    DeleteSOMValues();
  114.     
  115. protected:
  116.  
  117.      ODVMethod Association* CreateNewAssociation(KeyType key, ValueType value) const;
  118.      ODVMethod ODBoolean    KeysMatch(KeyType key1,KeyType key2) const;
  119.      
  120.          // Does a straight == comparison by default 
  121.  
  122. private:
  123.  
  124.     LinkedList        fImplementation;
  125. };
  126.  
  127. #endif // _DICTLIST_
  128.