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;
81 [[nodiscard]]
constexpr float value() const noexcept
95 template<
typename Callback>
96 [[nodiscard]] notifier<>::callback_type
subscribe(Callback&&
callback, callback_flags flags = callback_flags::synchronous)
98 return _notifier.subscribe(std::forward<Callback>(
callback), flags);
102 notifier<> _notifier = {};
108 hi_axiom_bounds(value, 0.0f, 1.0f);
109 if (_sink !=
nullptr) {
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
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