#ifndef myJOBLIST_H #define myJOBLIST_H #include #include #include "job.hpp" #include "modules.hpp" //entity to track an array of similar jobs class JobList { public: JobList(Module mod, size_t numberOfJobs); void waitAll(); void finishJob(); void setDoneCallback(DoneCallback cb); size_t getPendingJobCount() const {return pendingJobCount;} std::shared_ptr& getJob(size_t i); std::shared_ptr getNextJob(); private: std::vector> jobs; DoneCallback doneCb; size_t jobCount; size_t pendingJobCount; std::condition_variable jobListDone; std::mutex pendingJobCount_m; size_t nextJobIndex = 0; }; #endif