LibreOffice Module slideshow (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
slideshow::internal::Delay Class Reference

Event, which delays the functor call the given amount of time. More...

#include <delayevent.hxx>

Inheritance diagram for slideshow::internal::Delay:
[legend]
Collaboration diagram for slideshow::internal::Delay:
[legend]

Public Types

typedef ::std::function< void()> FunctorT
 

Public Member Functions

template<typename FuncT >
 Delay (FuncT const &func, double nTimeout, const OUString &rsDescription)
 
 Delay (std::function< void()> func, double nTimeout, const OUString &rsDescription)
 
 Delay (const Delay &)=delete
 
Delayoperator= (const Delay &)=delete
 
virtual bool fire () override
 Execute the event. More...
 
virtual bool isCharged () const override
 Query whether this event is still charged, i.e. More...
 
virtual double getActivationTime (double nCurrentTime) const override
 Query the activation time instant this event shall be fired, if it was inserted at instant nCurrentTime into the queue. More...
 
virtual void dispose () override
 Dispose all object references. More...
 
- Public Member Functions inherited from slideshow::internal::Event
 Event (OUString sDescription)
 
virtual bool fire ()=0
 Execute the event. More...
 
virtual bool isCharged () const =0
 Query whether this event is still charged, i.e. More...
 
virtual double getActivationTime (double nCurrentTime) const =0
 Query the activation time instant this event shall be fired, if it was inserted at instant nCurrentTime into the queue. More...
 
const OUString & GetDescription () const
 
- Public Member Functions inherited from slideshow::internal::Disposable
virtual ~Disposable ()
 
virtual void dispose ()=0
 Dispose all object references. More...
 

Private Attributes

double const mnTimeout
 
FunctorT maFunc
 
bool mbWasFired
 

Detailed Description

Event, which delays the functor call the given amount of time.

Definition at line 31 of file delayevent.hxx.

Member Typedef Documentation

◆ FunctorT

typedef ::std::function<void ()> slideshow::internal::Delay::FunctorT

Definition at line 34 of file delayevent.hxx.

Constructor & Destructor Documentation

◆ Delay() [1/3]

template<typename FuncT >
slideshow::internal::Delay::Delay ( FuncT const &  func,
double  nTimeout,
const OUString &  rsDescription 
)
inline

Definition at line 37 of file delayevent.hxx.

◆ Delay() [2/3]

slideshow::internal::Delay::Delay ( std::function< void()>  func,
double  nTimeout,
const OUString &  rsDescription 
)
inline

Definition at line 43 of file delayevent.hxx.

◆ Delay() [3/3]

slideshow::internal::Delay::Delay ( const Delay )
delete

Member Function Documentation

◆ dispose()

void slideshow::internal::Delay::dispose ( )
overridevirtual

Dispose all object references.

An implementor of this method must first call dispose() on any of its external references, and release them after that.

Implements slideshow::internal::Disposable.

Definition at line 47 of file delayevent.cxx.

References isCharged(), maFunc, and mbWasFired.

◆ fire()

bool slideshow::internal::Delay::fire ( )
overridevirtual

Execute the event.

Returns
true, if event was successfully executed.

Implements slideshow::internal::Event.

Definition at line 26 of file delayevent.cxx.

References isCharged(), maFunc, and mbWasFired.

◆ getActivationTime()

double slideshow::internal::Delay::getActivationTime ( double  nCurrentTime) const
overridevirtual

Query the activation time instant this event shall be fired, if it was inserted at instant nCurrentTime into the queue.

Parameters
nCurrentTimeThe time from which the activation time is to be calculated from.
Returns
the time instant in seconds, on which this event is to be fired.

Implements slideshow::internal::Event.

Definition at line 42 of file delayevent.cxx.

References mnTimeout.

◆ isCharged()

bool slideshow::internal::Delay::isCharged ( ) const
overridevirtual

Query whether this event is still charged, i.e.

able to fire.

Inactive events are ignored by the normal event containers (EventQueue, UserEventQueue etc.), and no explicit fire() is called upon them.

Returns
true, if this event has already been fired.

Implements slideshow::internal::Event.

Definition at line 37 of file delayevent.cxx.

References mbWasFired.

Referenced by dispose(), and fire().

◆ operator=()

Delay & slideshow::internal::Delay::operator= ( const Delay )
delete

Member Data Documentation

◆ maFunc

FunctorT slideshow::internal::Delay::maFunc
private

Definition at line 62 of file delayevent.hxx.

Referenced by dispose(), and fire().

◆ mbWasFired

bool slideshow::internal::Delay::mbWasFired
private

Definition at line 63 of file delayevent.hxx.

Referenced by dispose(), fire(), and isCharged().

◆ mnTimeout

double const slideshow::internal::Delay::mnTimeout
private

Definition at line 61 of file delayevent.hxx.

Referenced by getActivationTime().


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