The singleton JobScheduler class handles AbstractJobs
.
More...
#include <CMJob.h>
|
void | setCycleStep (unsigned short cycle_step) |
| SetCycleStep sets the cycle step, in which the scheduler should operate. More...
|
|
void | lock (unsigned long cycle, const std::function< void(void)> &fp) |
| Lock locks the simulation, when a job is suspended and releases it, when this job gets prepared() within fp . More...
|
|
void | addJob (const std::shared_ptr< AbstractJob > &job) |
| AddJob adds the job to the container to handle it. More...
|
|
bool | areJobsReady (unsigned long cycle) const |
| AreJobsReady iterates through all jobs and checks if they are ready. More...
|
|
bool | areJobsTimeout (void) const |
| AreJobsTimedout iterates through all jobs and checks if they are timedout. More...
|
|
void | executeJobs (CallbackHook hook, unsigned long cycle) |
| ExecuteJobs executes jobs at the defined hook point. More...
|
|
void | updateJobs (unsigned long cycle_current) |
| UpdateJobs iterates through all jobs and only sets individual jobs active, when the job cycle is met. Also updates every job. More...
|
|
void | resetJobs (void) |
| ResetJobs iterates through all jobs and sets them all to active.
|
|
void | disableJobs (void) |
| DisableJobs iterates through all jobs and sets them all to disabled.
|
|
std::shared_ptr< CMJob::AbstractJob > | getJob (const std::string &name) const |
| GetJob returns the job with name . More...
|
|
void | deleteJobs (void) |
| DeleteJobs removes all jobs from the scheduler.
|
|
void | deleteJob (const std::string &name) |
| DeleteJob remove a job from the scheduler. More...
|
|
void | printJobs (void) const |
| PrintJobs prints all jobs from the scheduler.
|
|
The singleton JobScheduler class handles AbstractJobs
.
◆ addJob()
void JobScheduler::addJob |
( |
const std::shared_ptr< AbstractJob > & |
job | ) |
|
AddJob adds the job to the container to handle it.
- Parameters
-
◆ areJobsReady()
bool JobScheduler::areJobsReady |
( |
unsigned long |
cycle | ) |
const |
AreJobsReady iterates through all jobs and checks if they are ready.
- Returns
- state, if all jobs are ready at current timestamp
- Parameters
-
◆ areJobsTimeout()
bool JobScheduler::areJobsTimeout |
( |
void |
| ) |
const |
AreJobsTimedout iterates through all jobs and checks if they are timedout.
- Returns
- state, if any job is in overtime
◆ deleteJob()
void JobScheduler::deleteJob |
( |
const std::string & |
name | ) |
|
DeleteJob remove a job from the scheduler.
- Parameters
-
◆ executeJobs()
void JobScheduler::executeJobs |
( |
CallbackHook |
hook, |
|
|
unsigned long |
cycle |
|
) |
| |
ExecuteJobs executes jobs at the defined hook point.
- Parameters
-
◆ getJob()
std::shared_ptr< CMJob::AbstractJob > JobScheduler::getJob |
( |
const std::string & |
name | ) |
const |
GetJob returns the job with name
.
- Parameters
-
- Returns
- reference to the job
◆ instance()
instance singleton
- Returns
- singleton instance of the class JobScheduler
◆ lock()
void JobScheduler::lock |
( |
unsigned long |
cycle, |
|
|
const std::function< void(void)> & |
fp |
|
) |
| |
Lock locks the simulation, when a job is suspended and releases it, when this job gets prepared() within fp
.
- Parameters
-
[in] | cycle | |
[in] | fp | function pointer, which prepares the suspended job to be ready |
◆ setCycleStep()
void JobScheduler::setCycleStep |
( |
unsigned short |
cycle_step | ) |
|
SetCycleStep sets the cycle step, in which the scheduler should operate.
- Parameters
-
cycle_step | (default = 1ms) |
◆ updateJobs()
void JobScheduler::updateJobs |
( |
unsigned long |
cycle_current | ) |
|
UpdateJobs iterates through all jobs and only sets individual jobs active, when the job cycle is met. Also updates every job.
- Parameters
-