rippled
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 <ripple/nodestore/Manager.h>
24 
25 namespace ripple {
26 namespace NodeStore {
27 
28 class ManagerImp : public Manager
29 {
30 private:
33 
34 public:
35  static ManagerImp&
36  instance();
37 
38  static void
40 
41  ManagerImp() = default;
42 
43  ~ManagerImp() = default;
44 
45  Factory*
46  find(std::string const& name) override;
47 
48  void
49  insert(Factory& factory) override;
50 
51  void
52  erase(Factory& factory) override;
53 
56  Section const& parameters,
57  Scheduler& scheduler,
58  beast::Journal journal) override;
59 
62  std::string const& name,
63  Scheduler& scheduler,
64  int readThreads,
65  Stoppable& parent,
66  Section const& config,
67  beast::Journal journal) override;
68 };
69 
70 } // namespace NodeStore
71 } // namespace ripple
72 
73 #endif
ripple::Section
Holds a collection of configuration values.
Definition: BasicConfig.h:43
ripple::NodeStore::Manager
Singleton for managing NodeStore factories and back ends.
Definition: Manager.h:31
ripple::NodeStore::ManagerImp::make_Database
std::unique_ptr< Database > make_Database(std::string const &name, Scheduler &scheduler, int readThreads, Stoppable &parent, Section const &config, beast::Journal journal) override
Construct a NodeStore database.
Definition: ManagerImp.cpp:62
ripple::NodeStore::Factory
Base class for backend factories.
Definition: Factory.h:32
std::string
STL class.
ripple::NodeStore::ManagerImp::insert
void insert(Factory &factory) override
Add a factory.
Definition: ManagerImp.cpp:83
ripple::NodeStore::ManagerImp
Definition: ManagerImp.h:28
std::vector
STL class.
ripple::NodeStore::ManagerImp::missing_backend
static void missing_backend()
Definition: ManagerImp.cpp:36
ripple::NodeStore::ManagerImp::ManagerImp
ManagerImp()=default
ripple::NodeStore::ManagerImp::find
Factory * find(std::string const &name) override
Return a pointer to the matching factory if it exists.
Definition: ManagerImp.cpp:102
ripple::Stoppable
Provides an interface for starting and stopping.
Definition: Stoppable.h:200
ripple::NodeStore::ManagerImp::instance
static ManagerImp & instance()
Definition: ManagerImp.cpp:29
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::NodeStore::ManagerImp::~ManagerImp
~ManagerImp()=default
ripple::NodeStore::Scheduler
Scheduling for asynchronous backend activity.
Definition: ripple/nodestore/Scheduler.h:57
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::NodeStore::ManagerImp::list_
std::vector< Factory * > list_
Definition: ManagerImp.h:32
ripple::NodeStore::ManagerImp::mutex_
std::mutex mutex_
Definition: ManagerImp.h:31
std::mutex
STL class.
ripple::NodeStore::ManagerImp::make_Backend
std::unique_ptr< Backend > make_Backend(Section const &parameters, Scheduler &scheduler, beast::Journal journal) override
Create a backend.
Definition: ManagerImp.cpp:44
std::unique_ptr
STL class.
ripple::NodeStore::ManagerImp::erase
void erase(Factory &factory) override
Remove a factory.
Definition: ManagerImp.cpp:90