RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Hash< TKey, TValue > 模板类 参考

Hash class (not thread-safe) 更多...

#include <vrpn_HashST.h>

Public 成员函数

 vrpn_Hash (int init=16)
 constructor
 
 vrpn_Hash (unsigned int(*func)(const TKey &key), int init=16)
 constructor
 
virtual ~vrpn_Hash ()
 destructor
 
void Clear ()
 clears the Hash
 
unsigned int GetNrItems () const
 returns the number of items in the Hash
 
TValue & Find (const TKey &key)
 returns the value that belongs to this key
 
const TValue & Find (const TKey &key) const
 returns the value that belongs to this key
 
bool IsPresent (const TValue &value, TKey &key) const
 checks if the Hash contains a value and returns its key
 
bool MoveFirst () const
 moves an iterator to the first element and returns false if no element is present
 
bool MoveNext () const
 moves the iterator to the next element and returns false if no more element is present
 
TValue GetCurrentValue () const
 returns the value of the current item
 
TKey GetCurrentKey () const
 returns the key of the current item
 
void SetCurrentValue (TValue theValue)
 sets the Value of the current key
 
bool GetCurrentKeyAndValue (TKey &theKey, TValue &theValue) const
 returns the key and the value of the current item
 
bool Add (TKey key, TValue value)
 adds a new (key, value) pair, returns true if succeeded
 
bool Remove (TKey key)
 removes the value that belongs to this key, returns true if succeeded
 

详细描述

template<class TKey, class TValue>
class vrpn_Hash< TKey, TValue >

Hash class (not thread-safe)

This class implements a NON thread-safe template Hash. Both the key as the value are templates. It is possible to iterate over this Hash, but no guarantee is given about the order in which the items are returned. All keys must be unique.

注意
In order to use the find function, the value template must support a cast from 0.
作者
Joan De Boeck
Chris Raymaekers

构造及析构函数说明

◆ vrpn_Hash() [1/2]

template<class TKey , class TValue >
vrpn_Hash ( int init = 16)

constructor

Constructs a new Hash

参数
initHash's initial size and grow size

◆ vrpn_Hash() [2/2]

template<class TKey , class TValue >
vrpn_Hash ( unsigned int(* func )(const TKey &key),
int init = 16 )

constructor

Constructs a new Hash

参数
functhe function that used to calculate Hash values from the keys
initHash's initial size and grow size

◆ ~vrpn_Hash()

template<class TKey , class TValue >
~vrpn_Hash ( )
virtual

destructor

成员函数说明

◆ Add()

template<class TKey , class TValue >
bool Add ( TKey key,
TValue value )

adds a new (key, value) pair, returns true if succeeded

◆ Clear()

template<class TKey , class TValue >
void Clear ( )

clears the Hash

◆ Find() [1/2]

template<class TKey , class TValue >
TValue & Find ( const TKey & key)

returns the value that belongs to this key

◆ Find() [2/2]

template<class TKey , class TValue >
const TValue & Find ( const TKey & key) const

returns the value that belongs to this key

◆ GetCurrentKey()

template<class TKey , class TValue >
TKey GetCurrentKey ( ) const

returns the key of the current item

◆ GetCurrentKeyAndValue()

template<class TKey , class TValue >
bool GetCurrentKeyAndValue ( TKey & theKey,
TValue & theValue ) const

returns the key and the value of the current item

◆ GetCurrentValue()

template<class TKey , class TValue >
TValue GetCurrentValue ( ) const

returns the value of the current item

◆ GetNrItems()

template<class TKey , class TValue >
unsigned int GetNrItems ( ) const
inline

returns the number of items in the Hash

◆ IsPresent()

template<class TKey , class TValue >
bool IsPresent ( const TValue & value,
TKey & key ) const

checks if the Hash contains a value and returns its key

◆ MoveFirst()

template<class TKey , class TValue >
bool MoveFirst ( ) const

moves an iterator to the first element and returns false if no element is present

◆ MoveNext()

template<class TKey , class TValue >
bool MoveNext ( ) const

moves the iterator to the next element and returns false if no more element is present

◆ Remove()

template<class TKey , class TValue >
bool Remove ( TKey key)

removes the value that belongs to this key, returns true if succeeded

◆ SetCurrentValue()

template<class TKey , class TValue >
void SetCurrentValue ( TValue theValue)

sets the Value of the current key


该类的文档由以下文件生成: