HDK
|
#include <denseHashSet.h>
Public Types | |
typedef Element | value_type |
typedef _Vector::const_iterator | iterator |
typedef _Vector::const_iterator | const_iterator |
A const_iterator type for this set. More... | |
typedef std::pair < const_iterator, bool > | insert_result |
Return type for insert() method. More... | |
Public Member Functions | |
TfDenseHashSet (const HashFn &hashFn=HashFn(), const EqualElement &equalElement=EqualElement()) | |
TfDenseHashSet (const TfDenseHashSet &rhs) | |
TfDenseHashSet (TfDenseHashSet &&rhs)=default | |
template<class Iterator > | |
TfDenseHashSet (Iterator begin, Iterator end) | |
TfDenseHashSet (std::initializer_list< Element > l) | |
TfDenseHashSet & | operator= (const TfDenseHashSet &rhs) |
TfDenseHashSet & | operator= (TfDenseHashSet &&rhs)=default |
TfDenseHashSet & | operator= (std::initializer_list< Element > l) |
bool | operator== (const TfDenseHashSet &rhs) const |
bool | operator!= (const TfDenseHashSet &rhs) const |
void | clear () |
void | swap (TfDenseHashSet &rhs) |
bool | empty () const |
size_t | size () const |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | find (const Element &k) const |
size_t | count (const Element &k) const |
insert_result | insert (const value_type &v) |
template<class IteratorType > | |
void | insert (IteratorType i0, IteratorType i1) |
template<class Iterator > | |
void | insert_unique (Iterator begin, Iterator end) |
size_t | erase (const Element &k) |
void | erase (const iterator &iter) |
void | erase (const iterator &i0, const iterator &i1) |
void | shrink_to_fit () |
const Element & | operator[] (size_t index) const |
This is a space efficient container that mimics the TfHashSet API that uses a vector for storage when the size of the set is small.
When the set gets bigger than Threshold
a TfHashMap is allocated that is used to accelerate lookup in the vector.
Definition at line 55 of file denseHashSet.h.
typedef _Vector::const_iterator TfDenseHashSet< Element, HashFn, EqualElement, Threshold >::const_iterator |
A const_iterator type for this set.
Definition at line 81 of file denseHashSet.h.
typedef std::pair<const_iterator, bool> TfDenseHashSet< Element, HashFn, EqualElement, Threshold >::insert_result |
Return type for insert() method.
Definition at line 84 of file denseHashSet.h.
typedef _Vector::const_iterator TfDenseHashSet< Element, HashFn, EqualElement, Threshold >::iterator |
An iterator type for this set. Note that this one is const as well, as we can't allow in-place modification of elements due to the potentially allocated hash map.
Definition at line 78 of file denseHashSet.h.
typedef Element TfDenseHashSet< Element, HashFn, EqualElement, Threshold >::value_type |
Definition at line 59 of file denseHashSet.h.
|
inlineexplicit |
Ctor.
Definition at line 90 of file denseHashSet.h.
|
inline |
Copy Ctor.
Definition at line 100 of file denseHashSet.h.
|
default |
Move Ctor.
|
inline |
Construct from range.
Definition at line 114 of file denseHashSet.h.
|
inline |
Construct from an initializer_list.
Definition at line 120 of file denseHashSet.h.
|
inline |
Returns an const_iterator pointing to the beginning of the set.
Definition at line 196 of file denseHashSet.h.
|
inline |
Erases all of the elements
Definition at line 170 of file denseHashSet.h.
|
inline |
Returns the number of elements with key k
. Which is either 0 or 1.
Definition at line 229 of file denseHashSet.h.
|
inline |
true
if the set's
size is 0.
Definition at line 184 of file denseHashSet.h.
|
inline |
Returns an const_iterator pointing to the end of the set.
Definition at line 202 of file denseHashSet.h.
|
inline |
Erase element with key k
. Returns the number of elements erased.
Definition at line 298 of file denseHashSet.h.
|
inline |
Erases element pointed to by iter
.
Definition at line 310 of file denseHashSet.h.
|
inline |
Erases a range from the set.
Definition at line 335 of file denseHashSet.h.
|
inline |
Finds the element with key k
.
Definition at line 208 of file denseHashSet.h.
|
inline |
Returns a pair of <iterator, bool> where iterator points to the element in the list and bool is true if a new element was inserted.
Definition at line 236 of file denseHashSet.h.
|
inline |
Insert a range into the hash set. Note that i0
and i1
can't point into the hash set.
Definition at line 268 of file denseHashSet.h.
|
inline |
Insert a range of unique elements into the container. [begin, end) must not contain any duplicate elements.
Definition at line 285 of file denseHashSet.h.
|
inline |
Definition at line 164 of file denseHashSet.h.
|
inline |
Copy assignment operator.
Definition at line 126 of file denseHashSet.h.
|
default |
Move assignment operator.
|
inline |
Assignment from an initializer_list.
Definition at line 140 of file denseHashSet.h.
|
inline |
Equality operator.
Definition at line 148 of file denseHashSet.h.
|
inline |
Index into set via index
.
Definition at line 378 of file denseHashSet.h.
|
inline |
Optimize storage space.
Definition at line 352 of file denseHashSet.h.
|
inline |
Returns the size of the set.
Definition at line 190 of file denseHashSet.h.
|
inline |
Swaps the contents of two sets.
Definition at line 177 of file denseHashSet.h.