1 // Created on: 2002-04-23
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Purpose: Single hashed Map. This Map is used to store and
17 // retrieve keys in linear time.
18 // The ::Iterator class can be used to explore the
19 // content of the map. It is not wise to iterate and
20 // modify a map in parallel.
21 // To compute the hashcode of the key the function
22 // ::HashCode must be defined in the global namespace
23 // To compare two keys the function ::IsEqual must be
24 // defined in the global namespace.
25 // The performance of a Map is conditionned by its
26 // number of buckets that should be kept greater to
27 // the number of keys. This map has an automatic
28 // management of the number of buckets. It is resized
29 // when the number of Keys becomes greater than the
31 // If you have a fair idea of the number of objects
32 // you can save on automatic resizing by giving a
33 // number of buckets at creation or using the ReSize
34 // method. This should be consider only for crucial
35 // optimisation issues.
37 #ifndef NCollection_DefineMap_HeaderFile
38 #define NCollection_DefineMap_HeaderFile
40 #include <NCollection_DefineBaseCollection.hxx>
41 #include <NCollection_Map.hxx>
43 // *********************************************** Class Map *****************
45 #define DEFINE_MAP(_ClassName_, _BaseCollection_, TheKeyType) \
46 typedef NCollection_Map <TheKeyType > _ClassName_;