1 // File: NCollection_DefineDataMap.hxx
2 // Created: Thu Apr 24 15:02:53 2002
3 // Author: Alexander KARTOMIN (akm)
4 // <akm@opencascade.com>
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.
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 :
15 // anItem = aMap(aKey);
16 // aMap(aKey) = anItem;
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.
23 #ifndef NCollection_DefineDataMap_HeaderFile
24 #define NCollection_DefineDataMap_HeaderFile
26 #include <NCollection_DefineBaseCollection.hxx>
27 #include <NCollection_DataMap.hxx>
30 // Disable the warning "operator new unmatched by delete"
31 #pragma warning (disable:4291)
34 // *********************************************** Class DataMap *************
36 #define DEFINE_DATAMAP(_ClassName_, _BaseCollection_, TheKeyType, TheItemType) \
37 typedef NCollection_DataMap<TheKeyType, TheItemType > _ClassName_;