template<typename T, bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
class graphlab::hopscotch_table< T, Synchronized, Hash, KeyEqual >
This defines a hash table where each entry stores a fixed data type T. The data type T should be small and should preferably fit in a couple of words. This hash table is not resizeable. Use the hopscotch_map For a more general purpose table.
Safe access is guaranteed if you restrict to the functions suffixed with _sync.
- Template Parameters:
-
T | The data type stored in the hash table |
Synchronized | Defaults to True. If True, locking is used to ensure safe reads and writes to the hash table. Even under "Synchronized", the only operations which are safe for parallel access are all functions suffixed with "sync". |
Hash | The hash functor type. Defaults to std::hash<T> if C++11 is available. Otherwise defaults to boost::hash<T> |
KeyEqual | The functor used to identify object equality. Defaults to std::equal_to<T> |
Definition at line 45 of file hopscotch_table.hpp.
template<typename T , bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
If the argument is found in the hash table, return {true, V} where V is the hash table content matching the argument. Otherwise {false, T()} is returned. KeyEqual() is used to compare entries. Safe under parallel access.
Definition at line 669 of file hopscotch_table.hpp.
template<typename T , bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
Inserts an entry into the array. Returns an iterator to the just inserted data on success. If the entry already exists, it will be overwritten. Returns end() on failure.
Definition at line 494 of file hopscotch_table.hpp.
template<typename T , bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
Inserts an entry into the array. Returns an iterator to the just inserted data on success. This function check if the entry already exists, if it does, do nothing Returns end() on failure.
Definition at line 505 of file hopscotch_table.hpp.
template<typename T , bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
Inserts an element into the hash table. Safe under parallel access. if t already exists, nothing will happen
Definition at line 656 of file hopscotch_table.hpp.
template<typename T , bool Synchronized = true, typename Hash = _HOPSCOTCH_TABLE_DEFAULT_HASH, typename KeyEqual = std::equal_to<T>>
Inserts an element into the hash table. Safe under parallel access. if t already exists, it will be overwritten
Definition at line 646 of file hopscotch_table.hpp.