LibreOffice Module sd (master) 1
|
The request queue stores requests that are described by the Request sorted according to priority class and then priority. More...
#include <SlsRequestQueue.hxx>
Classes | |
class | Container |
Public Member Functions | |
RequestQueue (SharedCacheContext pCacheContext) | |
virtual | ~RequestQueue () |
void | AddRequest (CacheKey aKey, RequestPriorityClass eRequestClass) |
Insert a request with highest or lowest priority in its priority class. More... | |
bool | RemoveRequest (CacheKey aKey) |
Remove the specified request from the queue. More... | |
void | ChangeClass (CacheKey aKey, RequestPriorityClass eNewRequestClass) |
Change the priority class of the specified request. More... | |
CacheKey | GetFront () |
Get the request with the highest priority int the highest priority class. More... | |
RequestPriorityClass | GetFrontPriorityClass () |
void | PopFront () |
Really a synonym for RemoveRequest(GetFront());. More... | |
bool | IsEmpty () |
Returns <TRUE> when there is no element in the queue. More... | |
void | Clear () |
Remove all requests from the queue. More... | |
::osl::Mutex & | GetMutex () |
Return the mutex that guards the access to the priority queue. More... | |
virtual void | PageInDestruction (const SdrPage &rPage) override |
Ensure we don't hand out a page deleted before anyone got a chance to process it. More... | |
virtual void | PageInDestruction (const SdrPage &rPage)=0 |
Private Attributes | |
::osl::Mutex | maMutex |
std::unique_ptr< Container > | mpRequestQueue |
SharedCacheContext | mpCacheContext |
int | mnMinimumPriority |
A lower bound of the lowest priority of all elements in the queues. More... | |
int | mnMaximumPriority |
An upper bound of the highest priority of all elements in the queues. More... | |
Additional Inherited Members | |
![]() | |
~PageUser () | |
The request queue stores requests that are described by the Request sorted according to priority class and then priority.
Definition at line 34 of file SlsRequestQueue.hxx.
|
explicit |
Definition at line 95 of file SlsRequestQueue.cxx.
|
virtual |
Definition at line 103 of file SlsRequestQueue.cxx.
References Clear().
void sd::slidesorter::cache::RequestQueue::AddRequest | ( | CacheKey | aKey, |
RequestPriorityClass | eRequestClass | ||
) |
Insert a request with highest or lowest priority in its priority class.
When the request is already present then it is first removed. This effect is then a re-prioritization.
aKey | The request. |
eRequestClass | The priority class in which to insert the request with highest or lowest priority. |
bInsertWithHighestPriority | When this flag is <TRUE> the request is inserted with highest priority in its class. When <FALSE> the request is inserted with lowest priority. |
Definition at line 108 of file SlsRequestQueue.cxx.
References SdrPage::AddPageUser(), SdrPage::GetPageNum(), maMutex, sd::slidesorter::cache::MAX_CLASS, sd::slidesorter::cache::MIN_CLASS, mpCacheContext, mpRequestQueue, RemoveRequest(), and SAL_INFO.
Referenced by ChangeClass(), sd::slidesorter::cache::RequestFactory::operator()(), and sd::slidesorter::cache::GenericPageCache::RequestPreviewBitmap().
void sd::slidesorter::cache::RequestQueue::ChangeClass | ( | CacheKey | aKey, |
RequestPriorityClass | eNewRequestClass | ||
) |
Change the priority class of the specified request.
Definition at line 192 of file SlsRequestQueue.cxx.
References AddRequest(), maMutex, sd::slidesorter::cache::MAX_CLASS, sd::slidesorter::cache::MIN_CLASS, and mpRequestQueue.
Referenced by sd::slidesorter::cache::GenericPageCache::SetPreciousFlag().
void sd::slidesorter::cache::RequestQueue::Clear | ( | ) |
Remove all requests from the queue.
This resets the minimum and maximum priorities to their default values.
Definition at line 259 of file SlsRequestQueue.cxx.
References maMutex, mnMaximumPriority, mnMinimumPriority, mpRequestQueue, and SdrPage::RemovePageUser().
Referenced by sd::slidesorter::cache::GenericPageCache::InvalidateCache(), sd::slidesorter::cache::GenericPageCache::~GenericPageCache(), and ~RequestQueue().
CacheKey sd::slidesorter::cache::RequestQueue::GetFront | ( | ) |
Get the request with the highest priority int the highest priority class.
Definition at line 211 of file SlsRequestQueue.cxx.
References maMutex, and mpRequestQueue.
Referenced by sd::slidesorter::cache::QueueProcessor::ProcessRequests().
RequestPriorityClass sd::slidesorter::cache::RequestQueue::GetFrontPriorityClass | ( | ) |
Definition at line 222 of file SlsRequestQueue.cxx.
References maMutex, and mpRequestQueue.
Referenced by sd::slidesorter::cache::QueueProcessor::ProcessRequests(), and sd::slidesorter::cache::QueueProcessor::Resume().
|
inline |
Return the mutex that guards the access to the priority queue.
Definition at line 93 of file SlsRequestQueue.hxx.
References maMutex.
Referenced by sd::slidesorter::cache::QueueProcessor::ProcessRequests().
bool sd::slidesorter::cache::RequestQueue::IsEmpty | ( | ) |
Returns <TRUE> when there is no element in the queue.
Definition at line 253 of file SlsRequestQueue.cxx.
References maMutex, and mpRequestQueue.
Referenced by sd::slidesorter::cache::QueueProcessor::ProcessRequests(), and sd::slidesorter::cache::QueueProcessor::Resume().
|
overridevirtual |
Ensure we don't hand out a page deleted before anyone got a chance to process it.
Implements sdr::PageUser.
Definition at line 145 of file SlsRequestQueue.cxx.
References RemoveRequest().
void sd::slidesorter::cache::RequestQueue::PopFront | ( | ) |
Really a synonym for RemoveRequest(GetFront());.
Definition at line 233 of file SlsRequestQueue.cxx.
References maMutex, mnMaximumPriority, mnMinimumPriority, mpRequestQueue, and SdrPage::RemovePageUser().
Referenced by sd::slidesorter::cache::QueueProcessor::ProcessRequests().
bool sd::slidesorter::cache::RequestQueue::RemoveRequest | ( | CacheKey | aKey | ) |
Remove the specified request from the queue.
aKey | It is OK when the specified request is not a member of the queue. |
Definition at line 156 of file SlsRequestQueue.cxx.
References maMutex, mnMaximumPriority, mnMinimumPriority, mpRequestQueue, and SdrPage::RemovePageUser().
Referenced by AddRequest(), PageInDestruction(), and sd::slidesorter::cache::GenericPageCache::SetPreciousFlag().
|
private |
Definition at line 101 of file SlsRequestQueue.hxx.
Referenced by AddRequest(), ChangeClass(), Clear(), GetFront(), GetFrontPriorityClass(), GetMutex(), IsEmpty(), PopFront(), and RemoveRequest().
|
private |
An upper bound of the highest priority of all elements in the queues.
The start value is 1. It is assigned and then increased every time when an element is inserted or marked as the request with highest priority.
Definition at line 117 of file SlsRequestQueue.hxx.
Referenced by Clear(), PopFront(), and RemoveRequest().
|
private |
A lower bound of the lowest priority of all elements in the queues.
The start value is 0. It is assigned and then decreased every time when an element is inserted or marked as the request with lowest priority.
Definition at line 111 of file SlsRequestQueue.hxx.
Referenced by Clear(), PopFront(), and RemoveRequest().
|
private |
Definition at line 104 of file SlsRequestQueue.hxx.
Referenced by AddRequest().
|
private |
Definition at line 103 of file SlsRequestQueue.hxx.
Referenced by AddRequest(), ChangeClass(), Clear(), GetFront(), GetFrontPriorityClass(), IsEmpty(), PopFront(), and RemoveRequest().