12 using on_fail_fn = std::function<void(
const std::string& module,
const std::string& message)>;
19 void log(
const std::string& message);
20 void fail(
const std::string& message);
23 auto check(
bool result) -> bool;
29 auto
total() const ->
size_t;
33 void notify_visualizer();
38 std::string current_job_;
41 std::string error_msg_;
Hash specialization for batch_key to enable use in std::unordered_map.
auto current_module() const -> const std::string &
void progress(size_t completed, size_t total, const std::string ¤t_job={})
std::function< void(const loading_screen &)> visualizer_fn
auto completed() const -> size_t
void begin_module(const std::string &module_name)
void set_visualizer(visualizer_fn fn)
void log(const std::string &message)
auto current_job() const -> const std::string &
auto error_message() const -> const std::string &
auto has_failed() const -> bool
std::function< void(const std::string &module, const std::string &message)> on_fail_fn
void set_on_fail(on_fail_fn fn)
auto check(bool result) -> bool
Convenience: if result is false and no error was set, auto-fails with the current module name.
auto total() const -> size_t
void fail(const std::string &message)