HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
hi::v1::progress_sink Class Reference

#include <hikogui/dispatch/progress.hpp>

Public Types

using callback_type = notifier<>::callback_type

Public Member Functions

constexpr progress_sink () noexcept=default
 Create a fresh progress.
progress_token get_token () const noexcept
 Get a token to pass to a function.
void reset ()
 Reset progress.
void set_value (float value)
 Set progress.
constexpr float value () const noexcept
 Get the current progress.
float operator* () const noexcept
 Get the current progress.
template<typename Callback>
notifier ::callback_type subscribe (Callback &&callback, callback_flags flags=callback_flags::synchronous)
 Subscribe a callback function to be called when progress is modified.

Detailed Description

A sink to read the current progress of a function.

Constructor & Destructor Documentation

◆ progress_sink()

hi::v1::progress_sink::progress_sink ( )
constexprdefaultnoexcept

Create a fresh progress.

Member Function Documentation

◆ get_token()

progress_token hi::v1::progress_sink::get_token ( ) const
inlinenodiscardnoexcept

Get a token to pass to a function.

◆ operator*()

float hi::v1::progress_sink::operator* ( ) const
inlinenodiscardnoexcept

Get the current progress.

◆ reset()

void hi::v1::progress_sink::reset ( )
inline

Reset progress.

◆ set_value()

void hi::v1::progress_sink::set_value ( float value)
inline

Set progress.

◆ subscribe()

template<typename Callback>
notifier ::callback_type hi::v1::progress_sink::subscribe ( Callback && callback,
callback_flags flags = callback_flags::synchronous )
inlinenodiscard

Subscribe a callback function to be called when progress is modified.

◆ value()

float hi::v1::progress_sink::value ( ) const
inlinenodiscardconstexprnoexcept

Get the current progress.


The documentation for this class was generated from the following file: