LibreOffice Module sd (master) 1
|
The queue stores and processes all requests from a MasterPageContainer for the creation of previews. More...
#include <MasterPageContainerQueue.hxx>
Classes | |
class | ContainerAdapter |
class | PreviewCreationRequest |
class | RequestQueue |
Public Member Functions | |
~MasterPageContainerQueue () | |
bool | RequestPreview (const SharedMasterPageDescriptor &rDescriptor) |
This method is typically called for entries in the container for which GetPreviewState() returns OS_CREATABLE. More... | |
bool | HasRequest (MasterPageContainer::Token aToken) const |
Return <TRUE> when there is a request currently in the queue for the given token. More... | |
bool | IsEmpty () const |
Return <TRUE> when there is at least one request in the queue. More... | |
void | ProcessAllRequests () |
After this call the queue does not wait anymore for requests with higher priority when only a small number of requests with lower priority are present. More... | |
Static Public Member Functions | |
static MasterPageContainerQueue * | Create (const std::weak_ptr< ContainerAdapter > &rpContainer) |
Private Member Functions | |
MasterPageContainerQueue (std::weak_ptr< ContainerAdapter > pContainer) | |
void | LateInit () |
DECL_LINK (DelayedPreviewCreation, Timer *, void) | |
Static Private Member Functions | |
static sal_Int32 | CalculatePriority (const SharedMasterPageDescriptor &rDescriptor) |
Calculate the priority that defines the order in which requests are processed. More... | |
Private Attributes | |
std::weak_ptr< ContainerAdapter > | mpWeakContainer |
std::unique_ptr< RequestQueue > | mpRequestQueue |
Timer | maDelayedPreviewCreationTimer |
sal_uInt32 | mnRequestsServedCount |
Static Private Attributes | |
static const sal_Int32 | snDelayedCreationTimeout |
The time to wait (in milliseconds) between the creation of previews. More... | |
static const sal_Int32 | snDelayedCreationTimeoutWhenNotIdle |
The time to wait when the system is not idle. More... | |
static const sal_Int32 | snMasterPagePriorityBoost |
Requests for previews of master pages in a document have their priority increased by this value. More... | |
static const sal_Int32 | snWaitForMoreRequestsPriorityThreshold |
When only requests which a priority lower than this threshold exist and not many requests have been made yet then wait with processing them until more requests are present. More... | |
static sal_uInt32 | snWaitForMoreRequestsCount |
When only requests which a priority lower than a threshold exist and not more requests than this number have been made or already processed then wait with processing them until more requests are present. More... | |
The queue stores and processes all requests from a MasterPageContainer for the creation of previews.
The order of request processing and its timing is controlled by a heuristic that uses values given with each request and which is controlled by various parameters that are described below.
Definition at line 37 of file MasterPageContainerQueue.hxx.
sd::sidebar::MasterPageContainerQueue::~MasterPageContainerQueue | ( | ) |
Definition at line 103 of file MasterPageContainerQueue.cxx.
References maDelayedPreviewCreationTimer, mpRequestQueue, and Task::Stop().
|
explicitprivate |
Definition at line 94 of file MasterPageContainerQueue.cxx.
Referenced by Create().
|
staticprivate |
Calculate the priority that defines the order in which requests are processed.
Definition at line 151 of file MasterPageContainerQueue.cxx.
References sd::sidebar::MasterPageContainer::MASTERPAGE, and snMasterPagePriorityBoost.
Referenced by RequestPreview().
|
static |
Definition at line 86 of file MasterPageContainerQueue.cxx.
References LateInit(), and MasterPageContainerQueue().
Referenced by sd::sidebar::MasterPageContainer::Implementation::LateInit().
|
private |
bool sd::sidebar::MasterPageContainerQueue::HasRequest | ( | MasterPageContainer::Token | aToken | ) | const |
Return <TRUE> when there is a request currently in the queue for the given token.
Definition at line 242 of file MasterPageContainerQueue.cxx.
References mpRequestQueue.
bool sd::sidebar::MasterPageContainerQueue::IsEmpty | ( | ) | const |
Return <TRUE> when there is at least one request in the queue.
Definition at line 250 of file MasterPageContainerQueue.cxx.
References mpRequestQueue.
|
private |
Definition at line 110 of file MasterPageContainerQueue.cxx.
References LINK, maDelayedPreviewCreationTimer, Timer::SetInvokeHandler(), Timer::SetTimeout(), and snDelayedCreationTimeout.
Referenced by Create().
void sd::sidebar::MasterPageContainerQueue::ProcessAllRequests | ( | ) |
After this call the queue does not wait anymore for requests with higher priority when only a small number of requests with lower priority are present.
This method should be called when all templates are inserted into the MasterPageContainer.
Definition at line 255 of file MasterPageContainerQueue.cxx.
References maDelayedPreviewCreationTimer, mpRequestQueue, snWaitForMoreRequestsCount, and Timer::Start().
bool sd::sidebar::MasterPageContainerQueue::RequestPreview | ( | const SharedMasterPageDescriptor & | rDescriptor | ) |
This method is typically called for entries in the container for which GetPreviewState() returns OS_CREATABLE.
The creation of the preview is then scheduled to be executed asynchronously at a later point in time. When the preview is available the change listeners will be notified.
Definition at line 118 of file MasterPageContainerQueue.cxx.
References CalculatePriority(), maDelayedPreviewCreationTimer, mpRequestQueue, and Timer::Start().
|
private |
Definition at line 85 of file MasterPageContainerQueue.hxx.
Referenced by LateInit(), ProcessAllRequests(), RequestPreview(), and ~MasterPageContainerQueue().
|
private |
Definition at line 86 of file MasterPageContainerQueue.hxx.
|
private |
Definition at line 84 of file MasterPageContainerQueue.hxx.
Referenced by HasRequest(), IsEmpty(), ProcessAllRequests(), RequestPreview(), and ~MasterPageContainerQueue().
|
private |
Definition at line 81 of file MasterPageContainerQueue.hxx.
|
staticprivate |
The time to wait (in milliseconds) between the creation of previews.
Definition at line 94 of file MasterPageContainerQueue.hxx.
Referenced by LateInit().
|
staticprivate |
The time to wait when the system is not idle.
Definition at line 98 of file MasterPageContainerQueue.hxx.
|
staticprivate |
Requests for previews of master pages in a document have their priority increased by this value.
Definition at line 103 of file MasterPageContainerQueue.hxx.
Referenced by CalculatePriority().
|
staticprivate |
When only requests which a priority lower than a threshold exist and not more requests than this number have been made or already processed then wait with processing them until more requests are present.
Definition at line 116 of file MasterPageContainerQueue.hxx.
Referenced by ProcessAllRequests().
|
staticprivate |
When only requests which a priority lower than this threshold exist and not many requests have been made yet then wait with processing them until more requests are present.
Definition at line 109 of file MasterPageContainerQueue.hxx.