vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
synchronous_image_writer.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.hpp>
7
8namespace vitrio
9{
10
11class const_array_ref;
12
21class VITRIO_API synchronous_image_writer
22 : public image_writer
23{
24public:
25 synchronous_image_writer() noexcept;
26 ~synchronous_image_writer() override;
27
34 const_array source,
35 image_transfer_plan regions,
36 std::shared_ptr<completion_notifier> done
37 ) final;
38
44 void flush_async(std::shared_ptr<completion_notifier> done) final;
45
60 virtual void write(
61 const_array_ref source,
62 const image_transfer_plan &regions
63 ) = 0;
64
72 virtual void flush() = 0;
73};
74
75} // namespace vitrio
A read-only reference to a multidimensional array that does not keep it alive.
Definition const_array_ref.hpp:29
A multidimensional array of numbers that cannot be written through.
Definition const_array.hpp:29
The regions to transfer between one file and one array.
Definition image_transfer_plan.hpp:34
virtual void write(const_array_ref source, const image_transfer_plan &regions)=0
Write a set of hyperrectangles of the file from one array, all before returning.
void write_async(const_array source, image_transfer_plan regions, std::shared_ptr< completion_notifier > done) final
Start writing a set of hyperrectangles of the file from one array.
void flush_async(std::shared_ptr< completion_notifier > done) final
Start making what has been written reach the storage.
virtual void flush()=0
Make what has been written reach the storage, before returning.