vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
file_image_writer_provider.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/image_writer_provider.hpp>
7#include <vitrio/platform.hpp>
8
9#include <cstddef>
10#include <memory>
11#include <string>
12
13namespace vitrio
14{
15
19class image_metadata;
21
51class VITRIO_API file_image_writer_provider final
52 : public image_writer_provider
53{
54public:
64 std::shared_ptr<const image_file_write_format_selector> formats,
65 std::shared_ptr<const file_transfer_pool> transfers
66 );
67
69
88 void declare(
89 std::string key,
90 image_descriptor descriptor,
91 const image_metadata &metadata
92 );
93
109 void close(const std::string &key);
110
130 const std::string &key,
131 std::shared_ptr<completion_notifier> done
132 );
133
145 void flush();
146
155 std::size_t get_file_count() const noexcept;
156
157 std::shared_ptr<image_writer> acquire(const std::string &key) override;
158
159private:
160 class implementation;
161 VITRIO_STD_MEMBER_INTERFACE
162 std::unique_ptr<implementation> m_implementation;
163};
164
165} // namespace vitrio
Where a finished unit of work is reported.
Definition completion_notifier.hpp:20
void flush()
Make everything written to the files reach the storage.
void declare(std::string key, image_descriptor descriptor, const image_metadata &metadata)
Make a file writable.
std::size_t get_file_count() const noexcept
Get how many files are declared.
file_image_writer_provider(std::shared_ptr< const image_file_write_format_selector > formats, std::shared_ptr< const file_transfer_pool > transfers)
Construct a provider creating files through a format selector.
std::shared_ptr< image_writer > acquire(const std::string &key) override
Get the writer a key names.
void close(const std::string &key)
Finish a file.
void close_async(const std::string &key, std::shared_ptr< completion_notifier > done)
Start finishing a file, and report once it is finished.
Threads that carry out the reads and writes of files, each many at once, and hand the computations th...
Definition file_transfer_pool.hpp:30
The shape and data type of the values an image file holds.
Definition image_descriptor.hpp:28
Holds the image formats that can be written, selects the most suitable of them for a file,...
Definition image_file_write_format_selector.hpp:35
What an image file states beyond its shape and data type, such as the distance between its samples.
Definition image_metadata.hpp:35
Abstract writable view of one image file.
Definition image_writer.hpp:28