1#ifndef XRPL_NODESTORE_ENCODEDBLOB_H_INCLUDED
2#define XRPL_NODESTORE_ENCODEDBLOB_H_INCLUDED
4#include <xrpl/beast/utility/instrumentation.h>
5#include <xrpl/nodestore/NodeObject.h>
7#include <boost/align/align_up.hpp>
67 "ripple::NodeStore::EncodedBlob::EncodedBlob : non-null input");
71 "EncodedBlob: unseated std::shared_ptr used.");
73 return obj->getData().size() + 9;
90 "ripple::NodeStore::EncodedBlob::~EncodedBlob : valid payload "
97 [[nodiscard]]
void const*
100 return static_cast<void const*
>(
key_.
data());
109 [[nodiscard]]
void const*
112 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.