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::image_reader_provider Class Referenceabstract

Interface to serve image_reader given a key. More...

#include <vitrio/image_reader_provider.hpp>

Inheritance diagram for vitrio::image_reader_provider:
Inheritance graph
[legend]

Public Member Functions

 image_reader_provider (const image_reader_provider &other)=delete
 
 image_reader_provider (image_reader_provider &&other)=delete
 
image_reader_provider & operator= (const image_reader_provider &other)=delete
 
image_reader_provider & operator= (image_reader_provider &&other)=delete
 
virtual std::shared_ptr< const image_reader > acquire (const std::string &key)=0
 Get the reader a key names.
 

Detailed Description

Interface to serve image_reader given a key.

What a key is and how the image_reader is created are left to the implementation. A key is often the path of a file, and need not be.

Thread safety
A provider may be asked for readers concurrently.

Member Function Documentation

◆ acquire()

virtual std::shared_ptr< const image_reader > vitrio::image_reader_provider::acquire ( const std::string &  key)
pure virtual

Get the reader a key names.

Shared ownership rather than a reference, so that a reader the provider stops keeping stays alive for as long as it is still read through.

Parameters
keyKey of the file to read, such as its path.
Returns
std::shared_ptr<const image_reader> The reader, never null.
Exceptions
image_file_errorIf the file does not exist or can not be read.
unsupported_operation_errorIf no format can read the file.
image_file_format_errorIf the file is malformed or truncated.

Implemented in vitrio::caching_image_reader_provider, vitrio::detector_event_image_reader_provider, vitrio::file_image_reader_provider, and vitrio::scratch_image_reader_provider.


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