|
vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
A notifier that reports to another once a fixed number of units of work have all reported to it. More...
#include <vitrio/concurrency/counting_notifier.hpp>


Public Member Functions | |
| counting_notifier (std::size_t count, std::shared_ptr< completion_notifier > parent) | |
| Construct a notifier for a known number of units of work. | |
| counting_notifier (const counting_notifier &other)=delete | |
| counting_notifier (counting_notifier &&other)=delete | |
| counting_notifier & | operator= (const counting_notifier &other)=delete |
| counting_notifier & | operator= (counting_notifier &&other)=delete |
| void | notify_done (std::exception_ptr error=nullptr) override |
| Report that one unit of work has finished. | |
| Public Member Functions inherited from vitrio::completion_notifier | |
| completion_notifier (const completion_notifier &other)=default | |
| completion_notifier (completion_notifier &&other)=default | |
| completion_notifier & | operator= (const completion_notifier &other)=default |
| completion_notifier & | operator= (completion_notifier &&other)=default |
A notifier that reports to another once a fixed number of units of work have all reported to it.
It makes several units of work one unit of the notifier it reports to: the reads of one file in a batch, for example, each reported here, become one report of the file to the batch. It reports once every unit has reported, whichever failed, and reports the first exception reported, if any; the rest are discarded.
| vitrio::counting_notifier::counting_notifier | ( | std::size_t | count, |
| std::shared_ptr< completion_notifier > | parent ) |
Construct a notifier for a known number of units of work.
A count of zero reports to parent at once, from this constructor, as a success.
| count | How many times notify_done is reported before this reports to parent. |
| parent | Where the outcome of them all is reported. Must not be null. |
| std::invalid_argument | If parent is null. |
|
overridevirtual |
Report that one unit of work has finished.
Called exactly once per unit of work this notifier stands for.
| error | The exception the unit of work raised, or null if it succeeded. |
Implements vitrio::completion_notifier.