09a9ff26c78afa83ed537d4c4efeed7509d0c4ee
[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 #ifdef WNT
30 // Disable the warning "operator new unmatched by delete"
31 #pragma warning (disable:4291)
32 #endif
33
34 // *********************************************** Class DataMap *************
35
36 #define DEFINE_DATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \
37         typedef NCollection_DataMap<TheKeyType, TheItemType > _ClassName_;
38
39 #endif