#ifndef myWORKER_H #define myWORKER_H #include #include #include #include #include "jobList.hpp" #include "commFPGA.hpp" class Worker { public: Worker(std::vector> *fpgas, Module mod, size_t numberOfJobs); ~Worker(); void startAsync(); void startSync(); JobListContainer getJobList(); void setJobTimeout(microseconds us) {jobTimeout = us;} void setRetryCount(size_t n) {retryCount = n;} void setDoneCallback(DoneCallback cb); void waitUntilDone(); private: std::pair> jobList; std::vector> *fpgaVector; commFPGA* findAvailableFPGA(); std::future result; int threadMain(); microseconds jobTimeout = microseconds(1000); size_t retryCount = 10; DoneCallback doneCb = NULL; bool running = true; }; #endif