OpenASIP  2.0
hash_map.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file hash_map.hh
26  *
27  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
28  *
29  * Definition for a hash map.
30  *
31  * Hash map provides amortized constant time access for situations in which
32  * the keys need not to be stored in sorted order. hash_map is not provided
33  * by STL. It's usually provided as an STL extension. For example, SGI STL
34  * implements it. This header selects the best possible implementation
35  * for hash_map available in the system.
36  */
37 
38 #include "tce_config.h"
39 
40 #if defined(STD_TR1_UNORDERED_MAP)
41 
42 #include <tr1/unordered_map>
43 
44 #define hash_map std::tr1::unordered_map
45 
46 #elif defined(STD_UNORDERED_MAP)
47 
48 #include <unordered_map>
49 
50 #define hash_map std::unordered_map
51 
52 #elif defined(HASHMAP_GNU_EXT)
53 
54 #include <ext/hash_map>
55 
57 
58 #elif defined(HASHMAP_STD)
59 
60 #include <hash_map>
61 
62 using std::hash_map;
63 
64 #else
65 
66 #warning Pretending std::map to be hash_map.
67 
68 #define hash_map std::map
69 
70 #endif
71 
72 /// @todo Check for STLport hash_map
73 /// @todo Check for Intel's compiler. It seems Intel's compiler provides
74 /// compatibility for GNU so HASHMAP_GNU_EXT gets defined.
hash_map
#define hash_map
Definition: hash_map.hh:68