19#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_DELAYEVENT_HXX
20#define INCLUDED_SLIDESHOW_SOURCE_INC_DELAYEVENT_HXX
36 template <
typename FuncT>
39 ,
const OUString& rsDescription
40 ) :
Event(rsDescription),
43 Delay( std::function<
void ()> func,
45 ,
const OUString& rsDescription
46 ) :
Event(rsDescription),
54 virtual bool fire()
override;
58 virtual void dispose()
override;
66#if OSL_DEBUG_LEVEL <= 1
78template <
typename FuncT>
81 return std::make_shared<Delay>( func, nTimeout, rsDescription );
91template <
typename FuncT>
92inline EventSharedPtr makeEvent_( FuncT
const& func, OUString
const& rsDescription)
94 return std::make_shared<Delay>( func, 0.0, rsDescription );
98#define makeDelay(f, t, d) makeDelay_(f, t, d)
99#define makeEvent(f, d) makeEvent_(f, d)
105 template <
typename FuncT>
106 Delay_( FuncT
const& func,
double nTimeout,
107 char const* from_function,
char const* from_file,
int from_line,
108 const OUString& rsDescription)
109 :
Delay(func, nTimeout, rsDescription),
118template <
typename FuncT>
120 FuncT
const& func,
double nTimeout,
121 char const* from_function,
char const* from_file,
int from_line,
122 const OUString& rsDescription)
125 from_function, from_file, from_line, rsDescription) );
128#define makeDelay(f, t, d) makeDelay_(f, t, \
129 __func__, __FILE__, __LINE__, \
131#define makeEvent(f, d) makeDelay_(f, 0.0, \
132 __func__, __FILE__, __LINE__, \
char const *const FROM_FUNCTION
Delay_(FuncT const &func, double nTimeout, char const *from_function, char const *from_file, int from_line, const OUString &rsDescription)
char const *const FROM_FILE
Event, which delays the functor call the given amount of time.
Delay(const Delay &)=delete
virtual bool isCharged() const override
Query whether this event is still charged, i.e.
virtual void dispose() override
Dispose all object references.
virtual double getActivationTime(double nCurrentTime) const override
Query the activation time instant this event shall be fired, if it was inserted at instant nCurrentTi...
::std::function< void()> FunctorT
Delay(std::function< void()> func, double nTimeout, const OUString &rsDescription)
virtual bool fire() override
Execute the event.
Delay(FuncT const &func, double nTimeout, const OUString &rsDescription)
Delay & operator=(const Delay &)=delete
Definition of Event interface.
::std::shared_ptr< Event > EventSharedPtr
EventSharedPtr makeDelay_(FuncT const &func, double nTimeout, char const *from_function, char const *from_file, int from_line, const OUString &rsDescription)