A value of this type is returned with methods Extract, which allows to remove an element from the hashtable, without deleting its allocated storage and destructing its custom value.
This handle allows write access to the value of an extracted element. In combination with methods Insert(ElementHandle&) and InsertIfNotExistent(ElementHandle&), this allows to change parts of the element value, including the key-portion with proper re-insertion.
Objects of this type can not be copied, but just moved.
Definition at line 523 of file hashtable.hpp.
#include <hashtable.hpp>
Public Method Index: | |
ElementHandle () | |
ElementHandle (ElementHandle &&other) | |
ElementHandle (ElementHandle &other)=delete | |
~ElementHandle () | |
bool | IsEmpty () const |
KeyType & | Key () const |
template<typename TEnableIf = TIfMapped> | |
Mapped () const | |
ElementHandle & | operator= (const ElementHandle &other)=delete |
ElementHandle & | operator= (ElementHandle &&other) |
T & | Value () const |
|
private |
The extracted element.
Definition at line 531 of file hashtable.hpp.
|
private |
The table we belong to.
Definition at line 530 of file hashtable.hpp.
|
inlineprivate |
Constructor setting fields table and element.
pTable | The table we belong to. |
pElement | The extracted element. |
Definition at line 538 of file hashtable.hpp.
|
inline |
Move constructor setting the moved object to emtpy.
other | The handle to move. |
Definition at line 548 of file hashtable.hpp.
|
inline |
Default constructor creating and empty handle.
Definition at line 556 of file hashtable.hpp.
|
delete |
Deleted copy constructor.
|
inline |
Destructor. If this handle is not empty, the allocated storage of the represented element is added to the list of recyclable objects.
Definition at line 589 of file hashtable.hpp.
|
inline |
Determines if this is a "valid" handle.
true
if this objects represents a valid element, false
otherwise. Definition at line 601 of file hashtable.hpp.
|
inline |
Returns a mutable reference to the key-portion of this element's data. Must not be invoked on empty instances.
Definition at line 612 of file hashtable.hpp.
|
inline |
Returns a mutable reference to the mapped-portion of this element's data. Must not be invoked on empty instances.
TEnableIf | Used to select this method if applicable. Do not specify. |
Definition at line 625 of file hashtable.hpp.
|
delete |
Deleted copy assignment operator.
|
inline |
Move assignment. Disposes any current content, and moves other into this.
other | The handle to move into this object. |
this
. Definition at line 571 of file hashtable.hpp.
|
inline |
Returns a mutable reference to this element's data. Must not be invoked on empty instances.
Definition at line 606 of file hashtable.hpp.