vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
scratch_image_reader_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_reader_provider.hpp>
7#include <vitrio/platform.hpp>
8
9#include <memory>
10#include <string>
11
12namespace vitrio
13{
14
15class executor;
16class image_scratch;
17
32class VITRIO_API scratch_image_reader_provider final
33 : public image_reader_provider
34{
35public:
47 std::shared_ptr<image_reader_provider> backing,
48 std::shared_ptr<image_scratch> scratch,
49 std::shared_ptr<executor> tasks
50 );
51
53
54 std::shared_ptr<const image_reader>
55 acquire(const std::string &key) override;
56
57private:
58 VITRIO_STD_MEMBER_INTERFACE
59 std::shared_ptr<image_reader_provider> m_backing;
60 VITRIO_STD_MEMBER_INTERFACE
61 std::shared_ptr<image_scratch> m_scratch;
62 VITRIO_STD_MEMBER_INTERFACE
63 std::shared_ptr<executor> m_tasks;
64};
65
66} // namespace vitrio
Where a task is handed off to run, now or later.
Definition executor.hpp:26
Copies of image files, kept where they are faster to reach than the files themselves.
Definition image_scratch.hpp:27
scratch_image_reader_provider(std::shared_ptr< image_reader_provider > backing, std::shared_ptr< image_scratch > scratch, std::shared_ptr< executor > tasks)
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.