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

An interface for tasks to report progress and check for cancellation. More...

#include <progress.h>

Public Member Functions

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().
 

Protected Member Functions

 ~Progress ()=default
 
virtual bool _keepgoing () const =0
 
virtual bool _report (T const &... progress)=0
 

Detailed Description

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

An interface for tasks to report progress and check for cancellation.

Not supported:

  • Error reporting - use exceptions!
  • Thread-safety - overrides should provide this if needed using e.g. BackgroundProgress.

Definition at line 22 of file progress.h.

Constructor & Destructor Documentation

◆ ~Progress()

template<typename... T>
Inkscape::Async::Progress< T >::~Progress ( )
protecteddefault

Member Function Documentation

◆ _keepgoing()

◆ _report()

template<typename... T>
virtual bool Inkscape::Async::Progress< T >::_report ( T const &...  progress)
protectedpure virtual

◆ keepgoing()

◆ operator bool()

template<typename... T>
Inkscape::Async::Progress< T >::operator bool ( ) const
inline

Convenience function - same as check().

Definition at line 38 of file progress.h.

References Inkscape::Async::Progress< T >::_keepgoing().

◆ report()

template<typename... T>
bool Inkscape::Async::Progress< T >::report ( T const &...  progress)
inline

◆ report_or_throw()

template<typename... T>
void Inkscape::Async::Progress< T >::report_or_throw ( T const &...  progress)
inline

◆ throw_if_cancelled()

template<typename... T>
void Inkscape::Async::Progress< T >::throw_if_cancelled ( ) const
inline

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