A value of this type is returned with methods Extract, which allows removing an element from the hashtable, without deleting its allocated storage and destructing its custom value.
This handle allows writing access to the value of an extracted element. In combination with methods Insert(ElementHandle&) and InsertIfNotExistent(ElementHandle&), this supports changing parts of the element value, including the key-portion with proper re-insertion.
Objects of this type cannot be copied, but just moved.
Definition at line 540 of file hashtable.inl.
Public Method Index: | |
ElementHandle () | |
Default constructor creating and empty handle. | |
ElementHandle (ElementHandle &&other) | |
ElementHandle (ElementHandle &other)=delete | |
Deleted copy constructor. | |
~ElementHandle () | |
bool | IsEmpty () const |
KeyType & | Key () const |
MappedType & | Mapped () const |
ElementHandle & | operator= (const ElementHandle &other)=delete |
Deleted copy assignment operator. | |
ElementHandle & | operator= (ElementHandle &&other) |
StoredType & | Value () const |
Private Field Index: | |
Element * | element |
The extracted element. | |
HashTable * | table |
The table we belong to. | |
Private Method Index: | |
ElementHandle (HashTable *pTable, Element *pElement) | |
|
private |
The extracted element.
Definition at line 548 of file hashtable.inl.
|
private |
The table we belong to.
Definition at line 547 of file hashtable.inl.
|
inlineprivate |
Constructor setting fields table and element.
pTable | The table we belong to. |
pElement | The extracted element. |
Definition at line 553 of file hashtable.inl.
|
inline |
Move constructor setting the moved object to emtpy.
other | The handle to move. |
Definition at line 561 of file hashtable.inl.
|
inline |
Default constructor creating and empty handle.
Definition at line 569 of file hashtable.inl.
|
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 595 of file hashtable.inl.
|
inline |
Determines if this is a "valid" handle.
true
if this objects represents a valid element, false
otherwise. Definition at line 604 of file hashtable.inl.
|
inline |
Returns a mutable reference to the key-portion of this element's data. Must not be invoked on empty instances.
Definition at line 615 of file hashtable.inl.
|
inline |
Returns a mutable reference to the mapped-portion of this element's data. Must not be invoked on empty instances.
Definition at line 620 of file hashtable.inl.
|
inline |
Move assignment. Disposes any current content, and moves other into this.
other | The handle to move into this object. |
this
. Definition at line 582 of file hashtable.inl.
|
inline |
Returns a mutable reference to this element's data. Must not be invoked on empty instances.
Definition at line 609 of file hashtable.inl.