Foxit PDF SDK

Classes | Public Member Functions | List of all members
CFX_PtrList Class Reference
FXCRT

Inherits CFX_Object.

## Classes
struct | CNode
| Bidirectional node in CFX_PtrList. More...

## Public Member Functions
| CFX_PtrList (int nBlockSize=10, IFX_Allocator *pAllocator=0)
| Construct with block size and allocator. More...
| ~CFX_PtrList ()
FX_POSITION | AddHead (void *newElement)
| Add a value to the head. More...
FX_POSITION | AddTail (void *newElement)
| Add a value to the tail. More...
FX_POSITION | Find (void *searchValue, FX_POSITION startAfter=0) const
| Find a value starting after specified position. More...
FX_POSITION | FindIndex (int index) const
| Find a value by index number. More...
void * | GetAt (FX_POSITION rPosition) const
| Get an value at specified position. More...
int | GetCount () const
| Get the number of nodes. More...
FX_POSITION | GetHeadPosition () const
| Get the header position. More...
void * | GetNext (FX_POSITION &rPosition) const
| Get the the current value and set the position to next node. More...
FX_POSITION | GetNextPosition (FX_POSITION pos) const
| Get the next position. More...
void * | GetPrev (FX_POSITION &rPosition) const
| Get the the current value and set the position to previous node. More...
FX_POSITION | GetPrevPosition (FX_POSITION pos) const
| Get the previous position. More...
FX_POSITION | GetTailPosition () const
| Get the tail position. More...
FX_POSITION | InsertAfter (FX_POSITION pos, void *newElement)
| Insert a value after specified position. More...
void | RemoveAll ()
| Remove all nodes in the list. More...
void | RemoveAt (FX_POSITION pos)
| Remove a node at specified position. More...
void | SetAt (FX_POSITION pos, void *newElement)
| Change the value at specified position. More...

## Detailed Description

The class represents pointer list.

## Constructor & Destructor Documentation

## ◆ CFX_PtrList()

CFX_PtrList::CFX_PtrList | ( | int | nBlockSize = `10`,
|  | IFX_Allocator * | pAllocator = `0`
| ) |  |

Construct with block size and allocator.

Parameters

  [in] | nBlockSize | The block size. Default value: 10.
  [in] | pAllocator | An allocator. Default value: NULL.

## ◆ ~CFX_PtrList()

CFX_PtrList::~CFX_PtrList | ( |  | ) |

The destructor.

## Member Function Documentation

## ◆ AddHead()

FX_POSITION CFX_PtrList::AddHead | ( | void * | newElement | ) |

Add a value to the head.

Parameters

  [in] | newElement | The value to be added to head.

Returns
  The new head position.

## ◆ AddTail()

FX_POSITION CFX_PtrList::AddTail | ( | void * | newElement | ) |

Add a value to the tail.

Parameters

  [in] | newElement | The value to be added to tail.

Returns
  The new tail position.

## ◆ Find()

FX_POSITION CFX_PtrList::Find | ( | void * | searchValue,
|  | FX_POSITION | startAfter = `0`
| ) |  | const

Find a value starting after specified position.

Parameters

  [in] | searchValue | The value to be searched.
  [in] | startAfter | The position to start after.

Returns
  The found position. NULL means find none.

## ◆ FindIndex()

FX_POSITION CFX_PtrList::FindIndex | ( | int | index | ) | const

Find a value by index number.

Parameters

  [in] | index | The zero-based index number of the element.

Returns
  The found position of the element.

## ◆ GetAt()

void* CFX_PtrList::GetAt | ( | FX_POSITION | rPosition | ) | const
| inline

Get an value at specified position.

Parameters

  [in] | rPosition | The input position.

Returns
  Value at specified position.

## ◆ GetCount()

int CFX_PtrList::GetCount | ( |  | ) | const
| inline

Get the number of nodes.

Returns
  The number of nodes in the list.

## ◆ GetHeadPosition()

FX_POSITION CFX_PtrList::GetHeadPosition | ( |  | ) | const
| inline

Get the header position.

Returns
  The header position.

## ◆ GetNext()

void* CFX_PtrList::GetNext | ( | FX_POSITION & | rPosition | ) | const
| inline

Get the the current value and set the position to next node.

Parameters

  [in,out] | rPosition | Input a position, and receive the next node position as result.

Returns
  Current value.

## ◆ GetNextPosition()

FX_POSITION CFX_PtrList::GetNextPosition | ( | FX_POSITION | pos | ) | const
| inline

Get the next position.

Parameters

  [in] | pos | The input position.

Returns
  The next position.

## ◆ GetPrev()

void* CFX_PtrList::GetPrev | ( | FX_POSITION & | rPosition | ) | const
| inline

Get the the current value and set the position to previous node.

Parameters

  [in,out] | rPosition | Input a position, and receive the previous node position as result.

Returns
  Current value.

## ◆ GetPrevPosition()

FX_POSITION CFX_PtrList::GetPrevPosition | ( | FX_POSITION | pos | ) | const
| inline

Get the previous position.

Parameters

  [in] | pos | The input position.

Returns
  The previous position.

## ◆ GetTailPosition()

FX_POSITION CFX_PtrList::GetTailPosition | ( |  | ) | const
| inline

Get the tail position.

Returns
  The tail position.

## ◆ InsertAfter()

FX_POSITION CFX_PtrList::InsertAfter | ( | FX_POSITION | pos,
|  | void * | newElement
| ) |  |

Insert a value after specified position.

Parameters

  [in] | pos | Specify the position.
  [in] | newElement | The new value.

Returns
  The new element position.

## ◆ RemoveAll()

void CFX_PtrList::RemoveAll | ( |  | ) |

Remove all nodes in the list.

Returns
  None.

## ◆ RemoveAt()

void CFX_PtrList::RemoveAt | ( | FX_POSITION | pos | ) |

Remove a node at specified position.

Parameters

  [in] | pos | The position to remove.

Returns
  None.

## ◆ SetAt()

void CFX_PtrList::SetAt | ( | FX_POSITION | pos,
|  | void * | newElement
| ) |  |
| inline

Change the value at specified position.

Parameters

  [in] | pos | The position to change.
  [in] | newElement | The new value.

Returns
  None.