34 #include "tbb/queuing_mutex.h"
35 #include "tbb/mutex.h"
49 typedef tbb::mutex table_mutex_t;
50 table_mutex_t table_mutex_;
63 table.set_deleted_key(NULL);
76 table.set_deleted_key(NULL);
95 table_mutex_t::scoped_lock lock(table_mutex_);
98 typename Table::const_iterator it =
table.find(&_g);
99 if (it !=
table.end() ) {
103 std::pair<typename Table::iterator, bool> ref=
table.insert(clone);
118 std::map<std::string, size_t> get_hits()
const {
return table.get_hits(); }
119 std::map<std::string, size_t> get_misses()
const {
return table.get_misses(); }
120 std::map<std::string, size_t> get_bounces()
const {
return table.get_bounces(); }
This class implements a unicity table mechanism, based on an STL hash_set.
Definition: UniqueTable.h:43
d3::hash_set< const T * >::type Table
Typedef helps hide implementation type (currently gnu gcc's hash_set).
Definition: UniqueTable.h:82
Table table
The actual table, operations on the UniqueTable are delegated on this.
Definition: UniqueTable.h:84
const T * operator()(const T &_g)
The application operator, returns the address of the value already in the table if it exists,...
Definition: UniqueTable.h:92
size_t size() const
Returns the current number of filled entries in the table.
Definition: UniqueTable.h:112
UniqueTable()
Constructor, builds a default table.
Definition: UniqueTable.h:55
UniqueTable(size_t s)
Definition: UniqueTable.h:68
google::sparse_hash_set< Key, Hash, Compare, Allocator > type
Definition: hash_set.hh:24
Definition: hash_support.hh:230