Apache Celix
2.4.0
Apache Celix is a framework for C, C++14 and C++17 to develop dynamic modular software applications using component and in-process service-oriented programming.
|
A C++ abstraction for a scheduled event in Celix. More...
#include <ScheduledEvent.h>
Public Member Functions | |
ScheduledEvent ()=default | |
Constructs a empty / not-active scheduled event. More... | |
~ScheduledEvent () noexcept | |
Destroys the scheduled event by removes it from the bundle context if it is not a one-short event. More... | |
ScheduledEvent (const ScheduledEvent &)=delete | |
ScheduledEvent & | operator= (const ScheduledEvent &)=delete |
ScheduledEvent (ScheduledEvent &&rhs) noexcept | |
ScheduledEvent & | operator= (ScheduledEvent &&rhs) noexcept |
void | cancel () |
Cancels the scheduled event. More... | |
void | wakeup () |
Wakeup a scheduled event and returns immediately, not waiting for the scheduled event callback to be called. More... | |
template<typename Rep , typename Period > | |
bool | waitFor (std::chrono::duration< Rep, Period > waitTime) |
Wait until the next scheduled event is processed. More... | |
Friends | |
class | ScheduledEventBuilder |
A C++ abstraction for a scheduled event in Celix.
A scheduled event is an event that is scheduled to be executed at a certain initial delay and/or interval. A new scheduld event should be created using celix::BundleContext::createScheduledEvent.
This class uses RAII to automatically remove the (non one-shot) scheduled event from the bundle context when it is destroyed. For one-shot scheduled events, the destructor will not remove the scheduled event.
|
default |
Constructs a empty / not-active scheduled event.
During destruction the scheduled event will be removed asynchronously from the bundle context.
|
inlinenoexcept |
Destroys the scheduled event by removes it from the bundle context if it is not a one-short event.
|
delete |
|
inlinenoexcept |
|
inline |
Cancels the scheduled event.
This method will block until a possible in-progress scheduled event callback is finished, the scheduled event is removed and, if configured, the remove callback is called. Should not be called multiple times.
|
delete |
|
inlinenoexcept |
|
inline |
Wait until the next scheduled event is processed.
Rep | The representation type of the duration. |
Period | The period type of the duration. |
[in] | waitTime | The maximum time to wait for the next scheduled event. If <= 0 the function will return immediately. |
|
inline |
Wakeup a scheduled event and returns immediately, not waiting for the scheduled event callback to be called.
|
friend |