rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
program_builder_registry.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "../platform/dynamic_shared_object.h"
6
7#include <memory>
8#include <vector>
9
10namespace rexlib
11{
12
13class program_builder;
14class program_manager;
15
20 std::unique_ptr<program_builder> (*)();
21
31{
32public:
33 REXLIB_API program_builder_registry();
36 REXLIB_API ~program_builder_registry();
37
39 operator=(const program_builder_registry &other) = delete;
41 operator=(program_builder_registry &&other) = delete;
42
49 REXLIB_API
51
58 REXLIB_API
59 void register_all(program_manager &manager) const;
60
61private:
62 std::vector<program_builder_factory> m_factories;
63};
64
65} // namespace rexlib
Collects program_builder factories for bulk registration into a program_manager.
Definition program_builder_registry.hpp:31
void add(program_builder_factory factory)
Append a builder factory to the registry.
void register_all(program_manager &manager) const
Instantiate one builder per registered factory and register them into a manager.
Centralizes all known instances of operation program builders.
Definition program_manager.hpp:32
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
std::unique_ptr< program_builder >(*)() program_builder_factory
Factory function that creates a fresh program_builder instance.
Definition program_builder_registry.hpp:20