8 #ifndef EMP_BATCH_CONFIG_H 9 #define EMP_BATCH_CONFIG_H 11 #include "../base/vector.h" 19 template <
typename RUN_T, CONFIG_T>
26 RunInfo(
size_t & _id,
const CONFIG_T & _config) : id(_id), config(_config) { ; }
32 using start_fun_t = std::function<void(const CONFIG_T &)>;
33 start_fun_t start_fun;
36 BatchConfig(
const start_fun_t & f) : cur_run(0), start_fun(f) { ; }
40 CONFIG_T &
GetConfig(
size_t id) {
return runs[id].config; }
41 const CONFIG_T &
GetConfig(
size_t id)
const {
return runs[id].config; }
43 void AddRun(
const CONFIG_T & in_config) {
48 if (cur_run >= runs.
size())
return false;
49 start_fun(runs[cur_run].config);
void AddRun(const CONFIG_T &in_config)
Definition: BatchConfig.h:43
const CONFIG_T & GetConfig(size_t id) const
Definition: BatchConfig.h:41
size_t size() const
Definition: vector.h:151
void emplace_back(ARGS &&...args)
Definition: vector.h:219
size_t GetCurRun() const
Definition: BatchConfig.h:39
size_t GetSize() const
Definition: BatchConfig.h:38
bool Start()
Definition: BatchConfig.h:47
Definition: BatchConfig.h:20
If we are in emscripten, make sure to include the header.
Definition: array.h:37
CONFIG_T & GetConfig(size_t id)
Definition: BatchConfig.h:40
BatchConfig(const start_fun_t &f)
Definition: BatchConfig.h:36