rippled
Loading...
Searching...
No Matches
Factory.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_NODESTORE_FACTORY_H_INCLUDED
21#define RIPPLE_NODESTORE_FACTORY_H_INCLUDED
22
23#include <xrpld/nodestore/Backend.h>
24#include <xrpld/nodestore/Scheduler.h>
25
26#include <xrpl/basics/BasicConfig.h>
27#include <xrpl/beast/utility/Journal.h>
28
29#include <nudb/store.hpp>
30
31namespace ripple {
32
33namespace NodeStore {
34
37{
38public:
39 virtual ~Factory() = default;
40
42 virtual std::string
43 getName() const = 0;
44
55 size_t keyBytes,
56 Section const& parameters,
58 Scheduler& scheduler,
59 beast::Journal journal) = 0;
60
72 size_t keyBytes,
73 Section const& parameters,
75 Scheduler& scheduler,
76 nudb::context& context,
77 beast::Journal journal)
78 {
79 return {};
80 }
81};
82
83} // namespace NodeStore
84} // namespace ripple
85
86#endif
A generic endpoint for log messages.
Definition Journal.h:60
Base class for backend factories.
Definition Factory.h:37
virtual std::string getName() const =0
Retrieve the name of this factory.
virtual ~Factory()=default
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:71
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.
Scheduling for asynchronous backend activity.
Holds a collection of configuration values.
Definition BasicConfig.h:45
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25