47 virtual void set(_In_ T value)
85 lazy_progress(_In_
const std::chrono::nanoseconds& timeout = std::chrono::nanoseconds(500000)) :
109 virtual void set(_In_ T value)
111 if (value == m_start || value == m_end)
112 m_last = std::chrono::high_resolution_clock::now();
113 else if (value == m_value)
116 auto now = std::chrono::high_resolution_clock::now();
117 if (now - m_last < m_timeout)
132 std::chrono::nanoseconds m_timeout;
133 std::chrono::steady_clock::time_point m_last;
134 T m_start, m_end, m_value;
184 m_global.start = start;
187 m_host->set_range(m_global.start, m_global.end);
198 m_section.start = start;
210 m_host->set_text(msg);
221 m_local.start = start;
230 virtual void set(_In_ T value)
233 T size = m_local.size();
236 m_host->set(((value - m_local.start) * m_section.size() / size) + m_section.start);
257 return m_host && m_host->cancel();
284 m_host_ref = this->
detach();
Global progress indicator base class.
Definition progress.hpp:144
global_progress(progress< T > *host=NULL)
Constructs a progress indicator.
Definition progress.hpp:151
void set_section_range(T start, T end)
Set section extend of the progress indicator.
Definition progress.hpp:196
virtual void show(bool show=true)
Show or hide progress.
Definition progress.hpp:246
virtual bool cancel()
Query whether user requested abort.
Definition progress.hpp:255
virtual void set(T value)
Set local current progress.
Definition progress.hpp:230
virtual void set_text(const char *msg)
Set progress indicator text.
Definition progress.hpp:207
progress< T > * detach()
Detach host progress indicator.
Definition progress.hpp:169
void set_global_range(T start, T end)
Set global extend of the progress indicator.
Definition progress.hpp:182
void attach(progress< T > *host)
Attach to a host progress indicator.
Definition progress.hpp:159
virtual void set_range(T start, T end)
Set local extend of the progress indicator.
Definition progress.hpp:219
Lazy progress indicator base class.
Definition progress.hpp:78
virtual void set(T value)
Set current progress.
Definition progress.hpp:109
lazy_progress(const std::chrono::nanoseconds &timeout=std::chrono::nanoseconds(500000))
Constructs a lazy progress indicator.
Definition progress.hpp:85
virtual void do_set()
Called when progress reporting is due. Should override this method to implement actual progress refre...
Definition progress.hpp:129
virtual void set_range(T start, T end)
Set progress range extent.
Definition progress.hpp:98
Progress indicator switcher.
Definition progress.hpp:273
Progress indicator base class.
Definition progress.hpp:19
virtual bool cancel()
Query whether user requested abort.
Definition progress.hpp:65
virtual void set_text(const char *msg)
Set progress indicator text.
Definition progress.hpp:26
virtual void show(bool show=true)
Show or hide progress.
Definition progress.hpp:57
virtual void set(T value)
Set current progress.
Definition progress.hpp:47
virtual void set_range(T start, T end)
Set progress range extent.
Definition progress.hpp:37
Numerical interval.
Definition interval.hpp:18