1#ifndef XRPL_OVERLAY_MESSAGE_H_INCLUDED
2#define XRPL_OVERLAY_MESSAGE_H_INCLUDED
4#include <xrpld/overlay/Compression.h>
6#include <xrpl/basics/ByteUtilities.h>
7#include <xrpl/protocol/PublicKey.h>
8#include <xrpl/protocol/messages.h>
43 ::google::protobuf::Message
const& message,
44 protocol::MessageType type,
52 messageSize(::google::protobuf::Message
const& message);
55 totalSize(::google::protobuf::Message
const& message);
std::once_flag once_flag_
std::size_t getCategory() const
Get the traffic category.
compression::Compressed Compressed
void setHeader(std::uint8_t *in, std::uint32_t payloadBytes, int type, Algorithm compression, std::uint32_t uncompressedBytes)
Set the payload header.
std::vector< uint8_t > const & getBuffer(Compressed tryCompressed)
Retrieve the packed message data.
std::size_t getBufferSize()
Retrieve the size of the packed but uncompressed message data.
std::optional< PublicKey > const & getValidatorKey() const
Get the validator's key.
static std::size_t totalSize(::google::protobuf::Message const &message)
std::optional< PublicKey > validatorKey_
std::vector< uint8_t > buffer_
std::vector< uint8_t > bufferCompressed_
int getType(std::uint8_t const *in) const
Get the message type from the payload header.
void compress()
Try to compress the payload.
static std::size_t messageSize(::google::protobuf::Message const &message)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr auto megabytes(T value) noexcept
constexpr std::size_t maximiumMessageSize