stdex
Additional custom or not Standard C++ covered algorithms
Loading...
Searching...
No Matches
stdex::timeout_progress< T > Class Template Reference

Timeout progress indicator. More...

#include <stdex/progress.hpp>

Inheritance diagram for stdex::timeout_progress< T >:
stdex::progress< T >

Public Member Functions

 timeout_progress (const std::chrono::nanoseconds &timeout=std::chrono::seconds(60), progress< T > *host=nullptr)
 Constructs a timeout progress indicator.
 
virtual void set_text (const char *msg)
 Set progress indicator text.
 
virtual void set_range (T start, T end)
 Set progress range extent.
 
virtual void set (T value)
 Set current progress.
 
virtual void show (bool show=true)
 Show or hide progress.
 
virtual bool cancel ()
 Query whether user requested abort.
 
- Public Member Functions inherited from stdex::progress< T >

Protected Attributes

progress< T > * m_host
 
std::chrono::high_resolution_clock::time_point m_deadline
 

Detailed Description

template<class T>
class stdex::timeout_progress< T >

Timeout progress indicator.

Use to cancel long running jobs after the deadline.

Constructor & Destructor Documentation

◆ timeout_progress()

template<class T >
stdex::timeout_progress< T >::timeout_progress ( const std::chrono::nanoseconds & timeout = std::chrono::seconds(60),
progress< T > * host = nullptr )
inline

Constructs a timeout progress indicator.

Parameters
[in]timeoutTimeout when to cancel the progress

Member Function Documentation

◆ cancel()

template<class T >
virtual bool stdex::timeout_progress< T >::cancel ( )
inlinevirtual

Query whether user requested abort.

Reimplemented from stdex::progress< T >.

◆ set()

template<class T >
virtual void stdex::timeout_progress< T >::set ( T value)
inlinevirtual

Set current progress.

Parameters
[in]valueCurrent value of the progress. Must be between start and end parameters provided in set_range() call.

Reimplemented from stdex::progress< T >.

◆ set_range()

template<class T >
virtual void stdex::timeout_progress< T >::set_range ( T start,
T end )
inlinevirtual

Set progress range extent.

Parameters
[in]startMinimum value of the progress
[in]endMaximum value of the progress

Reimplemented from stdex::progress< T >.

◆ set_text()

template<class T >
virtual void stdex::timeout_progress< T >::set_text ( const char * msg)
inlinevirtual

Set progress indicator text.

Parameters
[in]msgText to display

Reimplemented from stdex::progress< T >.

◆ show()

template<class T >
virtual void stdex::timeout_progress< T >::show ( bool show = true)
inlinevirtual

Show or hide progress.

Parameters
[in]showShows or hides progress indicator

Reimplemented from stdex::progress< T >.


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