OpenNI 1.5.4: XnHash.h File Reference

OpenNI

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

Go to the source code of this file.

Classes

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

Defines

#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

Define Documentation

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

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

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.

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

#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);                              \
        }                                                                               \
    };

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.

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

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

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.

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

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

#define XN_HASH_LAST_BIN   256
#define XN_HASH_NUM_BINS   (XN_HASH_LAST_BIN + 1)

Typedef Documentation

typedef XnUInt8 XnHashValue

The hash value - the output of the hash function

typedef XnValue XnKey

The key to the hash

Generated on Wed May 16 2012 10:16:05 for OpenNI 1.5.4 by   doxygen 1.7.5.1