IScheduler interface.
More...
#include <IScheduler.h>
IScheduler interface.
Provides interface for planning task fired at proper time
◆ TaskHandle
Task handle is task identification.
◆ TaskHandlerFunc
Task to be processed handler functional type.
◆ ~IScheduler()
virtual IScheduler::~IScheduler |
( |
| ) |
|
|
inlinevirtual |
◆ getMyTask()
virtual std::string IScheduler::getMyTask |
( |
const std::string & |
clientId, |
|
|
const TaskHandle & |
hndl |
|
) |
| const |
|
pure virtual |
Get a particular tasks for a client.
- Parameters
-
[in] | clientId | client identification |
[in] | hndl | task handle identification |
- Returns
- scheduled tasks
Returns a particular task planned for a client or an empty task if doesn't exists
Implemented in Scheduler.
◆ getMyTasks()
virtual std::vector<std::string> IScheduler::getMyTasks |
( |
const std::string & |
clientId | ) |
const |
|
pure virtual |
Get scheduled tasks for a client.
- Parameters
-
[in] | clientId | client identification |
- Returns
- scheduled tasks
Returns all pending scheduled tasks for the client
Implemented in Scheduler.
◆ registerMessageHandler()
virtual void IScheduler::registerMessageHandler |
( |
const std::string & |
clientId, |
|
|
TaskHandlerFunc |
fun |
|
) |
| |
|
pure virtual |
Register task handler.
- Parameters
-
[in] | clientId | client identification registering handler function |
[in] | fun | handler function |
Whenever the scheduler evaluate a task to be handled it is passed to the handler function. The only tasks planned for particular clientId are delivered. Repeated registration with the same client identification replaces previously registered handler
Implemented in Scheduler.
◆ removeAllMyTasks()
virtual void IScheduler::removeAllMyTasks |
( |
const std::string & |
clientId | ) |
|
|
pure virtual |
Remove all task for client.
- Parameters
-
[in] | clientId | client identification |
Scheduler removes all tasks for the client
Implemented in Scheduler.
◆ removeTask()
virtual void IScheduler::removeTask |
( |
const std::string & |
clientId, |
|
|
TaskHandle |
hndl |
|
) |
| |
|
pure virtual |
Remove task for client.
- Parameters
-
[in] | clientId | client identification |
[in] | hndl | task handle identification |
Scheduler removes a particular tasks for the client
Implemented in Scheduler.
◆ removeTasks()
virtual void IScheduler::removeTasks |
( |
const std::string & |
clientId, |
|
|
std::vector< TaskHandle > |
hndls |
|
) |
| |
|
pure virtual |
Remove tasks for client.
- Parameters
-
[in] | clientId | client identification |
[in] | hndls | task handles identification |
Scheduler removes a group of tasks passed in hndls for the client
Implemented in Scheduler.
◆ scheduleTaskAt()
virtual TaskHandle IScheduler::scheduleTaskAt |
( |
const std::string & |
clientId, |
|
|
const std::string & |
task, |
|
|
const std::chrono::system_clock::time_point & |
tp |
|
) |
| |
|
pure virtual |
Schedule task at time point.
- Parameters
-
[in] | clientId | client identification |
[in] | task | planned task |
[in] | tp | time point |
- Returns
- scheduled task handle
Schedules task at exact time point. When the time point is reached the task is passed to its handler and released Use it for one shot tasks
Implemented in Scheduler.
◆ scheduleTaskPeriodic()
virtual TaskHandle IScheduler::scheduleTaskPeriodic |
( |
const std::string & |
clientId, |
|
|
const std::string & |
task, |
|
|
const std::chrono::seconds & |
sec, |
|
|
const std::chrono::system_clock::time_point & |
tp = std::chrono::system_clock::now() |
|
) |
| |
|
pure virtual |
Schedule periodic task.
- Parameters
-
[in] | clientId | client identification |
[in] | task | planned task |
[in] | sec | period in seconds |
[in] | tp | time point of delayed start |
- Returns
- scheduled task handle
Schedules periodic task. It is started immediatelly by default, the first shot after one period. If the start shall be delayed use appropriate time point of start
Implemented in Scheduler.
◆ start()
virtual void IScheduler::start |
( |
| ) |
|
|
pure virtual |
◆ stop()
virtual void IScheduler::stop |
( |
| ) |
|
|
pure virtual |
◆ unregisterMessageHandler()
virtual void IScheduler::unregisterMessageHandler |
( |
const std::string & |
clientId | ) |
|
|
pure virtual |
Unregister task handler.
- Parameters
-
[in] | clientId | client identification |
If the handler is not required anymore, it is possible to unregister via this method.
Implemented in Scheduler.
◆ TASK_HANDLE_INVALID
const TaskHandle IScheduler::TASK_HANDLE_INVALID = 0 |
|
static |
The documentation for this class was generated from the following file: