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::scratch_image_reader_provider Class Referencefinal

A provider that serves files through a scratch. More...

#include <vitrio/scratch_image_reader_provider.hpp>

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

Public Member Functions

 scratch_image_reader_provider (std::shared_ptr< image_reader_provider > backing, std::shared_ptr< image_scratch > scratch)
 Construct a provider serving through a scratch.
 
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
 

Detailed Description

A provider that serves files through a scratch.

It is a decorator over another provider: every file is asked of the backing provider. A file the scratch holds an entry of is served by a reader that reads from the entry what the entry holds and from the backing reader the rest. Any other file is served by the backing reader itself.

A reader served through an entry reports what the backing reader reports, and reads through the backing reader only what the entry does not hold.

Constructor & Destructor Documentation

◆ scratch_image_reader_provider()

vitrio::scratch_image_reader_provider::scratch_image_reader_provider ( std::shared_ptr< image_reader_provider >  backing,
std::shared_ptr< image_scratch >  scratch 
)

Construct a provider serving through a scratch.

Parameters
backingThe provider asked for the files themselves.
scratchWhat is held of the files, which reading through this provider adds to.
Exceptions
std::invalid_argumentIf backing or scratch is null.

Member Function Documentation

◆ acquire()

std::shared_ptr< const image_reader > vitrio::scratch_image_reader_provider::acquire ( const std::string &  key)
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.

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.

Implements vitrio::image_reader_provider.


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