job scheduler works with run once and run periodic schedules. Stop logic is not fully thought through.

Dependencies:   LinkedList

Dependents:   JobSchedulerDemo Borsch

Revision:
11:df18df016d7e
Parent:
10:8cff30b5b90d
Child:
19:965c8721cc8a
--- a/jobService.cpp	Thu Jul 13 23:07:09 2017 +0000
+++ b/jobService.cpp	Fri Jul 14 00:00:20 2017 +0000
@@ -12,8 +12,9 @@
 
 bool JobType::IsEqual(JobType *j2)
 {
-    tr_debug("IsEqual %d %d", this->_jobTypeID, j2->_jobTypeID);
-    return this->_jobTypeID == j2->_jobTypeID;
+    bool rv = this->_jobTypeID == j2->_jobTypeID;
+    tr_debug("IsEqual %d==%d: %d", this->_jobTypeID, j2->_jobTypeID, rv);
+    return rv;
 }
 
 bool jtAscending(JobType *j1, JobType *j2)
@@ -39,9 +40,11 @@
 
 JobType* JobService::GetJob(int jobTypeID)
 {
+    tr_debug("find with job type id %d", jobTypeID);
     JobType search = JobType(jobTypeID, NULL, NULL);
     node<JobType> *found = _jobs.pop(&search, jtIsEqual);
     if (found == NULL) {
+        tr_debug("jobTypeID %d is NOT found", jobTypeID);
         return NULL;
     }
     return found->data;