PoDoFo 0.9.20
PoDoFo::PdfPageTreeCache Class Referencefinal

#include <PdfPageTreeCache.h>

Public Member Functions

 PdfPageTreeCache (unsigned initialSize)
 
PdfPageGetPage (unsigned index)
 
void SetPage (unsigned atIndex, PdfPage *page)
 
void SetPages (unsigned atIndex, const std::vector< PdfPage * > &pages)
 
void InsertPlaceHolders (unsigned atIndex, unsigned count)
 
void DeletePage (unsigned atIndex)
 
void ClearCache ()
 

Detailed Description

This class implements a cache infront of a PdfPageTree

See also
PdfCachedPagesTree

Constructor & Destructor Documentation

◆ PdfPageTreeCache()

PdfPageTreeCache::PdfPageTreeCache ( unsigned initialSize)

Construct a new PdfCachedPagesTree.

Parameters
nInitialSizeinitial size of the pagestree

Member Function Documentation

◆ ClearCache()

void PdfPageTreeCache::ClearCache ( )

Clear cache, i.e. remove all elements from the cache.

◆ DeletePage()

void PdfPageTreeCache::DeletePage ( unsigned atIndex)

Delete a PdfPage from the cache

Parameters
atIndexindex of the page

◆ GetPage()

PdfPage * PdfPageTreeCache::GetPage ( unsigned index)

Return a PdfPage for the specified Page index The returned page is owned by the pages tree and deleted along with it.

Parameters
atIndexpage index, 0-based
Returns
a pointer to the requested page or nullptr if it is not cached

◆ InsertPlaceHolders()

void PdfPageTreeCache::InsertPlaceHolders ( unsigned atIndex,
unsigned count )

Insert several page placeholders at the given index therefore the cache has to be updated

Parameters
atIndexzero based index of the page we are inserting
countnumber of pages that were inserted

◆ SetPage()

void PdfPageTreeCache::SetPage ( unsigned atIndex,
PdfPage * page )

Set a PdfPage object in the cache at the given index. Existing object will be replaced

Parameters
atIndexindex of the page
pagepage object

◆ SetPages()

void PdfPageTreeCache::SetPages ( unsigned atIndex,
const std::vector< PdfPage * > & pages )

Add several PdfPage objects to the cache, replacing any existing at the given index

Parameters
atIndexzero based index of where the first page will be placed
pagesvector of the page objects to add