9882cf4b3f7eb1dcd7e304962270d8b1bd623c26
[occt.git] / src / NCollection / NCollection_DefineDataMap.hxx
1 // File:        NCollection_DefineDataMap.hxx
2 // Created:     Thu Apr 24 15:02:53 2002
3 // Author:      Alexander KARTOMIN (akm)
4 //              <akm@opencascade.com>
5 //              
6 // Purpose:     The DataMap is a Map to store keys with associated
7 //              Items. See Map  from NCollection for  a discussion
8 //              about the number of buckets.
9 //
10 //              The DataMap can be seen as an extended array where
11 //              the Keys  are the   indices.  For this reason  the
12 //              operator () is defined on DataMap to fetch an Item
13 //              from a Key. So the following syntax can be used :
14 //
15 //              anItem = aMap(aKey);
16 //              aMap(aKey) = anItem;
17 //
18 //              This analogy has its  limit.   aMap(aKey) = anItem
19 //              can  be done only  if aKey was previously bound to
20 //              an item in the map.
21 //              
22
23 #ifndef NCollection_DefineDataMap_HeaderFile
24 #define NCollection_DefineDataMap_HeaderFile
25
26 #include <NCollection_DefineBaseCollection.hxx>
27 #include <NCollection_DataMap.hxx>
28
29 // *********************************************** Class DataMap *************
30
31 #define DEFINE_DATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \
32         typedef NCollection_DataMap<TheKeyType, TheItemType > _ClassName_;
33
34 #endif