OpenNI 1.5.7
XnHash.h File Reference
#include "XnList.h"

Go to the source code of this file.

Classes

class  XnHash
 
class  XnHash::ConstIterator
 
class  XnHash::Iterator
 

Macros

#define XN_HASH_LAST_BIN   256
 
#define XN_HASH_NUM_BINS   (XN_HASH_LAST_BIN + 1)
 
#define XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(decl, KeyType, ClassName, KeyTranslator)
 
#define XN_DECLARE_DEFAULT_KEY_MANAGER(KeyType, ClassName, KeyTranslator)    XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(, KeyType, ClassName, KeyTranslator)
 
#define XN_DECLARE_HASH_DECL(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)
 
#define XN_DECLARE_HASH(KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)    XN_DECLARE_HASH_DECL(, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)
 
#define XN_DECLARE_DEFAULT_MANAGER_HASH_DECL(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator)
 
#define XN_DECLARE_DEFAULT_MANAGER_HASH(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator)    XN_DECLARE_DEFAULT_MANAGER_HASH_DECL(, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator)
 
#define XN_DECLARE_DEFAULT_HASH_DECL(decl, KeyType, ValueType, ClassName)
 
#define XN_DECLARE_DEFAULT_HASH(KeyType, ValueType, ClassName)    XN_DECLARE_DEFAULT_HASH_DECL(, KeyType, ValueType, ClassName)
 

Typedefs

typedef XnValue XnKey
 
typedef XnUInt8 XnHashValue
 

Macro Definition Documentation

◆ XN_DECLARE_DEFAULT_HASH

#define XN_DECLARE_DEFAULT_HASH ( KeyType,
ValueType,
ClassName )    XN_DECLARE_DEFAULT_HASH_DECL(, KeyType, ValueType, ClassName)

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses default translators for storing keys and values. It declares and uses a default manager.

◆ XN_DECLARE_DEFAULT_HASH_DECL

#define XN_DECLARE_DEFAULT_HASH_DECL ( decl,
KeyType,
ValueType,
ClassName )
Value:
XN_DECLARE_DEFAULT_VALUE_TRANSLATOR_DECL(decl, KeyType, _XN_DEFAULT_KEY_TRANSLATOR(ClassName)) \
XN_DECLARE_DEFAULT_VALUE_TRANSLATOR_DECL(decl, ValueType, _XN_DEFAULT_VALUE_TRANSLATOR(ClassName)) \
XN_DECLARE_DEFAULT_MANAGER_HASH_DECL(decl, KeyType, ValueType, ClassName, _XN_DEFAULT_KEY_TRANSLATOR(ClassName), _XN_DEFAULT_VALUE_TRANSLATOR(ClassName))
#define XN_DECLARE_DEFAULT_VALUE_TRANSLATOR_DECL(decl, Type, ClassName)
Definition XnDataTypes.h:41

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses default translators for storing keys and values. It declares and uses a default manager. It is declared using the decl declspec.

◆ XN_DECLARE_DEFAULT_KEY_MANAGER

#define XN_DECLARE_DEFAULT_KEY_MANAGER ( KeyType,
ClassName,
KeyTranslator )    XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(, KeyType, ClassName, KeyTranslator)

Declares a default Key Manager for type KeyType. It is given the name ClassName. The manager uses the translator KeyTranslator.

◆ XN_DECLARE_DEFAULT_KEY_MANAGER_DECL

#define XN_DECLARE_DEFAULT_KEY_MANAGER_DECL ( decl,
KeyType,
ClassName,
KeyTranslator )
Value:
class decl ClassName \
{ \
public: \
inline static XnHashValue Hash(KeyType const& key) \
{ \
const XnKey _key = KeyTranslator::GetAsValue(key); \
return XnDefaultHashFunction(_key); \
} \
inline static XnInt32 Compare(KeyType const& key1, KeyType const& key2) \
{ \
const XnKey _key1 = KeyTranslator::GetAsValue(key1); \
const XnKey _key2 = KeyTranslator::GetAsValue(key2); \
return XnDefaultCompareFunction(_key1, _key2); \
} \
};
XnValue XnKey
Definition XnHash.h:40
XnUInt8 XnHashValue
Definition XnHash.h:45

Declares a default Key Manager for type KeyType. It is given the name ClassName. The manager uses the translator KeyTranslator, and is declared using the decl declspec.

◆ XN_DECLARE_DEFAULT_MANAGER_HASH

#define XN_DECLARE_DEFAULT_MANAGER_HASH ( decl,
KeyType,
ValueType,
ClassName,
KeyTranslator,
ValueTranslator )    XN_DECLARE_DEFAULT_MANAGER_HASH_DECL(, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator)

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses KeyTranslator and ValueTranslator for storing keys and values. It declares and uses a default manager.

◆ XN_DECLARE_DEFAULT_MANAGER_HASH_DECL

#define XN_DECLARE_DEFAULT_MANAGER_HASH_DECL ( decl,
KeyType,
ValueType,
ClassName,
KeyTranslator,
ValueTranslator )
Value:
XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(decl, KeyType, _XN_DEFAULT_KEY_MANAGER_NAME(ClassName), KeyTranslator) \
XN_DECLARE_HASH_DECL(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, _XN_DEFAULT_KEY_MANAGER_NAME(ClassName))
#define XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(decl, KeyType, ClassName, KeyTranslator)
Definition XnHash.h:743

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses KeyTranslator and ValueTranslator for storing keys and values. It declares and uses a default manager. It is declared using the decl declspec.

◆ XN_DECLARE_HASH

#define XN_DECLARE_HASH ( KeyType,
ValueType,
ClassName,
KeyTranslator,
ValueTranslator,
KeyManager )    XN_DECLARE_HASH_DECL(, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses KeyTranslator and ValueTranslator for storing keys and values, and KeyManager for managing the keys.

◆ XN_DECLARE_HASH_DECL

#define XN_DECLARE_HASH_DECL ( decl,
KeyType,
ValueType,
ClassName,
KeyTranslator,
ValueTranslator,
KeyManager )

Declares a hash table from KeyType to ValueType named ClassName. The hash table uses KeyTranslator and ValueTranslator for storing keys and values, and KeyManager for managing the keys. It is declared using the decl declspec.

◆ XN_HASH_LAST_BIN

#define XN_HASH_LAST_BIN   256

◆ XN_HASH_NUM_BINS

#define XN_HASH_NUM_BINS   (XN_HASH_LAST_BIN + 1)

Typedef Documentation

◆ XnHashValue

typedef XnUInt8 XnHashValue

The hash value - the output of the hash function

◆ XnKey

typedef XnValue XnKey

The key to the hash