Foxit PDF Conversion SDK

Public Member Functions | List of all members
CFX_MapPtrTemplate< KeyType, ValueType > Class Template Reference
FXCRT
Inheritance diagram for CFX_MapPtrTemplate< KeyType, ValueType >:

## Public Member Functions
| CFX_MapPtrTemplate (IFX_Allocator *pAllocator=0)
| Default constructor. More...
void | GetNextAssoc (FX_POSITION &rNextPosition, KeyType &rKey, ValueType &rValue) const
| Get the current association and set the position to next association. More...
FX_BOOL | Lookup (KeyType key, ValueType &rValue) const
| Lookup by a key. More...
ValueType & | operator[] (KeyType key)
| Subscript([]) operator overload. Lookup and add if not there. More...
FX_BOOL | RemoveKey (KeyType key)
| Remove existing (key, ?) pair. More...
void | SetAt (KeyType key, ValueType newValue)
| Add a new (key, value) pair. Add if not exist, otherwise modify. More...
Public Member Functions inherited from CFX_MapPtrToPtr
| CFX_MapPtrToPtr (int nBlockSize=10, IFX_Allocator *pAllocator=0)
| Construct with specified block size. More...
| ~CFX_MapPtrToPtr ()
| The Destructor.
int | GetCount () const
| Get the number of elements. More...
FX_DWORD | GetHashTableSize () const
| Get the internal hash table size. Advanced features for derived classes. More...
void | GetNextAssoc (FX_POSITION &rNextPosition, void *&rKey, void *&rValue) const
| Get the current association and set the position to next association. More...
FX_POSITION | GetStartPosition () const
| Get the first key-value pair position. iterating all (key, value) pairs. More...
void * | GetValueAt (void *key) const
| Get a value pointer by a key. More...
void | InitHashTable (FX_DWORD hashSize, FX_BOOL bAllocNow=true)
| Initialize the hash table. More...
FX_BOOL | IsEmpty () const
| Verify whether the map is empty. More...
FX_BOOL | Lookup (void *key, void *&rValue) const
| Lookup by a key. More...
void *& | operator[] (void *key)
| Subscript([]) operator overload. Lookup and add if not there. More...
void | RemoveAll ()
| Remove all the (key, value) pairs in the map. More...
FX_BOOL | RemoveKey (void *key)
| Removing existing (key, ?) pair. More...
void | SetAt (void *key, void *newValue)
| Add a new (key, value) pair. Add if not exist, otherwise modify. More...

## Detailed Description

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

The class represents POINTER/DWORD TO POINTER/DWORD MAP template.

## Constructor & Destructor Documentation

## ◆ CFX_MapPtrTemplate()

template<class KeyType , class ValueType >

CFX_MapPtrTemplate< KeyType, ValueType >::CFX_MapPtrTemplate | ( | IFX_Allocator * | pAllocator = `0` | ) |
| inline

Default constructor.

Parameters

  [in] | pAllocator | An allocator. Defautl value: NULL.

## Member Function Documentation

## ◆ GetNextAssoc()

template<class KeyType , class ValueType >

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

Get the current association and set the position to next association.

Parameters

  [in,out] | rNextPosition | Input a position, and receive the next association position as result.
  [out] | rKey | Receive a key.
  [out] | rValue | Receive a value.

Returns
  None.

## ◆ Lookup()

template<class KeyType , class ValueType >

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

Lookup by a key.

Parameters

  [in] | key | The key to lookup.
  [out] | rValue | A reference of a value to receive the found value.

Returns
  true means the key is found, while false means the key is not found.

## ◆ operator[]()

template<class KeyType , class ValueType >

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

Subscript([]) operator overload. Lookup and add if not there.

Parameters

  [in] | key | The key to lookup.

Returns
  A reference to the found value.

## ◆ RemoveKey()

template<class KeyType , class ValueType >

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

Remove existing (key, ?) pair.

Parameters

  [in] | key | The key to be removed.

Returns
  true means the removing is successfully, while false means the key does not exist.

## ◆ SetAt()

template<class KeyType , class ValueType >

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

Add a new (key, value) pair. Add if not exist, otherwise modify.

Parameters

  [in] | key | The key to specify a position.
  [in] | newValue | The new value.

Returns
  None.