Lines 3-8
Link Here
|
3 |
|
3 |
|
4 |
#include <assert.h> |
4 |
#include <assert.h> |
5 |
|
5 |
|
|
|
6 |
#include <string> |
7 |
#include <vector> |
8 |
using std::string; |
9 |
using std::pair; |
10 |
using std::vector; |
6 |
|
11 |
|
7 |
/* This header file includes the definitions that are required to |
12 |
/* This header file includes the definitions that are required to |
8 |
* setup a kernel database. This database will be used by the kernel |
13 |
* setup a kernel database. This database will be used by the kernel |
Lines 39-44
Link Here
|
39 |
|
44 |
|
40 |
define_db_entry_type(driver_data, driver_data_entry) |
45 |
define_db_entry_type(driver_data, driver_data_entry) |
41 |
|
46 |
|
|
|
47 |
#include <string> |
48 |
#include <vector> |
49 |
using std::string; |
50 |
using std::pair; |
51 |
using std::vector; |
42 |
|
52 |
|
43 |
// Now, create an database explorer instance. The database explorer is |
53 |
// Now, create an database explorer instance. The database explorer is |
44 |
// used to search and manipulate the database. The explorer is |
54 |
// used to search and manipulate the database. The explorer is |
Lines 80-88
Link Here
|
80 |
#include <freehdl/kernel-util.hh> |
90 |
#include <freehdl/kernel-util.hh> |
81 |
|
91 |
|
82 |
#if !defined __GNUC__ || __GNUC__ != 2 |
92 |
#if !defined __GNUC__ || __GNUC__ != 2 |
83 |
#include <ext/hash_map> |
93 |
//#include <ext/hash_map> |
|
|
94 |
#include <unordered_map> |
84 |
#else |
95 |
#else |
85 |
#include <hash_map> |
96 |
//#include <hash_map> |
|
|
97 |
#include <unordered_map> |
86 |
#endif |
98 |
#endif |
87 |
|
99 |
|
88 |
// Macro used to define a key type. K is the actual type of the key |
100 |
// Macro used to define a key type. K is the actual type of the key |
Lines 254-263
Link Here
|
254 |
|
266 |
|
255 |
// A hash function template used tp generate a hash number from |
267 |
// A hash function template used tp generate a hash number from |
256 |
// d |
268 |
// d |
257 |
class db_basic_key_hash : public hash<unsigned long> { |
269 |
class db_basic_key_hash : public std::hash<unsigned long> { |
258 |
public: |
270 |
public: |
259 |
size_t operator()(const db_basic_key& x) const { |
271 |
size_t operator()(const db_basic_key& x) const { |
260 |
return (*(hash<unsigned long> *)this)(((unsigned long)x.value)>>2); |
272 |
return (*(std::hash<unsigned long> *)this)(((unsigned long)x.value)>>2); |
261 |
} |
273 |
} |
262 |
}; |
274 |
}; |
263 |
|
275 |
|
Lines 266-272
Link Here
|
266 |
class db : public db_base |
278 |
class db : public db_base |
267 |
{ |
279 |
{ |
268 |
// This mappes is the actual database. |
280 |
// This mappes is the actual database. |
269 |
typedef hash_map<void*, db_key_entry_pair, db_basic_key_hash> db_data_map_type; |
281 |
//typedef hash_map<void*, db_key_entry_pair, db_basic_key_hash> db_data_map_type; |
|
|
282 |
typedef std::unordered_map<void*, db_key_entry_pair, db_basic_key_hash> db_data_map_type; |
270 |
db_data_map_type data_map; |
283 |
db_data_map_type data_map; |
271 |
|
284 |
|
272 |
// The transaction id is incremented each time a new key is added or |
285 |
// The transaction id is incremented each time a new key is added or |