XnHashT< TKey, TValue, TKeyManager, TAlloc > Class Template Reference

`#include <XnHashT.h>`

Inheritance diagram for XnHashT< TKey, TValue, TKeyManager, TAlloc >:
[legend]

## Classes

class | ConstIterator
class | Iterator

## Public Types

enum | { LAST_BIN = (1 << (sizeof(XnHashCode)*8)) , NUM_BINS = LAST_BIN + 1 }
typedef XnKeyValuePair< TKey, TValue > | TPair
typedef XnListT< TPair, TAlloc > | TPairList

## Public Member Functions

| XnHashT ()
| XnHashT (const XnHashT &other)
XnHashT & | operator= (const XnHashT &other)
| ~XnHashT ()
Iterator | Begin ()
ConstIterator | Begin () const
Iterator | End ()
ConstIterator | End () const
XnStatus | Set (const TKey &key, const TValue &value)
ConstIterator | Find (TKey const &key) const
Iterator | Find (TKey const &key)
XnStatus | Find (TKey const &key, ConstIterator &it) const
XnStatus | Find (TKey const &key, Iterator &it)
XnStatus | Get (TKey const &key, TValue &value) const
XnStatus | Get (TKey const &key, TValue const *&pValue) const
XnStatus | Get (TKey const &key, TValue &value)
XnStatus | Get (TKey const &key, TValue *&pValue)
TValue & | operator[] (TKey const &key)
XnStatus | Remove (ConstIterator it)
XnStatus | Remove (TKey const &key)
XnStatus | Clear ()
XnBool | IsEmpty () const
XnUInt32 | Size () const

## Member Typedef Documentation

## TPair

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

typedef XnKeyValuePair<TKey, TValue> XnHashT< TKey, TValue, TKeyManager, TAlloc >::TPair

## TPairList

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

typedef XnListT<TPair, TAlloc> XnHashT< TKey, TValue, TKeyManager, TAlloc >::TPairList

## Member Enumeration Documentation

## anonymous enum

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

anonymous enum

Enumerator
LAST_BIN |
NUM_BINS |

## Constructor & Destructor Documentation

## XnHashT() [1/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnHashT< TKey, TValue, TKeyManager, TAlloc >::XnHashT | ( |  | ) |

inline

## XnHashT() [2/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnHashT< TKey, TValue, TKeyManager, TAlloc >::XnHashT | ( | const XnHashT< TKey, TValue, TKeyManager, TAlloc > & | other | ) |

inline

## ~XnHashT()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnHashT< TKey, TValue, TKeyManager, TAlloc >::~XnHashT | ( |  | ) |

inline

## Member Function Documentation

## Begin() [1/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

Iterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::Begin | ( |  | ) |

inline

An iterator to the first entry of the list (non-const version)

## Begin() [2/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

ConstIterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::Begin | ( |  | ) | const

inline

An iterator to the first entry of the list (const version)

## Clear()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Clear | ( |  | ) |

inline

Remove all entries from the XnHash.

## End() [1/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

Iterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::End | ( |  | ) |

inline

An iterator 1to the end of the list (non-const version). The position is invalid.

## End() [2/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

ConstIterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::End | ( |  | ) | const

inline

An iterator to the end of the list (const version). The position is invalid.

## Find() [1/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

Iterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::Find | ( | TKey const & | key | ) |

inline

Get an iterator pointing to the pair in the hash.

Parameters

  key | [in] The searched key

Returns
  End() if value doesn't exist

## Find() [2/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

ConstIterator XnHashT< TKey, TValue, TKeyManager, TAlloc >::Find | ( | TKey const & | key | ) | const

inline

Get an iterator pointing to the pair in the hash (const version).

Parameters

  key | [in] The searched key

Returns
  End() if value doesn't exist

## Find() [3/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Find | ( | TKey const & | key,
|  | ConstIterator & | it ) const

inline

Get an iterator pointing to the pair in the hash (const version).

Parameters

  key | [in] The searched key
  it | [out] An iterator to the entry in the hash.

Returns
  XN_STATUS_NO_MATCH if value doesn't exist

## Find() [4/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Find | ( | TKey const & | key,
|  | Iterator & | it )

inline

Get an iterator pointing to the pair in the hash (const version).

Parameters

  key | [in] The searched key
  it | [out] An iterator to the entry in the hash.

Returns
  XN_STATUS_NO_MATCH if value doesn't exist

## Get() [1/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Get | ( | TKey const & | key,
|  | TValue & | value )

inline

Get the value associated with the supplied key

Parameters

  key | [in] The key of the entry
  value | [out] The retrieved value

Returns
  XN_STATUS_NO_MATCH if no such key exists

## Get() [2/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Get | ( | TKey const & | key,
|  | TValue & | value ) const

inline

Get the value associated with the supplied key

Parameters

  key | [in] The key of the entry
  value | [out] The retrieved value

Returns
  XN_STATUS_NO_MATCH if no such key exists

## Get() [3/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Get | ( | TKey const & | key,
|  | TValue *& | pValue )

inline

Get a pointer to the value associated with the supplied key

Parameters

  key | [in] The key of the entry
  pValue | [out] A pointer to the value that is stored in the hash

Returns
  XN_STATUS_NO_MATCH if no such key exists

## Get() [4/4]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Get | ( | TKey const & | key,
|  | TValue const *& | pValue ) const

inline

Get a pointer to the value associated with the supplied key

Parameters

  key | [in] The key of the entry
  pValue | [out] A const pointer to the value that is stored in the hash.

Returns
  XN_STATUS_NO_MATCH if no such key exists

## IsEmpty()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnBool XnHashT< TKey, TValue, TKeyManager, TAlloc >::IsEmpty | ( |  | ) | const

inline

Checks if hash is empty.

## operator=()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnHashT & XnHashT< TKey, TValue, TKeyManager, TAlloc >::operator= | ( | const XnHashT< TKey, TValue, TKeyManager, TAlloc > & | other | ) |

inline

## operator[]()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

TValue & XnHashT< TKey, TValue, TKeyManager, TAlloc >::operator[] | ( | TKey const & | key | ) |

inline

Gets a reference to the value of a specific key. If this key is not in the hash, it will be added.

Parameters

  key | [in] The key of the entry.

## Remove() [1/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Remove | ( | ConstIterator | it | ) |

inline

## Remove() [2/2]

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Remove | ( | TKey const & | key | ) |

inline

## Set()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnStatus XnHashT< TKey, TValue, TKeyManager, TAlloc >::Set | ( | const TKey & | key,
|  | const TValue & | value )

inline

Set a new key-value entry. If key exists, will replace value.

Parameters

  key | [in] The key to which to associate the value
  value | [in] The value to add to the XnHash

## Size()

template<class TKey, class TValue, class TKeyManager = XnDefaultKeyManagerT<TKey>, class TAlloc = XnLinkedNodeDefaultAllocatorT<XnKeyValuePair<TKey, TValue> >>

XnUInt32 XnHashT< TKey, TValue, TKeyManager, TAlloc >::Size | ( |  | ) | const

inline

Gets the number of entries in the hash.

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

- XnHashT.h