rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ripple::NodeStore::MemoryFactory Class Reference
Inheritance diagram for ripple::NodeStore::MemoryFactory:
Inheritance graph
[legend]
Collaboration diagram for ripple::NodeStore::MemoryFactory:
Collaboration graph
[legend]

Public Member Functions

 MemoryFactory (Manager &manager)
 
std::string getName () const override
 Retrieve the name of this factory.
 
std::unique_ptr< BackendcreateInstance (size_t keyBytes, Section const &keyValues, std::size_t burstSize, Scheduler &scheduler, beast::Journal journal) override
 Create an instance of this factory's backend.
 
MemoryDBopen (std::string const &path)
 
virtual std::unique_ptr< BackendcreateInstance (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.
 

Private Attributes

std::mutex mutex_
 
std::map< std::string, MemoryDB, boost::beast::iless > map_
 
Managermanager_
 

Detailed Description

Definition at line 24 of file MemoryFactory.cpp.

Constructor & Destructor Documentation

◆ MemoryFactory()

ripple::NodeStore::MemoryFactory::MemoryFactory ( Manager manager)
explicit

Definition at line 209 of file MemoryFactory.cpp.

Member Function Documentation

◆ getName()

std::string ripple::NodeStore::MemoryFactory::getName ( ) const
overridevirtual

Retrieve the name of this factory.

Implements ripple::NodeStore::Factory.

Definition at line 215 of file MemoryFactory.cpp.

◆ createInstance() [1/2]

std::unique_ptr< Backend > ripple::NodeStore::MemoryFactory::createInstance ( size_t  keyBytes,
Section const &  parameters,
std::size_t  burstSize,
Scheduler scheduler,
beast::Journal  journal 
)
overridevirtual

Create an instance of this factory's backend.

Parameters
keyBytesThe fixed number of bytes per key.
parametersA set of key/value configuration pairs.
burstSizeBackend burst size in bytes.
schedulerThe scheduler to use for running tasks.
Returns
A pointer to the Backend object.

Implements ripple::NodeStore::Factory.

Definition at line 221 of file MemoryFactory.cpp.

◆ open()

MemoryDB & ripple::NodeStore::MemoryFactory::open ( std::string const &  path)

Definition at line 46 of file MemoryFactory.cpp.

◆ createInstance() [2/2]

virtual std::unique_ptr< Backend > ripple::NodeStore::Factory::createInstance ( size_t  keyBytes,
Section const &  parameters,
std::size_t  burstSize,
Scheduler scheduler,
nudb::context &  context,
beast::Journal  journal 
)
virtualinherited

Create an instance of this factory's backend.

Parameters
keyBytesThe fixed number of bytes per key.
parametersA set of key/value configuration pairs.
burstSizeBackend burst size in bytes.
schedulerThe scheduler to use for running tasks.
contextThe context used by database.
Returns
A pointer to the Backend object.

Reimplemented in ripple::NodeStore::NuDBFactory.

Definition at line 51 of file Factory.h.

Member Data Documentation

◆ mutex_

std::mutex ripple::NodeStore::MemoryFactory::mutex_
private

Definition at line 27 of file MemoryFactory.cpp.

◆ map_

std::map<std::string, MemoryDB, boost::beast::iless> ripple::NodeStore::MemoryFactory::map_
private

Definition at line 28 of file MemoryFactory.cpp.

◆ manager_

Manager& ripple::NodeStore::MemoryFactory::manager_
private

Definition at line 29 of file MemoryFactory.cpp.