Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
XnHash Class Reference

#include <XnHash.h>

List of all members.

Classes

class  ConstIterator
class  Iterator

Public Types

typedef XnInt32(* XnCompareFunction )(const XnKey &key1, const XnKey &key2)
typedef XnHashValue(* XnHashFunction )(const XnKey &key)

Public Member Functions

Iterator begin ()
ConstIterator begin () const
XnStatus Clear ()
Iterator end ()
ConstIterator end () const
XnStatus Find (const XnKey &key, ConstIterator &hiter) const
XnStatus Find (const XnKey &key, Iterator &hiter)
XnStatus Get (const XnKey &key, XnValue &value) const
XnStatus GetInitStatus () const
XnBool IsEmpty () const
XnStatus Remove (const XnKey &key, XnValue &value)
XnStatus Remove (ConstIterator iter, XnKey &key, XnValue &value)
virtual XnStatus Remove (ConstIterator iter)
XnStatus Set (const XnKey &key, const XnValue &value)
XnStatus SetCompareFunction (XnCompareFunction compareFunction)
XnStatus SetHashFunction (XnHashFunction hashFunction)
XnUInt32 Size () const
 XnHash ()
 XnHash (const XnHash &other)
virtual ~XnHash ()

Protected Member Functions

XnStatus Find (const XnKey &key, XnHashValue hashValue, ConstIterator &hiter) const
XnStatus Init ()

Protected Attributes

XnList ** m_Bins
XnCompareFunction m_CompareFunction
XnHashFunction m_HashFunction
XnStatus m_nInitStatus
XnUInt16 m_nMinBin

Friends

class Iterator

Detailed Description

The hash - associative array

Definition at line 71 of file XnHash.h.


Member Typedef Documentation

typedef XnInt32(* XnHash::XnCompareFunction)(const XnKey &key1, const XnKey &key2)

Definition of comparison function - receives 2 keys, returns 0 on equality

Definition at line 338 of file XnHash.h.

typedef XnHashValue(* XnHash::XnHashFunction)(const XnKey &key)

Definition of a hash function - receive key, and outputs HashValue

Definition at line 334 of file XnHash.h.


Constructor & Destructor Documentation

XnHash::XnHash ( ) [inline]

Constructor. Initializes internal representations.

Definition at line 343 of file XnHash.h.

XnHash::XnHash ( const XnHash other) [inline]

Copy constructor

Definition at line 351 of file XnHash.h.

virtual XnHash::~XnHash ( ) [inline, virtual]

Destructor. Destroys internal representations.

Definition at line 378 of file XnHash.h.


Member Function Documentation

Iterator XnHash::begin ( ) [inline]

Get an iterator to the beginning of the XnHash (non-const version)

Definition at line 639 of file XnHash.h.

ConstIterator XnHash::begin ( ) const [inline]

Get an iterator to the beginning of the XnHash (const version)

Definition at line 647 of file XnHash.h.

XnStatus XnHash::Clear ( ) [inline]

Remove all entries from the XnHash.

Definition at line 575 of file XnHash.h.

Iterator XnHash::end ( ) [inline]

Get an iterator to the end of the XnHash (position is invalid) (non-const version)

Definition at line 655 of file XnHash.h.

ConstIterator XnHash::end ( ) const [inline]

Get an iterator to the end of the XnHash (position is invalid) (const version)

Definition at line 663 of file XnHash.h.

XnStatus XnHash::Find ( const XnKey key,
ConstIterator hiter 
) const [inline]

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

Definition at line 611 of file XnHash.h.

XnStatus XnHash::Find ( const XnKey key,
Iterator hiter 
) [inline]

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

Definition at line 625 of file XnHash.h.

XnStatus XnHash::Find ( const XnKey key,
XnHashValue  hashValue,
ConstIterator hiter 
) const [inline, protected]

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

Definition at line 732 of file XnHash.h.

XnStatus XnHash::Get ( const XnKey key,
XnValue 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

Definition at line 475 of file XnHash.h.

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).

Definition at line 395 of file XnHash.h.

XnStatus XnHash::Init ( ) [inline, protected]

Definition at line 704 of file XnHash.h.

XnBool XnHash::IsEmpty ( ) const [inline]

Checks if hash is empty.

Definition at line 586 of file XnHash.h.

XnStatus XnHash::Remove ( const XnKey key,
XnValue value 
) [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

Definition at line 498 of file XnHash.h.

XnStatus XnHash::Remove ( ConstIterator  iter,
XnKey key,
XnValue value 
) [inline]

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

Definition at line 524 of file XnHash.h.

virtual XnStatus XnHash::Remove ( ConstIterator  iter) [inline, virtual]

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

Definition at line 546 of file XnHash.h.

XnStatus XnHash::Set ( const XnKey key,
const XnValue 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

Definition at line 406 of file XnHash.h.

XnStatus XnHash::SetCompareFunction ( XnCompareFunction  compareFunction) [inline]

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

Definition at line 692 of file XnHash.h.

XnStatus XnHash::SetHashFunction ( XnHashFunction  hashFunction) [inline]

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

Definition at line 675 of file XnHash.h.

XnUInt32 XnHash::Size ( ) const [inline]

Gets the number of entries in the hash.

Definition at line 594 of file XnHash.h.


Friends And Related Function Documentation

friend class Iterator [friend]

Definition at line 328 of file XnHash.h.


Member Data Documentation

XnList** XnHash::m_Bins [protected]

Each bin is a XnList

Definition at line 750 of file XnHash.h.

The current comparison function

Definition at line 760 of file XnHash.h.

The current hash function

Definition at line 758 of file XnHash.h.

Definition at line 755 of file XnHash.h.

Definition at line 752 of file XnHash.h.


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


nao_openni
Author(s): Bener SUAY
autogenerated on Mon Jan 6 2014 11:27:52