10 #ifndef WRENCH_BATCHJOBSET_H
11 #define WRENCH_BATCHJOBSET_H
13 #include "wrench/services/compute/batch/BatchJob.h"
28 BatchJobSet() =
default;
31 std::set<std::shared_ptr<BatchJob>> jobs;
33 unsigned long num_nodes_utilized = 0;
40 BatchJobSet& operator += (
const BatchJobSet& right)
42 for (
const auto &j : right.jobs) {
53 BatchJobSet& operator -= (
const BatchJobSet& right)
55 for (
const auto &j : right.jobs) {
65 void inline add(std::shared_ptr<BatchJob> job) {
66 if (this->jobs.find(job) == this->jobs.end()) {
67 num_nodes_utilized += job->getRequestedNumNodes();
68 this->jobs.insert(job);
76 void inline remove(std::shared_ptr<BatchJob> job) {
77 if (this->jobs.find(job) != this->jobs.end()) {
78 num_nodes_utilized -= job->getRequestedNumNodes();
79 this->jobs.erase(job);
91 #endif //WRENCH_BATCHJOBSET_H