14#include <lagrange/api.h>
16#include <tbb/spin_mutex.h>
38 std::function<
void(
const std::string &,
float)> func =
nullptr,
39 std::string name =
"",
40 size_t num_iterations = 1);
48 void set_callback(std::function<
void(
const std::string &,
float)> func);
57 void set_section(std::string name,
size_t num_iterations = 1);
64 const std::string &
get_section()
const {
return m_section_name; }
72 void set_num_iterations(
size_t num_iterations);
78 void advance(
size_t increment);
91 void update(
float progress);
103 std::function<void(
const std::string &,
float)> m_callback;
106 std::string m_section_name;
109 size_t m_num_iterations = 1;
112 std::atomic_size_t m_current_iteration = {0};
115 float m_last_progress = 0.f;
118 tbb::spin_mutex m_mutex;
121 bool m_verbose =
false;
A simple thread-safe progress callback.
Definition: ProgressCallback.h:27
const std::string & get_section() const
Retrieves current section name.
Definition: ProgressCallback.h:64
void set_verbose(bool verbose)
Sets the verbosity.
Definition: ProgressCallback.h:99
Main namespace for Lagrange.
Definition: AABBIGL.h:30