20#ifndef RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
21#define RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
23#include <xrpl/beast/utility/instrumentation.h>
24#include <xrpl/nodestore/NodeObject.h>
26#include <boost/align/align_up.hpp>
86 "ripple::NodeStore::EncodedBlob::EncodedBlob : non-null input");
90 "EncodedBlob: unseated std::shared_ptr used.");
92 return obj->getData().size() + 9;
109 "ripple::NodeStore::EncodedBlob::~EncodedBlob : valid payload "
116 [[nodiscard]]
void const*
119 return static_cast<void const*
>(
key_.
data());
128 [[nodiscard]]
void const*
131 return static_cast<void const*
>(
ptr_);
Convert a NodeObject from in-memory to database format.
std::uint8_t *const ptr_
A pointer to the serialized data.
EncodedBlob(std::shared_ptr< NodeObject > const &obj)
std::array< std::uint8_t, boost::alignment::align_up(9+1024, alignof(std::uint32_t))> payload_
A pre-allocated buffer for the serialized object.
std::uint32_t size_
The size of the serialized data.
void const * getKey() const noexcept
std::array< std::uint8_t, 32 > key_
The 32-byte key of the serialized object.
std::size_t getSize() const noexcept
void const * getData() const noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.