Classes | Defines | Typedefs | Functions
XnHash.h File Reference
#include "XnList.h"
Include dependency graph for XnHash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Defines

#define _XN_DEFAULT_KEY_MANAGER_NAME(ClassName)   _##ClassName##Manager
#define _XN_DEFAULT_KEY_TRANSLATOR(ClassName)   _##ClassName##KeyTranslator
#define _XN_DEFAULT_VALUE_TRANSLATOR(ClassName)   _##ClassName##ValueTranslator
#define XN_DECLARE_DEFAULT_HASH(KeyType, ValueType, ClassName)   XN_DECLARE_DEFAULT_HASH_DECL(, KeyType, ValueType, ClassName)
#define XN_DECLARE_DEFAULT_HASH_DECL(decl, KeyType, ValueType, ClassName)
#define XN_DECLARE_DEFAULT_KEY_MANAGER(KeyType, ClassName, KeyTranslator)   XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(, KeyType, ClassName, KeyTranslator)
#define XN_DECLARE_DEFAULT_KEY_MANAGER_DECL(decl, KeyType, ClassName, KeyTranslator)
#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_MANAGER_HASH_DECL(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator)
#define XN_DECLARE_HASH(KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)   XN_DECLARE_HASH_DECL(, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)
#define XN_DECLARE_HASH_DECL(decl, KeyType, ValueType, ClassName, KeyTranslator, ValueTranslator, KeyManager)
#define XN_HASH_LAST_BIN   256
#define XN_HASH_NUM_BINS   (XN_HASH_LAST_BIN + 1)

Typedefs

typedef XnUInt8 XnHashValue
typedef XnValue XnKey

Functions

static XnInt32 XnDefaultCompareFunction (const XnKey &key1, const XnKey &key2)
static XnHashValue XnDefaultHashFunction (const XnKey &key)

Define Documentation

#define _XN_DEFAULT_KEY_MANAGER_NAME (   ClassName)    _##ClassName##Manager

Definition at line 1016 of file XnHash.h.

#define _XN_DEFAULT_KEY_TRANSLATOR (   ClassName)    _##ClassName##KeyTranslator

Definition at line 1034 of file XnHash.h.

#define _XN_DEFAULT_VALUE_TRANSLATOR (   ClassName)    _##ClassName##ValueTranslator

Definition at line 1035 of file XnHash.h.

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

Definition at line 1051 of file XnHash.h.

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

Definition at line 1042 of file XnHash.h.

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

Definition at line 788 of file XnHash.h.

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

Definition at line 767 of file XnHash.h.

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

Definition at line 1031 of file XnHash.h.

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

Definition at line 1023 of file XnHash.h.

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

Definition at line 1013 of file XnHash.h.

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

Definition at line 796 of file XnHash.h.

#define XN_HASH_LAST_BIN   256

Definition at line 37 of file XnHash.h.

#define XN_HASH_NUM_BINS   (XN_HASH_LAST_BIN + 1)

Definition at line 38 of file XnHash.h.


Typedef Documentation

The hash value - the output of the hash function

Definition at line 50 of file XnHash.h.

typedef XnValue XnKey

The key to the hash

Definition at line 45 of file XnHash.h.


Function Documentation

static XnInt32 XnDefaultCompareFunction ( const XnKey key1,
const XnKey key2 
) [static]

Default Compare function

Definition at line 63 of file XnHash.h.

static XnHashValue XnDefaultHashFunction ( const XnKey key) [static]

Default Hash function

Definition at line 55 of file XnHash.h.



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