xrpld
Loading...
Searching...
No Matches
xrpl::NodeStore::MemoryFactory Class Reference
Inheritance diagram for xrpl::NodeStore::MemoryFactory:
Collaboration diagram for xrpl::NodeStore::MemoryFactory:

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 38 of file MemoryFactory.cpp.

Constructor & Destructor Documentation

◆ MemoryFactory()

xrpl::NodeStore::MemoryFactory::MemoryFactory ( Manager & manager)
explicit

Definition at line 197 of file MemoryFactory.cpp.

Member Function Documentation

◆ getName()

std::string xrpl::NodeStore::MemoryFactory::getName ( ) const
nodiscardoverridevirtual

Retrieve the name of this factory.

Implements xrpl::NodeStore::Factory.

Definition at line 203 of file MemoryFactory.cpp.

◆ createInstance() [1/2]

std::unique_ptr< Backend > xrpl::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 xrpl::NodeStore::Factory.

Definition at line 209 of file MemoryFactory.cpp.

◆ open()

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

Definition at line 60 of file MemoryFactory.cpp.

◆ createInstance() [2/2]

virtual std::unique_ptr< Backend > xrpl::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 xrpl::NodeStore::NuDBFactory.

Definition at line 51 of file Factory.h.

Member Data Documentation

◆ mutex_

std::mutex xrpl::NodeStore::MemoryFactory::mutex_
private

Definition at line 41 of file MemoryFactory.cpp.

◆ map_

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

Definition at line 42 of file MemoryFactory.cpp.

◆ manager_

Manager& xrpl::NodeStore::MemoryFactory::manager_
private

Definition at line 43 of file MemoryFactory.cpp.