0024911: Avoid using virtual functions in NCollection classes
[occt.git] / src / NCollection / NCollection_DefineMap.hxx
b311480e 1// Created on: 2002-04-23
2// Created by: Alexander KARTOMIN (akm)
973c2be1 3// Copyright (c) 2002-2014 OPEN CASCADE SAS
7fd59977 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// Purpose: Single hashed Map. This Map is used to store and
17// retrieve keys in linear time.
7fd59977 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.
7fd59977 21// To compute the hashcode of the key the function
22// ::HashCode must be defined in the global namespace
7fd59977 23// To compare two keys the function ::IsEqual must be
24// defined in the global namespace.
7fd59977 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
30// number of buckets.
7fd59977 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.
7fd59977 36
37#ifndef NCollection_DefineMap_HeaderFile
38#define NCollection_DefineMap_HeaderFile
7fd59977 40#include <NCollection_Map.hxx>
7fd59977 42// *********************************************** Class Map *****************
44#define DEFINE_MAP(_ClassName_, _BaseCollection_, TheKeyType) \
b311480e 45typedef NCollection_Map <TheKeyType > _ClassName_;
7fd59977 46