Program Listing for File SendMessageUnbufferedCopy.hpp
↰ Return to documentation for file (BackendAsyncmsg/SendMessageUnbufferedCopy.hpp
)
#ifndef NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGEUNBUFFEREDCOPY_HPP
#define NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGEUNBUFFEREDCOPY_HPP
#include <cstdint>
#include <span>
#include <vector>
#include <sys/uio.h>
#include <boost/asio/buffer.hpp>
#include "SendMessage.hpp"
namespace netio3::asyncmsg {
class SendMessageUnbufferedCopy : public SendMessage
{
public:
SendMessageUnbufferedCopy(std::span<const std::uint8_t> data,
std::span<const std::uint8_t> header_data,
std::uint64_t key);
SendMessageUnbufferedCopy(std::span<const iovec> data,
std::span<const std::uint8_t> header_data,
std::uint64_t key);
void toBuffers(std::vector<boost::asio::const_buffer>& buffers) const override;
[[nodiscard]] std::uint64_t key() const override { return m_key; };
private:
std::vector<std::uint8_t> m_data;
std::vector<std::uint8_t> m_header_data;
std::uint64_t m_key;
};
} // namespace netio3::asyncmsg
#endif // NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGEUNBUFFERED_HPP