|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
A provider that reads files. It opens each file through a format selector, every time it is asked for one. More...
#include <vitrio/file_image_reader_provider.hpp>


Public Member Functions | |
| file_image_reader_provider (std::shared_ptr< const image_file_read_format_selector > formats) | |
| Construct a provider opening through a format selector. | |
| std::shared_ptr< const image_reader > | acquire (const std::string &key) override |
| Get the reader a key names. | |
Public Member Functions inherited from vitrio::image_reader_provider | |
| 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 |
A provider that reads files. It opens each file through a format selector, every time it is asked for one.
It keeps nothing: every reader it returns is newly opened through the format selector it was constructed with, so a key asked for twice is opened twice and the two readers are unrelated. With no capacity to size and no eviction, a file is opened exactly as often as it is asked for.
A key is handed to the selector as the path of the file.
|
explicit |
Construct a provider opening through a format selector.
| formats | The formats a file may be opened with. |
| std::invalid_argument | If formats is null. |
|
overridevirtual |
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.
| key | Key of the file to read, such as its path. |
| image_file_error | If the file does not exist or can not be read. |
| unsupported_operation_error | If no format can read the file. |
| image_file_format_error | If the file is malformed or truncated. |
Implements vitrio::image_reader_provider.