rippled
Loading...
Searching...
No Matches
ManagerImp.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_MANAGERIMP_H_INCLUDED
21#define RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
22
23#include <xrpld/nodestore/Manager.h>
24
25namespace ripple {
26
27namespace NodeStore {
28
29class ManagerImp : public Manager
30{
31private:
34
35public:
36 static ManagerImp&
37 instance();
38
39 static void
41
42 ManagerImp() = default;
43
44 ~ManagerImp() = default;
45
46 Factory*
47 find(std::string const& name) override;
48
49 void
50 insert(Factory& factory) override;
51
52 void
53 erase(Factory& factory) override;
54
57 Section const& parameters,
59 Scheduler& scheduler,
60 beast::Journal journal) override;
61
65 Scheduler& scheduler,
66 int readThreads,
67 Section const& config,
68 beast::Journal journal) override;
69};
70
71} // namespace NodeStore
72} // namespace ripple
73
74#endif
A generic endpoint for log messages.
Definition Journal.h:60
Base class for backend factories.
Definition Factory.h:37
Factory * find(std::string const &name) override
Return a pointer to the matching factory if it exists.
std::vector< Factory * > list_
Definition ManagerImp.h:33
std::unique_ptr< Database > make_Database(std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &config, beast::Journal journal) override
Construct a NodeStore database.
static ManagerImp & instance()
void insert(Factory &factory) override
Add a factory.
std::unique_ptr< Backend > make_Backend(Section const &parameters, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal) override
Create a backend.
void erase(Factory &factory) override
Remove a factory.
Singleton for managing NodeStore factories and back ends.
Definition Manager.h:32
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