LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::framework::ChangeRequestQueueProcessor Class Reference

The ChangeRequestQueueProcessor owns the ChangeRequestQueue and processes the configuration change requests. More...

#include <ChangeRequestQueueProcessor.hxx>

Collaboration diagram for sd::framework::ChangeRequestQueueProcessor:
[legend]

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
 
ImplSVEventmnUserEventId
 The id returned by the last PostUserEvent() call. More...
 
css::uno::Reference< css::drawing::framework::XConfiguration > mxConfiguration
 
std::shared_ptr< ConfigurationUpdatermpConfigurationUpdater
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ChangeRequestQueueProcessor()

sd::framework::ChangeRequestQueueProcessor::ChangeRequestQueueProcessor ( std::shared_ptr< ConfigurationUpdater pUpdater)
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.

◆ ~ChangeRequestQueueProcessor()

sd::framework::ChangeRequestQueueProcessor::~ChangeRequestQueueProcessor ( )

Member Function Documentation

◆ AddRequest()

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().

◆ Clear()

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.

References maMutex, and maQueue.

◆ DECL_LINK()

sd::framework::ChangeRequestQueueProcessor::DECL_LINK ( ProcessEvent  ,
void *  ,
void   
)
private

Callback function for the PostUserEvent() call.

◆ IsEmpty()

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().

◆ ProcessOneEvent()

void sd::framework::ChangeRequestQueueProcessor::ProcessOneEvent ( )

◆ 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().

◆ SetConfiguration()

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().

◆ StartProcessing()

void sd::framework::ChangeRequestQueueProcessor::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().

Member Data Documentation

◆ maMutex

mutable::osl::Mutex sd::framework::ChangeRequestQueueProcessor::maMutex
private

◆ maQueue

ChangeRequestQueue sd::framework::ChangeRequestQueueProcessor::maQueue
private

◆ mnUserEventId

ImplSVEvent* sd::framework::ChangeRequestQueueProcessor::mnUserEventId
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().

◆ mpConfigurationUpdater

std::shared_ptr<ConfigurationUpdater> sd::framework::ChangeRequestQueueProcessor::mpConfigurationUpdater
private

Definition at line 112 of file ChangeRequestQueueProcessor.hxx.

Referenced by ProcessOneEvent().

◆ mxConfiguration

css::uno::Reference<css::drawing::framework::XConfiguration> sd::framework::ChangeRequestQueueProcessor::mxConfiguration
private

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