20 #ifndef RIPPLE_OVERLAY_MESSAGE_H_INCLUDED
21 #define RIPPLE_OVERLAY_MESSAGE_H_INCLUDED
23 #include <ripple/overlay/Compression.h>
24 #include <ripple/protocol/PublicKey.h>
25 #include <ripple/protocol/messages.h>
26 #include <boost/asio/buffer.hpp>
27 #include <boost/asio/buffers_iterator.hpp>
63 ::google::protobuf::Message
const& message,
65 boost::optional<PublicKey>
const& validator = {});
88 boost::optional<PublicKey>
const&
std::vector< uint8_t > const & getBuffer(Compressed tryCompressed)
Retrieve the packed message data.
void compress()
Try to compress the payload.
int getType(std::uint8_t const *in) const
Get the message type from the payload header.
void setHeader(std::uint8_t *in, std::uint32_t payloadBytes, int type, Algorithm compression, std::uint32_t uncompressedBytes)
Set the payload header.
std::once_flag once_flag_
std::size_t getCategory() const
Get the traffic category.
boost::optional< PublicKey > const & getValidatorKey() const
Get the validator's key.
boost::optional< PublicKey > validatorKey_
compression::Compressed Compressed
std::vector< uint8_t > buffer_
std::size_t getBufferSize()
Retrieve the size of the packed but uncompressed message data.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::vector< uint8_t > bufferCompressed_
Message(::google::protobuf::Message const &message, int type, boost::optional< PublicKey > const &validator={})
Constructor.