|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
Performs reads described by a transaction plan on an executor. More...
#include <vitrio/executor_image_loader.hpp>


Public Member Functions | |
| executor_image_loader (std::shared_ptr< image_reader_provider > readers, std::shared_ptr< vitrio::executor > executor) | |
| Construct a loader over a provider and an executor. | |
| std::shared_ptr< completion > | load (array destination, const image_transaction_plan &plan, std::shared_ptr< const image_transfer_sanitizer > sanitizer) const override |
| Load every region a transaction plan names. | |
Public Member Functions inherited from vitrio::image_loader | |
| image_loader (const image_loader &other)=delete | |
| image_loader (image_loader &&other)=delete | |
| image_loader & | operator= (const image_loader &other)=delete |
| image_loader & | operator= (image_loader &&other)=delete |
Performs reads described by a transaction plan on an executor.
Splits the plan by the file each region addresses and reads each file's regions as one task, fanned out onto the executor this was constructed with. Files are therefore read concurrently to whatever degree the executor allows, not necessarily one after another.
Neither completion::wait nor completion::get of a completion this loader returns may be called from within a task already running on that executor.
| vitrio::executor_image_loader::executor_image_loader | ( | std::shared_ptr< image_reader_provider > | readers, |
| std::shared_ptr< vitrio::executor > | executor | ||
| ) |
Construct a loader over a provider and an executor.
| readers | Where a key becomes an open reader. |
| executor | Where a file's read is run. |
| std::invalid_argument | If readers or executor is null. |
|
overridevirtual |
Load every region a transaction plan names.
May return before the reads are done. The completion returned is ready once every region has been read or has failed, and rethrows what the first failure threw.
The regions of each file are shown to sanitizer beside the extents of that file and of destination, and what it answers is read in their place. What it refuses is reported through the completion. The elements of destination no region reached are left as they were.
| destination | Where the regions land. |
| plan | The transaction to load. |
| sanitizer | What becomes of the regions that do not fit. |
| std::invalid_argument | If sanitizer is null. |
Implements vitrio::image_loader.