Class SendMessageBuffered

Inheritance Relationships

Base Type

Class Documentation

class SendMessageBuffered : public netio3::asyncmsg::SendMessage

A class that represents a buffered message to be sent over TCP.

This class is derived from the SendMessage base class and provides functionality to send a message using a buffer. It does not own the buffer so the buffer must be valid until the send is completed.

Public Functions

explicit SendMessageBuffered(const Buffer *buffer)

Constructs a SendMessageBuffered object with the given buffer.

Parameters:

buffer – The buffer containing the message to be sent

virtual void toBuffers(std::vector<boost::asio::const_buffer> &buffers) const override

Converts the message data into a vector of boost::asio::const_buffer objects.

This method overrides the toBuffers method of the base class and populates the given vector with the buffers representing the message. It expects that the data in the buffer is formatted correctly.

Parameters:

buffers – The vector to be populated with the message buffers

inline virtual std::uint64_t key() const override

Retrieves the key of the buffer.

This method returns the key associated with the buffer being sent.

Returns:

The key of the buffer