xrpld
Loading...
Searching...
No Matches
Manager.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/nodestore/Backend.h>
5#include <xrpl/nodestore/Database.h>
6#include <xrpl/nodestore/Factory.h>
7#include <xrpl/nodestore/Scheduler.h>
8
9#include <cstddef>
10#include <memory>
11#include <string>
12
13namespace xrpl::node_store {
14
19{
20public:
21 virtual ~Manager() = default;
22 Manager() = default;
23 Manager(Manager const&) = delete;
24 Manager&
25 operator=(Manager const&) = delete;
26
30 static Manager&
31 instance();
32
36 virtual void
37 insert(Factory& factory) = 0;
38
42 virtual void
43 erase(Factory& factory) = 0;
44
50 virtual Factory*
51 find(std::string const& name) = 0;
52
58 Section const& parameters,
59 std::size_t burstSize,
60 Scheduler& scheduler,
61 beast::Journal journal) = 0;
62
94 std::size_t burstSize,
95 Scheduler& scheduler,
96 int readThreads,
97 Section const& backendParameters,
98 beast::Journal journal) = 0;
99};
100
101} // namespace xrpl::node_store
A generic endpoint for log messages.
Definition Journal.h:44
Holds a collection of configuration values.
Definition BasicConfig.h:29
Base class for backend factories.
Definition Factory.h:23
Manager & operator=(Manager const &)=delete
virtual std::unique_ptr< Backend > makeBackend(Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)=0
Create a backend.
virtual void insert(Factory &factory)=0
Add a factory.
virtual std::unique_ptr< Database > makeDatabase(std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &backendParameters, beast::Journal journal)=0
Construct a NodeStore database.
Manager(Manager const &)=delete
static Manager & instance()
Returns the instance of the manager singleton.
virtual Factory * find(std::string const &name)=0
Return a pointer to the matching factory if it exists.
virtual void erase(Factory &factory)=0
Remove a factory.
virtual ~Manager()=default
Scheduling for asynchronous backend activity.