LibreOffice Module sd (master) 1
|
The ChangeRequestQueueProcessor owns the ChangeRequestQueue and processes the configuration change requests. More...
#include <ChangeRequestQueueProcessor.hxx>
Public Member Functions | |
ChangeRequestQueueProcessor (std::shared_ptr< ConfigurationUpdater > pUpdater) | |
The queue processor is created with a reference to an ConfigurationController so that its UpdateConfiguration() method can be called when the queue becomes empty. More... | |
~ChangeRequestQueueProcessor () | |
void | SetConfiguration (const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration) |
Sets the configuration who will be changed by subsequent change requests. More... | |
void | AddRequest (const css::uno::Reference< css::drawing::framework::XConfigurationChangeRequest > &rxRequest) |
The given request is appended to the end of the queue and will eventually be processed when all other entries in front of it have been processed. More... | |
bool | IsEmpty () const |
Returns </sal_True> when the queue is empty. More... | |
void | ProcessUntilEmpty () |
Process all events in the queue synchronously. More... | |
void | ProcessOneEvent () |
Process the first event in queue. More... | |
void | Clear () |
Remove all events from the queue. More... | |
Private Member Functions | |
void | StartProcessing () |
Initiate the processing of the entries in the queue. More... | |
DECL_LINK (ProcessEvent, void *, void) | |
Callback function for the PostUserEvent() call. More... | |
Private Attributes | |
mutable::osl::Mutex | maMutex |
ChangeRequestQueue | maQueue |
ImplSVEvent * | mnUserEventId |
The id returned by the last PostUserEvent() call. More... | |
css::uno::Reference< css::drawing::framework::XConfiguration > | mxConfiguration |
std::shared_ptr< ConfigurationUpdater > | mpConfigurationUpdater |
The ChangeRequestQueueProcessor owns the ChangeRequestQueue and processes the configuration change requests.
When after processing one entry the queue is empty then the XConfigurationController::update() method is called so that the changes made to the local XConfiguration reference are reflected by the UI.
Queue entries are processed asynchronously by calling PostUserEvent().
Definition at line 53 of file ChangeRequestQueueProcessor.hxx.
|
explicit |
The queue processor is created with a reference to an ConfigurationController so that its UpdateConfiguration() method can be called when the queue becomes empty.
Definition at line 53 of file ChangeRequestQueueProcessor.cxx.
sd::framework::ChangeRequestQueueProcessor::~ChangeRequestQueueProcessor | ( | ) |
Definition at line 60 of file ChangeRequestQueueProcessor.cxx.
References mnUserEventId, and Application::RemoveUserEvent().
void sd::framework::ChangeRequestQueueProcessor::AddRequest | ( | const css::uno::Reference< css::drawing::framework::XConfigurationChangeRequest > & | rxRequest | ) |
The given request is appended to the end of the queue and will eventually be processed when all other entries in front of it have been processed.
Definition at line 75 of file ChangeRequestQueueProcessor.cxx.
References maMutex, maQueue, mxConfiguration, SAL_INFO, StartProcessing(), and sd::framework::ConfigurationTracer::TraceConfiguration().
void sd::framework::ChangeRequestQueueProcessor::Clear | ( | ) |
Remove all events from the queue.
This method is typically called when the framework is shut down to avoid the processing of still pending activation requests.
Definition at line 173 of file ChangeRequestQueueProcessor.cxx.
|
private |
Callback function for the PostUserEvent() call.
bool sd::framework::ChangeRequestQueueProcessor::IsEmpty | ( | ) | const |
Returns </sal_True> when the queue is empty.
Definition at line 162 of file ChangeRequestQueueProcessor.cxx.
References maQueue.
Referenced by ProcessUntilEmpty().
void sd::framework::ChangeRequestQueueProcessor::ProcessOneEvent | ( | ) |
Process the first event in queue.
Definition at line 124 of file ChangeRequestQueueProcessor.cxx.
References maMutex, maQueue, mpConfigurationUpdater, mxConfiguration, SAL_INFO, and sd::framework::ConfigurationTracer::TraceConfiguration().
Referenced by ProcessUntilEmpty().
void sd::framework::ChangeRequestQueueProcessor::ProcessUntilEmpty | ( | ) |
Process all events in the queue synchronously.
This method is typically called when the framework is shut down to establish an empty configuration.
Definition at line 167 of file ChangeRequestQueueProcessor.cxx.
References IsEmpty(), and ProcessOneEvent().
void sd::framework::ChangeRequestQueueProcessor::SetConfiguration | ( | const css::uno::Reference< css::drawing::framework::XConfiguration > & | rxConfiguration | ) |
Sets the configuration who will be changed by subsequent change requests.
This method should be called only by the configuration controller who owns the configuration.
Definition at line 66 of file ChangeRequestQueueProcessor.cxx.
References maMutex, mxConfiguration, and StartProcessing().
|
private |
Initiate the processing of the entries in the queue.
The actual processing starts asynchronously.
Definition at line 95 of file ChangeRequestQueueProcessor.cxx.
References LINK, maMutex, maQueue, mnUserEventId, mxConfiguration, Application::PostUserEvent(), and SAL_INFO.
Referenced by AddRequest(), and SetConfiguration().
|
private |
Definition at line 100 of file ChangeRequestQueueProcessor.hxx.
Referenced by AddRequest(), Clear(), ProcessOneEvent(), SetConfiguration(), and StartProcessing().
|
private |
Definition at line 102 of file ChangeRequestQueueProcessor.hxx.
Referenced by AddRequest(), Clear(), IsEmpty(), ProcessOneEvent(), and StartProcessing().
|
private |
The id returned by the last PostUserEvent() call.
This id is stored so that a pending user event can be removed when the queue processor is destroyed.
Definition at line 108 of file ChangeRequestQueueProcessor.hxx.
Referenced by StartProcessing(), and ~ChangeRequestQueueProcessor().
|
private |
Definition at line 112 of file ChangeRequestQueueProcessor.hxx.
Referenced by ProcessOneEvent().
|
private |
Definition at line 110 of file ChangeRequestQueueProcessor.hxx.
Referenced by AddRequest(), ProcessOneEvent(), SetConfiguration(), and StartProcessing().