8#include "../utility/utility.hpp"
9#include "../macros.hpp"
14hi_export_module(hikogui.dispatch.progress);
16hi_export
namespace hi {
51 using callback_type = notifier<>::callback_type;
95 template<
typename Callback>
98 return _notifier.subscribe(std::forward<Callback>(
callback), flags);
108 hi_axiom_bounds(value, 0.0f, 1.0f);
109 if (_sink !=
nullptr) {
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Definition callback.hpp:77
Token to pass to a function to report its progress.
Definition progress.hpp:23
void set_value(float value)
Set the current progress.
Definition progress.hpp:106
progress_token & operator=(float value)
Set the current progress.
Definition progress.hpp:33
A sink to read the current progress of a function.
Definition progress.hpp:49
float operator*() const noexcept
Get the current progress.
Definition progress.hpp:88
progress_token get_token() const noexcept
Get a token to pass to a function.
Definition progress.hpp:59
constexpr float value() const noexcept
Get the current progress.
Definition progress.hpp:81
constexpr progress_sink() noexcept=default
Create a fresh progress.
void reset()
Reset progress.
Definition progress.hpp:66
void set_value(float value)
Set progress.
Definition progress.hpp:73
notifier ::callback_type subscribe(Callback &&callback, callback_flags flags=callback_flags::synchronous)
Subscribe a callback function to be called when progress is modified.
Definition progress.hpp:96