A C++ builder for a ScheduledEvent object.
More...
#include <ScheduledEventBuilder.h>
A C++ builder for a ScheduledEvent object.
◆ ScheduledEventBuilder()
celix::ScheduledEventBuilder::ScheduledEventBuilder |
( |
std::shared_ptr< celix_bundle_context_t > |
_cCtx | ) |
|
|
inline |
Construct a scheduled event builder with the given bundle context.
- Parameters
-
[in] | ctx | The bundle context to use. |
◆ build()
Build the scheduled event with the given options.
- Returns
- The scheduled event.
◆ withCallback()
Set the callback of the scheduled event.
The callback is called when the scheduled event is triggered on the event thread.
- Parameters
-
[in] | cb | The callback function. |
- Returns
- A reference to this builder.
◆ withInitialDelay()
template<typename Rep , typename Period >
ScheduledEventBuilder& celix::ScheduledEventBuilder::withInitialDelay |
( |
std::chrono::duration< Rep, Period > |
delay | ) |
|
|
inline |
Set the initial delay of the scheduled event.
- Template Parameters
-
Rep | The representation type of the duration. |
Period | The period type of the duration. |
- Parameters
-
[in] | delay | The delay duration. |
- Returns
- A reference to this builder.
◆ withInterval()
template<typename Rep , typename Period >
ScheduledEventBuilder& celix::ScheduledEventBuilder::withInterval |
( |
std::chrono::duration< Rep, Period > |
interval | ) |
|
|
inline |
Set the interval of the scheduled event.
- Template Parameters
-
Rep | The representation type of the duration. |
Period | The period type of the duration. |
- Parameters
-
[in] | interval | The interval duration. |
- Returns
- A reference to this builder.
◆ withName()
Set the name of the scheduled event.
- Parameters
-
[in] | name | The name of the scheduled event. |
- Returns
- A reference to this builder.
◆ withRemoveCallback()
Set the remove callback of the scheduled event.
The remove callback is called when the scheduled event is removed from the scheduler and can be called from any thread.
- Parameters
-
[in] | cb | The callback function. |
- Returns
- A reference to this builder.
The documentation for this class was generated from the following file: