Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::Async::ProgressTimeThrottler< T > Class Template Referencefinal

A Progress object that throttles reports to a given time interval. More...

#include <progress.h>

Inheritance diagram for Inkscape::Async::ProgressTimeThrottler< T >:
Inkscape::Async::Progress< T... >

Public Types

using duration = clock::duration
 

Public Member Functions

 ProgressTimeThrottler (Progress< T... > &parent, duration interval)
 
- Public Member Functions inherited from Inkscape::Async::Progress< T... >
bool report (T const &... progress)
 Report a progress value, returning false if cancelled.
 
void report_or_throw (T const &... progress)
 Report a progress value, throwing CancelledException if cancelled.
 
bool keepgoing () const
 Return whether not cancelled.
 
void throw_if_cancelled () const
 Throw CancelledException if cancelled.
 
 operator bool () const
 Convenience function - same as check().
 

Private Types

using clock = std::chrono::steady_clock
 
using time_point = clock::time_point
 

Private Member Functions

bool _keepgoing () const override
 
bool _report (T const &... progress) override
 

Private Attributes

Progress< T... > * parent
 
duration interval
 
time_point last = clock::now()
 

Additional Inherited Members

- Protected Member Functions inherited from Inkscape::Async::Progress< T... >
 ~Progress ()=default
 

Detailed Description

template<typename... T>
class Inkscape::Async::ProgressTimeThrottler< T >

A Progress object that throttles reports to a given time interval.

Definition at line 109 of file progress.h.

Member Typedef Documentation

◆ clock

template<typename... T>
using Inkscape::Async::ProgressTimeThrottler< T >::clock = std::chrono::steady_clock
private

Definition at line 112 of file progress.h.

◆ duration

template<typename... T>
using Inkscape::Async::ProgressTimeThrottler< T >::duration = clock::duration

Definition at line 116 of file progress.h.

◆ time_point

template<typename... T>
using Inkscape::Async::ProgressTimeThrottler< T >::time_point = clock::time_point
private

Definition at line 113 of file progress.h.

Constructor & Destructor Documentation

◆ ProgressTimeThrottler()

template<typename... T>
Inkscape::Async::ProgressTimeThrottler< T >::ProgressTimeThrottler ( Progress< T... > &  parent,
duration  interval 
)
inline

Definition at line 118 of file progress.h.

Member Function Documentation

◆ _keepgoing()

template<typename... T>
bool Inkscape::Async::ProgressTimeThrottler< T >::_keepgoing ( ) const
inlineoverrideprivatevirtual

◆ _report()

Member Data Documentation

◆ interval

template<typename... T>
duration Inkscape::Async::ProgressTimeThrottler< T >::interval
private

Definition at line 123 of file progress.h.

Referenced by Inkscape::Async::ProgressTimeThrottler< T >::_report().

◆ last

template<typename... T>
time_point Inkscape::Async::ProgressTimeThrottler< T >::last = clock::now()
private

Definition at line 124 of file progress.h.

Referenced by Inkscape::Async::ProgressTimeThrottler< T >::_report().

◆ parent


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