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_writer_provider Class Referenceabstract

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

#include <vitrio/image_writer_provider.hpp>

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

Public Member Functions

 image_writer_provider (const image_writer_provider &other)=delete
 
 image_writer_provider (image_writer_provider &&other)=delete
 
image_writer_provider & operator= (const image_writer_provider &other)=delete
 
image_writer_provider & operator= (image_writer_provider &&other)=delete
 
virtual std::shared_ptr< image_writer > acquire (const std::string &key)=0
 Get the writer a key names.
 

Detailed Description

Interface to serve image_writer given a key.

What a key is and how the image_writer 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 writers concurrently.

Member Function Documentation

◆ acquire()

virtual std::shared_ptr< image_writer > vitrio::image_writer_provider::acquire ( const std::string &  key)
pure virtual

Get the writer a key names.

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

Parameters
keyKey of the file to write, such as its path.
Returns
std::shared_ptr<image_writer> The writer, never null.
Exceptions
std::out_of_rangeIf this provider serves no such file.
unsupported_operation_errorIf no format can create the file, or the chosen one can not represent it.
image_file_errorIf the file could not be created.

Implemented in vitrio::file_image_writer_provider.


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