3#include <xrpl/beast/utility/instrumentation.h>
4#include <xrpl/nodestore/NodeObject.h>
6#include <boost/align/align_up.hpp>
61 XRPL_ASSERT(obj,
"xrpl::NodeStore::EncodedBlob::EncodedBlob : non-null input");
66 return obj->getData().size() + 9;
81 "xrpl::NodeStore::EncodedBlob::~EncodedBlob : valid payload "
88 [[nodiscard]]
void const*
91 return static_cast<void const*
>(
key_.
data());
100 [[nodiscard]]
void const*
103 return static_cast<void const*
>(
ptr_);
Convert a NodeObject from in-memory to database format.
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
std::uint8_t *const ptr_
A pointer to the serialized data.
EncodedBlob(std::shared_ptr< NodeObject > const &obj)
std::uint32_t size_
The size of the serialized data.
std::array< std::uint8_t, boost::alignment::align_up(9+1024, alignof(std::uint32_t))> payload_
A pre-allocated buffer for the serialized object.
void const * getData() const noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.