Foxit PDF SDK
CFX_MapPtrTemplate< KeyType, ValueType > 模板类 参考
类 CFX_MapPtrTemplate< KeyType, ValueType > 继承关系图:
CFX_MapPtrToPtr

Public 成员函数

 CFX_MapPtrTemplate (IFX_Allocator *pAllocator=0)
 默认构造函数。 更多...
 
void GetNextAssoc (FX_POSITION &rNextPosition, KeyType &rKey, ValueType &rValue) const
 获取当前关联并将位置设置为下一个关联。 更多...
 
FX_BOOL Lookup (KeyType key, ValueType &rValue) const
 通过键查找。 更多...
 
ValueType & operator[] (KeyType key)
 下标([])运算符重载。查找,如果不存在则添加。 更多...
 
FX_BOOL RemoveKey (KeyType key)
 移除现有的(键, 值)对。 更多...
 
void SetAt (KeyType key, ValueType newValue)
 添加新的(键, 值)对。如果不存在则添加,否则修改。 更多...
 
- Public 成员函数 继承自 CFX_MapPtrToPtr
 CFX_MapPtrToPtr (int nBlockSize=10, IFX_Allocator *pAllocator=0)
 使用指定的块大小进行构造。 更多...
 
 ~CFX_MapPtrToPtr ()
 析构函数。
 
int GetCount () const
 获取元素的数量。 更多...
 
FX_DWORD GetHashTableSize () const
 获取内部哈希表大小。派生类的高级功能。 更多...
 
void GetNextAssoc (FX_POSITION &rNextPosition, void *&rKey, void *&rValue) const
 获取当前关联并将位置设置为下一个关联。 更多...
 
FX_POSITION GetStartPosition () const
 获取第一个键值对位置。用于遍历所有(键, 值)对。 更多...
 
void * GetValueAt (void *key) const
 通过键获取值指针。 更多...
 
void InitHashTable (FX_DWORD hashSize, FX_BOOL bAllocNow=true)
 初始化哈希表。 更多...
 
FX_BOOL IsEmpty () const
 验证映射是否为空。 更多...
 
FX_BOOL Lookup (void *key, void *&rValue) const
 通过键查找。 更多...
 
void *& operator[] (void *key)
 下标([])运算符重载。查找,如果不存在则添加。 更多...
 
void RemoveAll ()
 移除映射中的所有(键, 值)对。 更多...
 
FX_BOOL RemoveKey (void *key)
 移除现有的(键, 值)对。 更多...
 
void SetAt (void *key, void *newValue)
 添加新的(键, 值)对。如果不存在则添加,否则修改。 更多...
 

详细描述

template<class KeyType, class ValueType>
class CFX_MapPtrTemplate< KeyType, ValueType >

表示指针/双字到指针/双字映射模板的类。

构造及析构函数说明

◆ CFX_MapPtrTemplate()

template<class KeyType , class ValueType >
CFX_MapPtrTemplate< KeyType, ValueType >::CFX_MapPtrTemplate ( IFX_Allocator pAllocator = 0)
inline

默认构造函数。

参数
[in]pAllocator分配器。默认值:NULL

成员函数说明

◆ GetNextAssoc()

template<class KeyType , class ValueType >
void CFX_MapPtrTemplate< KeyType, ValueType >::GetNextAssoc ( FX_POSITION rNextPosition,
KeyType &  rKey,
ValueType &  rValue 
) const
inline

获取当前关联并将位置设置为下一个关联。

参数
[in,out]rNextPosition输入一个位置,并接收下一个关联位置作为结果。
[out]rKey接收键。
[out]rValue接收值。
返回
无。

◆ Lookup()

template<class KeyType , class ValueType >
FX_BOOL CFX_MapPtrTemplate< KeyType, ValueType >::Lookup ( KeyType  key,
ValueType &  rValue 
) const
inline

通过键查找。

参数
[in]key要查找的键。
[out]rValue接收找到值的值的引用。
返回
true表示找到键,false表示未找到键。

◆ operator[]()

template<class KeyType , class ValueType >
ValueType& CFX_MapPtrTemplate< KeyType, ValueType >::operator[] ( KeyType  key)
inline

下标([])运算符重载。查找,如果不存在则添加。

参数
[in]key要查找的键。
返回
找到值的引用。

◆ RemoveKey()

template<class KeyType , class ValueType >
FX_BOOL CFX_MapPtrTemplate< KeyType, ValueType >::RemoveKey ( KeyType  key)
inline

移除现有的(键, 值)对。

参数
[in]key要移除的键。
返回
true表示移除成功,false表示键不存在。

◆ SetAt()

template<class KeyType , class ValueType >
void CFX_MapPtrTemplate< KeyType, ValueType >::SetAt ( KeyType  key,
ValueType  newValue 
)
inline

添加新的(键, 值)对。如果不存在则添加,否则修改。

参数
[in]key指定位置的键。
[in]newValue新值。
返回
无。