Commit c4ba3374 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Use const qualifier for jobs. Fixes #183

parent 98ef723d
Pipeline #175784 passed with stage
in 6 minutes and 1 second
......@@ -34,7 +34,7 @@ void GreedyScheduler::setParams(bool restartImmediately, bool restartQueue,
setErrorDelaySeconds(errorHandlingDelay);
}
QList<SchedulerJob *> GreedyScheduler::scheduleJobs(QList<SchedulerJob *> &jobs,
QList<SchedulerJob *> GreedyScheduler::scheduleJobs(const QList<SchedulerJob *> &jobs,
const QDateTime &now,
const QMap<QString, uint16_t> &capturedFramesCount,
Scheduler *scheduler)
......@@ -88,7 +88,7 @@ QList<SchedulerJob *> GreedyScheduler::scheduleJobs(QList<SchedulerJob *> &jobs,
return sortedJobs;
}
bool GreedyScheduler::checkJob(QList<SchedulerJob *> &jobs,
bool GreedyScheduler::checkJob(const QList<SchedulerJob *> &jobs,
const QDateTime &now,
SchedulerJob *currentJob)
{
......@@ -109,7 +109,7 @@ bool GreedyScheduler::checkJob(QList<SchedulerJob *> &jobs,
}
QList<SchedulerJob *> GreedyScheduler::prepareJobsForEvaluation(
QList<SchedulerJob *> &jobs, const QDateTime &now,
const QList<SchedulerJob *> &jobs, const QDateTime &now,
const QMap<QString, uint16_t> &capturedFramesCount, Scheduler *scheduler, bool reestimateJobTimes)
{
QList<SchedulerJob *> sortedJobs = jobs;
......
......@@ -57,7 +57,7 @@ class GreedyScheduler : public QObject
* @param scheduler A pointer to the scheduler object, useful for notifying the user. Can be nullptr.
* @return returns a possibly sorted list of the same jobs input, but with state and start/end time changes.
*/
QList<SchedulerJob *> scheduleJobs(QList<SchedulerJob *> &jobs,
QList<SchedulerJob *> scheduleJobs(const QList<SchedulerJob *> &jobs,
const QDateTime &now,
const QMap<QString, uint16_t> &capturedFramesCount,
Scheduler *scheduler);
......@@ -68,7 +68,7 @@ class GreedyScheduler : public QObject
* @param currentJob The currently running job, which may be continued or aborted.
* @return returns true if the job should continue to run.
*/
bool checkJob(QList<SchedulerJob *> &jobs,
bool checkJob(const QList<SchedulerJob *> &jobs,
const QDateTime &now,
SchedulerJob *currentJob);
/**
......@@ -133,7 +133,7 @@ class GreedyScheduler : public QObject
// Changes the states of the jons on the list, deciding which ones
// can be scheduled by scheduleJobs().
QList<SchedulerJob *> prepareJobsForEvaluation(
QList<SchedulerJob *> &jobs, const QDateTime &now,
const QList<SchedulerJob *> &jobs, const QDateTime &now,
const QMap<QString, uint16_t> &capturedFramesCount, Scheduler *scheduler, bool reestimateJobTime = true);
// Removes the EVALUATION state, after eval is done.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment