LibreOffice Module sd (master) 1
|
This queue processor is timer based, i.e. More...
#include <SlsQueueProcessor.hxx>
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 |
RequestQueue & | mrQueue |
std::shared_ptr< BitmapCache > | mpCache |
BitmapFactory | maBitmapFactory |
bool | mbIsPaused |
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.
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().
sd::slidesorter::cache::QueueProcessor::~QueueProcessor | ( | ) |
Definition at line 51 of file SlsQueueProcessor.cxx.
|
private |
void sd::slidesorter::cache::QueueProcessor::Pause | ( | ) |
Definition at line 75 of file SlsQueueProcessor.cxx.
References mbIsPaused.
|
private |
Definition at line 140 of file SlsQueueProcessor.cxx.
References sd::slidesorter::cache::BitmapFactory::CreateBitmap(), maBitmapFactory, maMutex, maPreviewSize, mbDoSuperSampling, mpCache, mpCacheContext, sd::slidesorter::cache::NOT_VISIBLE, and TOOLS_WARN_EXCEPTION.
Referenced by ProcessRequests().
|
private |
Definition at line 100 of file SlsQueueProcessor.cxx.
References sd::slidesorter::cache::RequestQueue::GetFront(), sd::slidesorter::cache::RequestQueue::GetFrontPriorityClass(), sd::slidesorter::cache::RequestQueue::GetMutex(), sd::slidesorter::cache::RequestQueue::IsEmpty(), mbIsPaused, mpCacheContext, mrQueue, sd::slidesorter::cache::NOT_VISIBLE, sd::slidesorter::cache::RequestQueue::PopFront(), ProcessOneRequest(), and Start().
void sd::slidesorter::cache::QueueProcessor::Resume | ( | ) |
Definition at line 80 of file SlsQueueProcessor.cxx.
References sd::slidesorter::cache::RequestQueue::GetFrontPriorityClass(), sd::slidesorter::cache::RequestQueue::IsEmpty(), mbIsPaused, mrQueue, and Start().
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.
void sd::slidesorter::cache::QueueProcessor::SetPreviewSize | ( | const Size & | rSize, |
const bool | bDoSuperSampling | ||
) |
Definition at line 87 of file SlsQueueProcessor.cxx.
References maPreviewSize, and mbDoSuperSampling.
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.
nPriorityClass | A 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().
void sd::slidesorter::cache::QueueProcessor::Stop | ( | ) |
Definition at line 69 of file SlsQueueProcessor.cxx.
References Task::IsActive(), maTimer, and Task::Stop().
|
private |
Definition at line 87 of file SlsQueueProcessor.hxx.
Referenced by ProcessOneRequest().
|
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().
|
private |
Definition at line 82 of file SlsQueueProcessor.hxx.
Referenced by ProcessOneRequest(), and SetPreviewSize().
|
private |
Definition at line 80 of file SlsQueueProcessor.hxx.
Referenced by QueueProcessor(), Start(), and Stop().
|
private |
Definition at line 83 of file SlsQueueProcessor.hxx.
Referenced by ProcessOneRequest(), and SetPreviewSize().
|
private |
Definition at line 88 of file SlsQueueProcessor.hxx.
Referenced by Pause(), ProcessRequests(), Resume(), and Start().
|
private |
Definition at line 86 of file SlsQueueProcessor.hxx.
Referenced by ProcessOneRequest(), and SetBitmapCache().
|
private |
Definition at line 84 of file SlsQueueProcessor.hxx.
Referenced by ProcessOneRequest(), and ProcessRequests().
|
private |
Definition at line 85 of file SlsQueueProcessor.hxx.
Referenced by ProcessRequests(), and Resume().