xrpld
Loading...
Searching...
No Matches
xrpl::NodeStore::DecodedBlob Class Reference

Parsed key/value blob into NodeObject components. More...

#include <DecodedBlob.h>

Public Member Functions

 DecodedBlob (void const *key, void const *value, int valueBytes)
 Construct the decoded blob from raw data.
bool wasOk () const noexcept
 Determine if the decoding was successful.
std::shared_ptr< NodeObjectcreateObject ()
 Create a NodeObject from this data.

Private Attributes

bool success_
void const * key_
NodeObjectType objectType_
unsigned char const * objectData_
int dataBytes_

Detailed Description

Parsed key/value blob into NodeObject components.

This will extract the information required to construct a NodeObject. It also does consistency checking and returns the result, so it is possible to determine if the data is corrupted without throwing an exception. Not all forms of corruption are detected so further analysis will be needed to eliminate false negatives.

Note
This defines the database format of a NodeObject!

Definition at line 17 of file DecodedBlob.h.

Constructor & Destructor Documentation

◆ DecodedBlob()

xrpl::NodeStore::DecodedBlob::DecodedBlob ( void const * key,
void const * value,
int valueBytes )

Construct the decoded blob from raw data.

Definition at line 15 of file DecodedBlob.cpp.

Member Function Documentation

◆ wasOk()

bool xrpl::NodeStore::DecodedBlob::wasOk ( ) const
nodiscardnoexcept

Determine if the decoding was successful.

Definition at line 25 of file DecodedBlob.h.

◆ createObject()

std::shared_ptr< NodeObject > xrpl::NodeStore::DecodedBlob::createObject ( )

Create a NodeObject from this data.

Definition at line 60 of file DecodedBlob.cpp.

Member Data Documentation

◆ success_

bool xrpl::NodeStore::DecodedBlob::success_
private

Definition at line 35 of file DecodedBlob.h.

◆ key_

void const* xrpl::NodeStore::DecodedBlob::key_
private

Definition at line 37 of file DecodedBlob.h.

◆ objectType_

NodeObjectType xrpl::NodeStore::DecodedBlob::objectType_
private

Definition at line 38 of file DecodedBlob.h.

◆ objectData_

unsigned char const* xrpl::NodeStore::DecodedBlob::objectData_
private

Definition at line 39 of file DecodedBlob.h.

◆ dataBytes_

int xrpl::NodeStore::DecodedBlob::dataBytes_
private

Definition at line 40 of file DecodedBlob.h.