vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vitrio::executor_image_loader Class Referencefinal

Performs reads described by a transaction plan on an executor. More...

#include <vitrio/executor_image_loader.hpp>

Inheritance diagram for vitrio::executor_image_loader:
Inheritance graph
[legend]
Collaboration diagram for vitrio::executor_image_loader:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ executor_image_loader()

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.

Parameters
readersWhere a key becomes an open reader.
executorWhere a file's read is run.
Exceptions
std::invalid_argumentIf readers or executor is null.

Member Function Documentation

◆ load()

std::shared_ptr< completion > vitrio::executor_image_loader::load ( array  destination,
const image_transaction_plan &  plan,
std::shared_ptr< const image_transfer_sanitizer >  sanitizer 
) const
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.

Parameters
destinationWhere the regions land.
planThe transaction to load.
sanitizerWhat becomes of the regions that do not fit.
Returns
std::shared_ptr<completion> The completion, never null.
Exceptions
std::invalid_argumentIf sanitizer is null.

Implements vitrio::image_loader.


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