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_saver Class Referencefinal

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

#include <vitrio/executor_image_saver.hpp>

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

Public Member Functions

 executor_image_saver (std::shared_ptr< image_writer_provider > writers, std::shared_ptr< vitrio::executor > executor)
 Construct a saver over a provider and an executor.
 
std::shared_ptr< completion > save (const_array source, const image_transaction_plan &plan, std::shared_ptr< const image_transfer_sanitizer > sanitizer) const override
 Save every region a transaction plan names.
 
- Public Member Functions inherited from vitrio::image_saver
 image_saver (const image_saver &other)=delete
 
 image_saver (image_saver &&other)=delete
 
image_saver & operator= (const image_saver &other)=delete
 
image_saver & operator= (image_saver &&other)=delete
 

Detailed Description

Performs writes described by a transaction plan on an executor.

Splits the plan by the file each region addresses and writes each file's regions as one task, fanned out onto the executor this was constructed with. Files are therefore written concurrently to whatever degree the executor allows, not necessarily one after another.

Neither completion::wait nor completion::get of a completion this saver returns may be called from within a task already running on that executor.

Constructor & Destructor Documentation

◆ executor_image_saver()

vitrio::executor_image_saver::executor_image_saver ( std::shared_ptr< image_writer_provider >  writers,
std::shared_ptr< vitrio::executor >  executor 
)

Construct a saver over a provider and an executor.

Parameters
writersWhere a key becomes an open writer.
executorWhere a file's write is run.
Exceptions
std::invalid_argumentIf writers or executor is null.

Member Function Documentation

◆ save()

std::shared_ptr< completion > vitrio::executor_image_saver::save ( const_array  source,
const image_transaction_plan &  plan,
std::shared_ptr< const image_transfer_sanitizer >  sanitizer 
) const
overridevirtual

Save every region a transaction plan names.

May return before the writes are done. The completion returned is ready once every region has been written 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 source, and what it answers is written in their place. What it refuses is reported through the completion.

Parameters
sourceThe values to save.
planThe transaction to save.
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_saver.


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