xrpld
Loading...
Searching...
No Matches
Factory.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/nodestore/Backend.h>
5#include <xrpl/nodestore/Scheduler.h>
6
7#include <nudb/context.hpp>
8
9#include <cstddef>
10#include <memory>
11#include <string>
12
13namespace xrpl {
14class Section;
15} // namespace xrpl
16
17namespace xrpl::node_store {
18
23{
24public:
25 virtual ~Factory() = default;
26
30 [[nodiscard]] virtual std::string
31 getName() const = 0;
32
44 size_t keyBytes,
45 Section const& parameters,
46 std::size_t burstSize,
47 Scheduler& scheduler,
48 beast::Journal journal) = 0;
49
62 size_t keyBytes,
63 Section const& parameters,
64 std::size_t burstSize,
65 Scheduler& scheduler,
66 nudb::context& context,
67 beast::Journal journal)
68 {
69 return {};
70 }
71};
72
73} // 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
virtual std::unique_ptr< Backend > createInstance(size_t keyBytes, Section const &parameters, std::size_t burstSize, Scheduler &scheduler, nudb::context &context, beast::Journal journal)
Create an instance of this factory's backend.
Definition Factory.h:61
virtual ~Factory()=default
virtual std::unique_ptr< Backend > createInstance(size_t keyBytes, Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal)=0
Create an instance of this factory's backend.
virtual std::string getName() const =0
Retrieve the name of this factory.
Scheduling for asynchronous backend activity.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5