Foxit PDF SDK
CFX_CMapDWordToDWord Class Reference

Inherits CFX_Object.

Public Member Functions

 CFX_CMapDWordToDWord (IFX_Allocator *pAllocator=0)
 Constructor with allocator. More...
 
void EstimateSize (FX_DWORD size, FX_DWORD grow_by)
 Change internal allocation size and grow amount. More...
 
void GetNextAssoc (FX_POSITION &pos, FX_DWORD &key, FX_DWORD &value) const
 Get the next association. More...
 
FX_POSITION GetStartPosition () const
 Get the first key-value pair position. iterating all (key, value) pairs. More...
 
FX_BOOL Lookup (FX_DWORD key, FX_DWORD &value) const
 Lookup by a key. More...
 
void RemoveAll ()
 Remove all (key, value) pair. More...
 
void SetAt (FX_DWORD key, FX_DWORD value)
 Add a new (key, value) pair. Add if not exist, otherwise modify. More...
 

Protected Attributes

CFX_BinaryBuf m_Buffer
 

Detailed Description

The class represents a compact map class that simply put all mapping into one single buffer The map is kept sorted so lookup can be pretty fast.

Constructor & Destructor Documentation

◆ CFX_CMapDWordToDWord()

CFX_CMapDWordToDWord::CFX_CMapDWordToDWord ( IFX_Allocator pAllocator = 0)
inline

Constructor with allocator.

Parameters
[in]pAllocatorAn allocator. Default value: NULL.

Member Function Documentation

◆ EstimateSize()

void CFX_CMapDWordToDWord::EstimateSize ( FX_DWORD  size,
FX_DWORD  grow_by 
)

Change internal allocation size and grow amount.

Parameters
[in]sizeThe new allocation size.
[in]grow_byThe new grow amount.
Returns
None.

◆ GetNextAssoc()

void CFX_CMapDWordToDWord::GetNextAssoc ( FX_POSITION pos,
FX_DWORD key,
FX_DWORD value 
) const

Get the next association.

Parameters
[in,out]posInput a position, and receive the next (key, value) pair position as result.
[out]keyReceive a key.
[out]valueReceive a value.
Returns
None.

◆ GetStartPosition()

FX_POSITION CFX_CMapDWordToDWord::GetStartPosition ( ) const

Get the first key-value pair position. iterating all (key, value) pairs.

Returns
The first key-value pair position in the map.

◆ Lookup()

FX_BOOL CFX_CMapDWordToDWord::Lookup ( FX_DWORD  key,
FX_DWORD value 
) const

Lookup by a key.

Parameters
[in]keyThe key to lookup.
[out]valueA reference of a FX_DWORD value to receive the found value.
Returns
true means the key is found, while false means the key is not found.

◆ RemoveAll()

void CFX_CMapDWordToDWord::RemoveAll ( )
inline

Remove all (key, value) pair.

Returns
None.

◆ SetAt()

void CFX_CMapDWordToDWord::SetAt ( FX_DWORD  key,
FX_DWORD  value 
)

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

Parameters
[in]keyThe key to specify a position.
[in]valueThe new FX_DWORD value.
Returns
None.

Member Data Documentation

◆ m_Buffer

CFX_BinaryBuf CFX_CMapDWordToDWord::m_Buffer
protected

(key, value) pair buffer.