Blue Brain BioExplorer
core::Progress Class Reference

#include <Progress.h>

Inheritance diagram for core::Progress:
Collaboration diagram for core::Progress:

Public Member Functions

 Progress ()=default
 
 Progress (const std::string &operation)
 
void update (const std::string &operation, const float amount)
 
void increment (const std::string &operation, const float increment)
 
void consume (std::function< void(std::string, float)> callback)
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 

Detailed Description

A progress object which offers thread-safe progress updates and thread-safe consumption of the current progress if it has changed in between.

Definition at line 36 of file Progress.h.

Constructor & Destructor Documentation

◆ Progress() [1/2]

core::Progress::Progress ( )
default

◆ Progress() [2/2]

core::Progress::Progress ( const std::string &  operation)
inlineexplicit

Definition at line 40 of file Progress.h.

Member Function Documentation

◆ consume()

void core::Progress::consume ( std::function< void(std::string, float)>  callback)
inline

Call the provided callback with the current progress if it has changed since the last invokation.

Definition at line 65 of file Progress.h.

◆ increment()

void core::Progress::increment ( const std::string &  operation,
const float  increment 
)
inline

Update the progress with the given increment.

Definition at line 54 of file Progress.h.

◆ update()

void core::Progress::update ( const std::string &  operation,
const float  amount 
)
inline

Update the progress with a new absolute amount.

Definition at line 46 of file Progress.h.


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