A HashSet for storing and looking up blobs efficiently. More...
#include <BlobHashSet.h>
Public Types | |
typedef Base::iterator | iterator |
typedef Base::key_type | key_type |
typedef Base::value_type | value_type |
typedef TraitsT::key_allocator | key_allocator |
typedef std::pair< iterator, bool > | InsRet |
Public Member Functions | |
BlobHashSet () | |
Constructor creates an empty set. More... | |
BlobHashSet (size_t n_buckets) | |
Overloaded Constructor creates an empty set with a specified number of buckets. More... | |
InsRet | insert (const void *buf, size_t len) |
Inserts a new Blob into the set. More... | |
InsRet | insert (const String &s) |
Insert function for a String object. More... | |
InsRet | insert (const Blob &blob) |
Insert function for a Blob object. More... | |
iterator | find (const Blob &blob) |
Looks up the blob and returns an iterator to it. More... | |
iterator | find (const String &s) |
Find function for String objects. More... | |
key_allocator & | key_alloc () |
Returns the allocator; used for testing. More... | |
Private Types | |
typedef std::unordered_set < Blob, typename TraitsT::hasher, typename TraitsT::key_equal > | Base |
Private Member Functions | |
InsRet | insert_blob (size_t len, InsRet rv) |
Helper function to insert a blob; if the blob already exists then a duplicate blob is created and inserted. More... | |
Private Attributes | |
key_allocator | m_alloc |
The key_allocator - i.e. More... | |
A HashSet for storing and looking up blobs efficiently.
A Blob is a simple structure with { void *, size_t } (see BlobHashTraits.h).
Definition at line 44 of file BlobHashSet.h.
|
private |
Definition at line 48 of file BlobHashSet.h.
typedef std::pair<iterator, bool> Hypertable::BlobHashSet< TraitsT >::InsRet |
Definition at line 55 of file BlobHashSet.h.
typedef Base::iterator Hypertable::BlobHashSet< TraitsT >::iterator |
Definition at line 51 of file BlobHashSet.h.
typedef TraitsT::key_allocator Hypertable::BlobHashSet< TraitsT >::key_allocator |
Definition at line 54 of file BlobHashSet.h.
typedef Base::key_type Hypertable::BlobHashSet< TraitsT >::key_type |
Definition at line 52 of file BlobHashSet.h.
typedef Base::value_type Hypertable::BlobHashSet< TraitsT >::value_type |
Definition at line 53 of file BlobHashSet.h.
|
inline |
Constructor creates an empty set.
Definition at line 58 of file BlobHashSet.h.
|
inline |
Overloaded Constructor creates an empty set with a specified number of buckets.
n_buckets | Number of buckets in the hash table |
Definition at line 65 of file BlobHashSet.h.
|
inline |
Looks up the blob and returns an iterator to it.
Hides all find methods in the base class.
blob | Reference to the blob to find |
Definition at line 105 of file BlobHashSet.h.
|
inline |
Find function for String objects.
s | Reference to the string to find |
Definition at line 112 of file BlobHashSet.h.
|
inline |
Inserts a new Blob into the set.
Hides all insert methods in the base class.
buf | Pointer to the blob's data |
len | Size of the blob |
Definition at line 75 of file BlobHashSet.h.
|
inline |
Insert function for a String object.
s | Reference to the String which is inserted |
Definition at line 85 of file BlobHashSet.h.
|
inline |
Insert function for a Blob object.
blob | Reference to the blob which is inserted |
Definition at line 95 of file BlobHashSet.h.
|
inlineprivate |
Helper function to insert a blob; if the blob already exists then a duplicate blob is created and inserted.
len | The length of the blob which was inserted |
rv | The InsRet pair, which is the result of the actual insert operation. |
Definition at line 134 of file BlobHashSet.h.
|
inline |
Returns the allocator; used for testing.
Definition at line 120 of file BlobHashSet.h.
|
private |