Public Member Functions | Data Fields | Protected Member Functions | Friends

TSHashTable< H >::Location Struct Reference

Information about locating a value in the hash table. More...

#include <Map.h>

Collaboration diagram for TSHashTable< H >::Location:
Collaboration graph
[legend]

Public Member Functions

 Location ()
 Default constructor - empty location.
bool isValid () const
 Check for location being valid (referencing a value).
 operator Value * () const
 Automatically cast to a Value* for convenience.
Valueoperator* () const
 Dereference.
Valueoperator-> () const
 Dereference.
Locationoperator++ ()
 Find next value with matching key (prefix).
Locationoperator++ (int)
 Find next value with matching key (postfix).

Data Fields

Valuem_value
 The value located.
Bucketm_bucket
 Containing bucket of value.
ID m_id
 ID (hashed key).
size_t m_distance
 How many values in the chain we've gone past to get here.

Protected Member Functions

void advance ()
 Move to next matching value, no checks.

Friends

class TSHashTable

Detailed Description

template<typename H>
struct TSHashTable< H >::Location

Information about locating a value in the hash table.

An instance of this returned when searching for a key in the table. It can then be used to check if a matching key was found, and to iterate over equivalent keys. Note this iterator will touch only values which have a matching key.

Definition at line 1092 of file Map.h.


Constructor & Destructor Documentation

template<typename H>
TSHashTable< H >::Location::Location (  )  [inline]

Default constructor - empty location.

Definition at line 1099 of file Map.h.


Member Function Documentation

template<typename H >
void TSHashTable< H >::Location::advance (  )  [protected]

Move to next matching value, no checks.

Definition at line 1294 of file Map.h.

References TSHashTable< H >::Location::m_distance, and TSHashTable< H >::Location::m_value.

Referenced by TSHashTable< H >::Location::operator++(), and TSHashTable< H >::remove().

template<typename H>
bool TSHashTable< H >::Location::isValid (  )  const [inline]

Check for location being valid (referencing a value).

Definition at line 1102 of file Map.h.

References TSHashTable< H >::Location::m_value.

Referenced by TSHashTable< H >::remove().

template<typename H>
TSHashTable< H >::Location::operator Value * (  )  const [inline]

Automatically cast to a Value* for convenience.

Note:
This lets you assign the return of find to a Value*.
This also permits the use of this class directly as a boolean expression.

Definition at line 1107 of file Map.h.

References TSHashTable< H >::Location::m_value.

template<typename H>
Value& TSHashTable< H >::Location::operator* (  )  const [inline]

Dereference.

Definition at line 1110 of file Map.h.

References TSHashTable< H >::Location::m_value.

template<typename H>
Location& TSHashTable< H >::Location::operator++ ( int   )  [inline]

Find next value with matching key (postfix).

Definition at line 1117 of file Map.h.

References TSHashTable< H >::Location::advance(), and TSHashTable< H >::Location::m_value.

template<typename H>
Location& TSHashTable< H >::Location::operator++ (  )  [inline]

Find next value with matching key (prefix).

Definition at line 1115 of file Map.h.

References TSHashTable< H >::Location::advance(), and TSHashTable< H >::Location::m_value.

template<typename H>
Value* TSHashTable< H >::Location::operator-> (  )  const [inline]

Dereference.

Definition at line 1112 of file Map.h.

References TSHashTable< H >::Location::m_value.


Friends And Related Function Documentation

template<typename H>
friend class TSHashTable [friend]

Definition at line 1127 of file Map.h.


Field Documentation

template<typename H>
Bucket* TSHashTable< H >::Location::m_bucket

Containing bucket of value.

Definition at line 1094 of file Map.h.

Referenced by TSHashTable< H >::find(), TSHashTable< H >::findBucket(), and TSHashTable< H >::remove().

template<typename H>
size_t TSHashTable< H >::Location::m_distance

How many values in the chain we've gone past to get here.

Definition at line 1096 of file Map.h.

Referenced by TSHashTable< H >::Location::advance().

template<typename H>
ID TSHashTable< H >::Location::m_id

ID (hashed key).

Definition at line 1095 of file Map.h.

Referenced by TSHashTable< H >::findBucket().

template<typename H>
Value* TSHashTable< H >::Location::m_value

The documentation for this struct was generated from the following file: