rippled
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 ()
 
 ~MemoryFactory () override
 
std::string getName () const override
 Retrieve the name of this factory. More...
 
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. More...
 
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. More...
 

Private Attributes

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

Detailed Description

Definition at line 41 of file MemoryFactory.cpp.

Constructor & Destructor Documentation

◆ MemoryFactory()

ripple::NodeStore::MemoryFactory::MemoryFactory ( )

Definition at line 215 of file MemoryFactory.cpp.

◆ ~MemoryFactory()

ripple::NodeStore::MemoryFactory::~MemoryFactory ( )
override

Definition at line 220 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 226 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 232 of file MemoryFactory.cpp.

◆ open()

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

Definition at line 63 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 68 of file Factory.h.

Member Data Documentation

◆ mutex_

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

Definition at line 44 of file MemoryFactory.cpp.

◆ map_

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

Definition at line 45 of file MemoryFactory.cpp.