rippled
Public Member Functions | List of all members
ripple::NodeStore::NullBackend Class Reference
Inheritance diagram for ripple::NodeStore::NullBackend:
Inheritance graph
[legend]
Collaboration diagram for ripple::NodeStore::NullBackend:
Collaboration graph
[legend]

Public Member Functions

 NullBackend ()=default
 
 ~NullBackend ()=default
 
std::string getName () override
 Get the human-readable name of this backend. More...
 
void open (bool createIfMissing) override
 Open the backend. More...
 
bool isOpen () override
 Returns true is the database is open. More...
 
void close () override
 Close the backend. More...
 
Status fetch (void const *, std::shared_ptr< NodeObject > *) override
 Fetch a single object. More...
 
void store (std::shared_ptr< NodeObject > const &object) override
 Store a single object. More...
 
void storeBatch (Batch const &batch) override
 Store a group of objects. More...
 
void for_each (std::function< void(std::shared_ptr< NodeObject >)> f) override
 Visit every object in the database This is usually called during import. More...
 
int getWriteLoad () override
 Estimate the number of write operations pending. More...
 
void setDeletePath () override
 Remove contents on disk upon destruction. More...
 
void verify () override
 Perform consistency checks on database. More...
 
int fdRequired () const override
 Returns the number of file descriptors the backend expects to need. More...
 
bool backed () const
 Returns true if the backend uses permanent storage. More...
 

Detailed Description

Definition at line 28 of file NullFactory.cpp.

Constructor & Destructor Documentation

◆ NullBackend()

ripple::NodeStore::NullBackend::NullBackend ( )
default

◆ ~NullBackend()

ripple::NodeStore::NullBackend::~NullBackend ( )
default

Member Function Documentation

◆ getName()

std::string ripple::NodeStore::NullBackend::getName ( )
overridevirtual

Get the human-readable name of this backend.

This is used for diagnostic output.

Implements ripple::NodeStore::Backend.

Definition at line 36 of file NullFactory.cpp.

◆ open()

void ripple::NodeStore::NullBackend::open ( bool  createIfMissing)
overridevirtual

Open the backend.

Parameters
createIfMissingCreate the database files if necessary. This allows the caller to catch exceptions.

Implements ripple::NodeStore::Backend.

Definition at line 42 of file NullFactory.cpp.

◆ isOpen()

bool ripple::NodeStore::NullBackend::isOpen ( )
overridevirtual

Returns true is the database is open.

Implements ripple::NodeStore::Backend.

Definition at line 47 of file NullFactory.cpp.

◆ close()

void ripple::NodeStore::NullBackend::close ( )
overridevirtual

Close the backend.

This allows the caller to catch exceptions.

Implements ripple::NodeStore::Backend.

Definition at line 53 of file NullFactory.cpp.

◆ fetch()

Status ripple::NodeStore::NullBackend::fetch ( void const *  key,
std::shared_ptr< NodeObject > *  pObject 
)
overridevirtual

Fetch a single object.

If the object is not found or an error is encountered, the result will indicate the condition.

Note
This will be called concurrently.
Parameters
keyA pointer to the key data.
pObject[out] The created object if successful.
Returns
The result of the operation.

Implements ripple::NodeStore::Backend.

Definition at line 58 of file NullFactory.cpp.

◆ store()

void ripple::NodeStore::NullBackend::store ( std::shared_ptr< NodeObject > const &  object)
overridevirtual

Store a single object.

Depending on the implementation this may happen immediately or deferred using a scheduled task.

Note
This will be called concurrently.
Parameters
objectThe object to store.

Implements ripple::NodeStore::Backend.

Definition at line 64 of file NullFactory.cpp.

◆ storeBatch()

void ripple::NodeStore::NullBackend::storeBatch ( Batch const &  batch)
overridevirtual

Store a group of objects.

Note
This function will not be called concurrently with itself or store.

Implements ripple::NodeStore::Backend.

Definition at line 69 of file NullFactory.cpp.

◆ for_each()

void ripple::NodeStore::NullBackend::for_each ( std::function< void(std::shared_ptr< NodeObject >)>  f)
overridevirtual

Visit every object in the database This is usually called during import.

Note
This routine will not be called concurrently with itself or other methods.
See also
import

Implements ripple::NodeStore::Backend.

Definition at line 74 of file NullFactory.cpp.

◆ getWriteLoad()

int ripple::NodeStore::NullBackend::getWriteLoad ( )
overridevirtual

Estimate the number of write operations pending.

Implements ripple::NodeStore::Backend.

Definition at line 79 of file NullFactory.cpp.

◆ setDeletePath()

void ripple::NodeStore::NullBackend::setDeletePath ( )
overridevirtual

Remove contents on disk upon destruction.

Implements ripple::NodeStore::Backend.

Definition at line 85 of file NullFactory.cpp.

◆ verify()

void ripple::NodeStore::NullBackend::verify ( )
overridevirtual

Perform consistency checks on database.

Implements ripple::NodeStore::Backend.

Definition at line 90 of file NullFactory.cpp.

◆ fdRequired()

int ripple::NodeStore::NullBackend::fdRequired ( ) const
overridevirtual

Returns the number of file descriptors the backend expects to need.

Implements ripple::NodeStore::Backend.

Definition at line 96 of file NullFactory.cpp.

◆ backed()

bool ripple::NodeStore::Backend::backed ( ) const
inherited

Returns true if the backend uses permanent storage.

Definition at line 126 of file Backend.h.