rippled
Public Member Functions | Private Attributes | List of all members
ripple::NodeStore::DecodedBlob Class Reference

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

Public Member Functions

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

Private Attributes

bool m_success
 
void const * m_key
 
NodeObjectType m_objectType
 
unsigned char const * m_objectData
 
int m_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 38 of file DecodedBlob.h.

Constructor & Destructor Documentation

◆ DecodedBlob()

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

Construct the decoded blob from raw data.

Definition at line 28 of file DecodedBlob.cpp.

Member Function Documentation

◆ wasOk()

bool ripple::NodeStore::DecodedBlob::wasOk ( ) const
noexcept

Determine if the decoding was successful.

Definition at line 46 of file DecodedBlob.h.

◆ createObject()

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

Create a NodeObject from this data.

Definition at line 73 of file DecodedBlob.cpp.

Member Data Documentation

◆ m_success

bool ripple::NodeStore::DecodedBlob::m_success
private

Definition at line 56 of file DecodedBlob.h.

◆ m_key

void const* ripple::NodeStore::DecodedBlob::m_key
private

Definition at line 58 of file DecodedBlob.h.

◆ m_objectType

NodeObjectType ripple::NodeStore::DecodedBlob::m_objectType
private

Definition at line 59 of file DecodedBlob.h.

◆ m_objectData

unsigned char const* ripple::NodeStore::DecodedBlob::m_objectData
private

Definition at line 60 of file DecodedBlob.h.

◆ m_dataBytes

int ripple::NodeStore::DecodedBlob::m_dataBytes
private

Definition at line 61 of file DecodedBlob.h.