#include <PdfPageTreeCache.h>
This class implements a cache infront of a PdfPageTree
- See also
- PdfCachedPagesTree
◆ PdfPageTreeCache()
| PdfPageTreeCache::PdfPageTreeCache |
( |
unsigned |
initialSize | ) |
|
Construct a new PdfCachedPagesTree.
- Parameters
-
| nInitialSize | initial size of the pagestree |
◆ 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
-
◆ 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
-
| atIndex | page index, 0-based |
- Returns
- a pointer to the requested page or nullptr if it is not cached
◆ InsertPlaceHolder()
| void PdfPageTreeCache::InsertPlaceHolder |
( |
unsigned |
atIndex | ) |
|
Insert a page placeholder at the given index therefore the cache has to be updated
- Parameters
-
| atIndex | zero based index of the page we are inserting |
◆ InsertPlaceHolders()
| void PdfPageTreeCache::InsertPlaceHolders |
( |
unsigned |
atIndex, |
|
|
unsigned |
count |
|
) |
| |
Insert several page placeholders at the given index therefore the cache has to be updated
- Parameters
-
| atIndex | zero based index of the page we are inserting |
| count | number 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
-
| atIndex | index of the page |
| page | page 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
-
| atIndex | zero based index of where the first page will be placed |
| pages | vector of the page objects to add |