4 #include <TaskInfo.pb.h> 19 enum QueueType { pending, assigned, running, done, failed, all };
20 Job(std::string uuid =
"", std::string type =
"NONE");
30 void tasks(std::vector<TaskInfo *> & v,
QueueType type,
bool clear =
true);
45 void feeder(std::string uuid);
46 std::string
feeder()
const;
56 std::map<uint32_t, TaskInfo *>
mTasks[all] = {};
size_t size(QueueType t=all) const
size_t sizeNotFinished() const
Job(std::string uuid="", std::string type="NONE")
std::string mFeederUUID
Feeder UUID.
bool isTaskInQueue(uint32_t id, QueueType type) const
Check task presence in certain queue.
void tasks(std::vector< TaskInfo *> &v, QueueType type, bool clear=true)
std::string mConsumerUUID
Source (consumer) UUID.
std::string mUUID
Job UUID.
std::map< uint32_t, TaskInfo * > mTasks[all]
Lists of jobs.
bool mHaveMoreTasks
Flag if we have more tasks.
std::string feeder() const
bool haveMoreTasks() const
void json(Json::Value &json)
std::string consumer() const
bool removeTask(uint32_t id, QueueType from)
std::string mType
Job type.
bool moveTask(uint32_t id, QueueType from, QueueType to)
bool addTask(uint32_t id, TaskInfo *pJob, QueueType type)
TaskInfo * nextJob()
TODO Get next available task?job?