#include <XnHash.h>
List of all members.
Classes |
class | ConstIterator |
class | Iterator |
Public Types |
typedef XnHashValue(* | XnHashFunction )(const XnKey &key) |
typedef XnInt32(* | XnCompareFunction )(const XnKey &key1, const XnKey &key2) |
Public Member Functions |
| XnHash () |
virtual | ~XnHash () |
XnStatus | GetInitStatus () const |
XnStatus | Set (const XnKey &key, const XnValue &value) |
XnStatus | Get (const XnKey &key, XnValue &value) const |
XnStatus | Remove (const XnKey &key, XnValue &value) |
XnStatus | Remove (ConstIterator iter, XnKey &key, XnValue &value) |
virtual XnStatus | Remove (ConstIterator iter) |
XnStatus | Clear () |
XnBool | IsEmpty () const |
XnUInt32 | Size () const |
XnStatus | Find (const XnKey &key, ConstIterator &hiter) const |
XnStatus | Find (const XnKey &key, Iterator &hiter) |
Iterator | begin () |
ConstIterator | begin () const |
Iterator | end () |
ConstIterator | end () const |
XnStatus | SetHashFunction (XnHashFunction hashFunction) |
XnStatus | SetCompareFunction (XnCompareFunction compareFunction) |
Protected Member Functions |
XnStatus | Init () |
XnStatus | Find (const XnKey &key, XnHashValue hashValue, ConstIterator &hiter) const |
Protected Attributes |
XnList ** | m_Bins |
XnUInt16 | m_nMinBin |
XnStatus | m_nInitStatus |
XnHashFunction | m_HashFunction |
XnCompareFunction | m_CompareFunction |
Friends |
class | ConstIterator |
Detailed Description
The hash - associative array
Member Typedef Documentation
Definition of comparison function - receives 2 keys, returns 0 on equality
Definition of a hash function - receive key, and outputs HashValue
Constructor & Destructor Documentation
XnHash::XnHash |
( |
| ) |
[inline] |
Constructor. Initializes internal representations.
virtual XnHash::~XnHash |
( |
| ) |
[inline, virtual] |
Destructor. Destroys internal representations.
Member Function Documentation
Get an iterator to the beginning of the XnHash (non-const version)
Get an iterator to the beginning of the XnHash (const version)
Remove all entries from the XnHash.
Get an iterator to the end of the XnHash (position is invalid) (non-const version)
Get an iterator to the end of the XnHash (position is invalid) (const version)
Get an iterator pointing to the entry to which the key belongs
- Parameters:
-
key | [in] The key of the entry |
hiter | [out] Iterator to the entry described by key |
- Returns:
- XN_STATUS_NO_MATCH No such key in the XnHash
Get an iterator pointing to the entry to which the key belongs
- Parameters:
-
key | [in] The key of the entry |
hiter | [out] Iterator to the entry described by key |
- Returns:
- XN_STATUS_NO_MATCH No such key in the XnHash
Get an iterator pointing to the entry to which the key belongs
- Parameters:
-
key | [in] The key of the entry |
hashValue | [in] The hash value of the key |
hiter | [out] Iterator to the entry described by key |
- Returns:
- XN_STATUS_NO_MATCH No such key in the XnHash
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
XnStatus XnHash::GetInitStatus |
( |
| ) |
const [inline] |
Returns the status of the initialization of the hash.
- Returns:
- XN_STATUS_OK if the hash was initialized successfully, or an error code otherwise (e.g. if memory could not be allocated).
XnStatus XnHash::Init |
( |
| ) |
[inline, protected] |
XnBool XnHash::IsEmpty |
( |
| ) |
const [inline] |
Remove a key-value entry from the XnHash
- Parameters:
-
key | [in] The key of the entry |
value | [out] The value that was in the removed entry |
- Returns:
- XN_STATUS_NO_MATCH if no such key exists
Remove an entry from the XnHash by iterator
- Parameters:
-
iter | [in] Iterator pointing to an entry in the hash |
key | [out] The key that was in the removed entry |
value | [out] The value that was in the removed entry |
- Returns:
- XN_STATUS_ILLEGAL_POSITION if iterator is invalid
Remove an entry from the XnHash by iterator
- Parameters:
-
iter | [in] Iterator pointing to an entry in the hash |
- Returns:
- XN_STATUS_ILLEGAL_POSITION if iterator is invalid
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 |
Change the comparison function. The XnHash must be empty for this to succeed.
- Parameters:
-
compareFunction | [in] The new hash function |
- Returns:
- XN_STATUS_IS_NOT_EMPTY if the XnHash isn't empty
Change the hash function. The XnHash must be empty for this to succeed.
- Parameters:
-
hashFunction | [in] The new hash function |
- Returns:
- XN_STATUS_IS_NOT_EMPTY if the XnHash isn't empty
XnUInt32 XnHash::Size |
( |
| ) |
const [inline] |
Gets the number of entries in the hash.
Friends And Related Function Documentation
Member Data Documentation
The current comparison function
The current hash function
The documentation for this class was generated from the following file: