Class SendMessage
Defined in File SendMessage.hpp
Inheritance Relationships
Base Type
public felix::asyncmsg::OutputMessage
Derived Types
public netio3::asyncmsg::SendMessageBuffered
(Class SendMessageBuffered)public netio3::asyncmsg::SendMessageUnbuffered
(Class SendMessageUnbuffered)public netio3::asyncmsg::SendMessageUnbufferedCopy
(Class SendMessageUnbufferedCopy)
Class Documentation
-
class SendMessage : public felix::asyncmsg::OutputMessage
The abstract message type for sending data over TCP.
Serves as a base for both buffered and unbuffered sending. Defines type and transaction ID.
Subclassed by netio3::asyncmsg::SendMessageBuffered, netio3::asyncmsg::SendMessageUnbuffered, netio3::asyncmsg::SendMessageUnbufferedCopy
Public Functions
-
virtual void toBuffers(std::vector<boost::asio::const_buffer> &buffers) const override = 0
Converts the data of the object into a vector of constant buffers.
This function is a pure virtual function that must be implemented by derived classes. It is used to convert the data of the object into a vector of constant buffers, which can be used for sending data over a network using Boost.Asio.
- Parameters:
buffers – A reference to a vector of constant buffers where the converted data will be stored
-
inline std::uint32_t typeId() const override
Returns the type ID of the message.
This library makes no use of different message types.
- Returns:
Type ID
-
inline std::uint32_t transactionId() const override
Returns the transaction ID of the message.
This library makes no use of transaction IDs.
- Returns:
Transaction ID
-
virtual std::uint64_t key() const = 0
Retrieves the key of the message.
This method returns the key associated with the message being sent.
- Returns:
The key of the message
-
virtual void toBuffers(std::vector<boost::asio::const_buffer> &buffers) const override = 0