home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 1.ddi / CLASSINC.ZIP / RESOURCE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-13  |  2.8 KB  |  94 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. // Contents ----------------------------------------------------------------
  4. //
  5. //      DESIGN_LIMIT_ON_DEFAULT_HASH_TABLE_SIZE
  6. //      DEFAULT_HASH_TABLE_SIZE
  7. //
  8. //      DESIGN_LIMIT_ON_DEFAULT_BAG_SIZE
  9. //      DEFAULT_BAG_SIZE
  10. //
  11. //      DESIGN_LIMIT_ON_DEFAULT_SET_SIZE
  12. //      DEFAULT_SET_SIZE
  13. //
  14. // Description
  15. //
  16. //      Defines resource constants for C++ class library.
  17. //
  18. // End ---------------------------------------------------------------------
  19.  
  20. // Interface Dependencies ---------------------------------------------------
  21.  
  22. #ifndef __RESOURCE_H
  23. #define __RESOURCE_H
  24.  
  25. #ifndef __LIMITS_H
  26. #include <limits.h>
  27. #define __LIMITS_H
  28. #endif
  29.  
  30. // End Interface Dependencies ------------------------------------------------
  31.  
  32. // LiteralSection ----------------------------------------------------------
  33. //
  34. //      hash table size
  35. //
  36. // Description
  37. //
  38. //      Defines the limit on a hash table's size and the default size.
  39. //      Also defines limits and defaults for derived types of class HashTable.
  40. //
  41. // End ---------------------------------------------------------------------
  42.  
  43. #define DESIGN_LIMIT_ON_DEFAULT_HASH_TABLE_SIZE     UINT_MAX
  44.  
  45. //
  46. //      The hash table size is defined as a sizeType, which is an 
  47. //      unsigned int.
  48. //
  49.  
  50. #define DEFAULT_HASH_TABLE_SIZE                     111
  51.  
  52. //
  53. //      We make a fair size default hash table.  If you care to change
  54. //      the default size, you may do so without harm, as long as your
  55. //      default value does not exceed the design limit on the maximum
  56. //      size for a hash table.  Keep in mind that a hash table is more
  57. //      efficient if the size is a prime number.
  58. //
  59.  
  60. #define DESIGN_LIMIT_ON_DEFAULT_BAG_SIZE                                    (\
  61.                                 DESIGN_LIMIT_ON_DEFAULT_HASH_TABLE_SIZE     \
  62.                                                                             )
  63. //
  64. //      Class Bag is derived from class HashTable and therefore gets the
  65. //      same design limit.
  66. //
  67.  
  68. #define DEFAULT_BAG_SIZE                            29
  69.  
  70. //
  71. //      Bags are usually smaller than hash tables.  Of course, if this
  72. //      were a grocery bag, the default would be much smaller.
  73. //
  74.  
  75. #define DESIGN_LIMIT_ON_DEFAULT_SET_SIZE                                    (\
  76.                                 DESIGN_LIMIT_ON_DEFAULT_BAG_SIZE            \
  77.                                                                             )
  78. //
  79. //      Class Set is derived from class Bag and therefore gets the
  80. //      same design limit.
  81. //
  82.  
  83. #define DEFAULT_SET_SIZE                            29
  84.  
  85. //
  86. //      Bags and sets are usually the same size.
  87. //
  88.  
  89. // End LiteralSection hash table size //
  90.  
  91. #endif // ifndef __RESOURCE_H //
  92.  
  93.  
  94.