LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::slidesorter::cache::QueueProcessor Class Referencefinal

This queue processor is timer based, i.e. More...

#include <SlsQueueProcessor.hxx>

Collaboration diagram for sd::slidesorter::cache::QueueProcessor:
[legend]

Public Member Functions

 QueueProcessor (RequestQueue &rQueue, std::shared_ptr< BitmapCache > pCache, const Size &rPreviewSize, const bool bDoSuperSampling, SharedCacheContext pCacheContext)
 
 ~QueueProcessor ()
 
void Start (int nPriorityClass)
 Start the processor. More...
 
void Stop ()
 
void Pause ()
 
void Resume ()
 
void SetPreviewSize (const Size &rSize, const bool bDoSuperSampling)
 
void SetBitmapCache (const std::shared_ptr< BitmapCache > &rpCache)
 Use this method when the page cache is (maybe) using a different BitmapCache. More...
 

Private Member Functions

 DECL_LINK (ProcessRequestHdl, Timer *, void)
 
void ProcessRequests ()
 
void ProcessOneRequest (CacheKey aKey, const RequestPriorityClass ePriorityClass)
 

Private Attributes

std::mutex maMutex
 This mutex is used to guard the queue processor. More...
 
Timer maTimer
 
Size maPreviewSize
 
bool mbDoSuperSampling
 
SharedCacheContext mpCacheContext
 
RequestQueuemrQueue
 
std::shared_ptr< BitmapCachempCache
 
BitmapFactory maBitmapFactory
 
bool mbIsPaused
 

Detailed Description

This queue processor is timer based, i.e.

when an entry is added to the queue and the processor is started with Start() in the base class a timer is started that eventually calls ProcessRequest(). This is repeated until the queue is empty or Stop() is called.

Definition at line 39 of file SlsQueueProcessor.hxx.

Constructor & Destructor Documentation

◆ QueueProcessor()

sd::slidesorter::cache::QueueProcessor::QueueProcessor ( RequestQueue rQueue,
std::shared_ptr< BitmapCache pCache,
const Size rPreviewSize,
const bool  bDoSuperSampling,
SharedCacheContext  pCacheContext 
)

Definition at line 33 of file SlsQueueProcessor.cxx.

References LINK, maTimer, Timer::SetInvokeHandler(), and Timer::SetTimeout().

◆ ~QueueProcessor()

sd::slidesorter::cache::QueueProcessor::~QueueProcessor ( )

Definition at line 51 of file SlsQueueProcessor.cxx.

Member Function Documentation

◆ DECL_LINK()

sd::slidesorter::cache::QueueProcessor::DECL_LINK ( ProcessRequestHdl  ,
Timer ,
void   
)
private

◆ Pause()

void sd::slidesorter::cache::QueueProcessor::Pause ( )

Definition at line 75 of file SlsQueueProcessor.cxx.

References mbIsPaused.

◆ ProcessOneRequest()

void sd::slidesorter::cache::QueueProcessor::ProcessOneRequest ( CacheKey  aKey,
const RequestPriorityClass  ePriorityClass 
)
private

◆ ProcessRequests()

void sd::slidesorter::cache::QueueProcessor::ProcessRequests ( )
private

◆ Resume()

void sd::slidesorter::cache::QueueProcessor::Resume ( )

◆ SetBitmapCache()

void sd::slidesorter::cache::QueueProcessor::SetBitmapCache ( const std::shared_ptr< BitmapCache > &  rpCache)

Use this method when the page cache is (maybe) using a different BitmapCache.

This is usually necessary after calling PageCacheManager::ChangeSize().

Definition at line 169 of file SlsQueueProcessor.cxx.

References mpCache.

◆ SetPreviewSize()

void sd::slidesorter::cache::QueueProcessor::SetPreviewSize ( const Size rSize,
const bool  bDoSuperSampling 
)

Definition at line 87 of file SlsQueueProcessor.cxx.

References maPreviewSize, and mbDoSuperSampling.

◆ Start()

void sd::slidesorter::cache::QueueProcessor::Start ( int  nPriorityClass)

Start the processor.

This implementation is timer based and waits a defined amount of time that depends on the given argument before the next entry in the queue is processed.

Parameters
nPriorityClassA priority class of 0 tells the processor that a high priority request is waiting in the queue. The time to wait is thus shorter then that for a low priority request (denoted by a value of 1.) When the timer is already running it is not modified.

Definition at line 55 of file SlsQueueProcessor.cxx.

References Task::IsActive(), maTimer, mbIsPaused, Timer::SetTimeout(), and Timer::Start().

Referenced by ProcessRequests(), and Resume().

◆ Stop()

void sd::slidesorter::cache::QueueProcessor::Stop ( )

Definition at line 69 of file SlsQueueProcessor.cxx.

References Task::IsActive(), maTimer, and Task::Stop().

Member Data Documentation

◆ maBitmapFactory

BitmapFactory sd::slidesorter::cache::QueueProcessor::maBitmapFactory
private

Definition at line 87 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest().

◆ maMutex

std::mutex sd::slidesorter::cache::QueueProcessor::maMutex
private

This mutex is used to guard the queue processor.

Be careful not to mix its use with that of the solar mutex.

Definition at line 78 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest().

◆ maPreviewSize

Size sd::slidesorter::cache::QueueProcessor::maPreviewSize
private

Definition at line 82 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest(), and SetPreviewSize().

◆ maTimer

Timer sd::slidesorter::cache::QueueProcessor::maTimer
private

Definition at line 80 of file SlsQueueProcessor.hxx.

Referenced by QueueProcessor(), Start(), and Stop().

◆ mbDoSuperSampling

bool sd::slidesorter::cache::QueueProcessor::mbDoSuperSampling
private

Definition at line 83 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest(), and SetPreviewSize().

◆ mbIsPaused

bool sd::slidesorter::cache::QueueProcessor::mbIsPaused
private

Definition at line 88 of file SlsQueueProcessor.hxx.

Referenced by Pause(), ProcessRequests(), Resume(), and Start().

◆ mpCache

std::shared_ptr<BitmapCache> sd::slidesorter::cache::QueueProcessor::mpCache
private

Definition at line 86 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest(), and SetBitmapCache().

◆ mpCacheContext

SharedCacheContext sd::slidesorter::cache::QueueProcessor::mpCacheContext
private

Definition at line 84 of file SlsQueueProcessor.hxx.

Referenced by ProcessOneRequest(), and ProcessRequests().

◆ mrQueue

RequestQueue& sd::slidesorter::cache::QueueProcessor::mrQueue
private

Definition at line 85 of file SlsQueueProcessor.hxx.

Referenced by ProcessRequests(), and Resume().


The documentation for this class was generated from the following files: