.. _program_listing_file_BackendAsyncmsg_ReceiveMessage.hpp: Program Listing for File ReceiveMessage.hpp =========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``BackendAsyncmsg/ReceiveMessage.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef NETIO3BACKEND_BACKENDASYNCMSG_RECEIVEMESSAGE_HPP #define NETIO3BACKEND_BACKENDASYNCMSG_RECEIVEMESSAGE_HPP #include #include #include #include #include namespace netio3::asyncmsg { class ReceiveMessage : public felix::asyncmsg::InputMessage { public: struct ReceiveMessageConfig { std::uint32_t typeId{}; std::uint32_t transactionId{}; std::uint32_t size{}; }; struct Message { Message() = default; Message(const Message&) = delete; Message(Message&&) = default; Message& operator=(const Message&) = delete; Message& operator=(Message&&) = default; ~Message() = default; std::vector data; }; explicit ReceiveMessage(const ReceiveMessageConfig& config); void toBuffers(std::vector& buffers) override; [[nodiscard]] std::uint32_t typeId() const override { return m_typeId; } [[nodiscard]] std::uint32_t transactionId() const override { return m_transactionId; } [[nodiscard]] std::uint32_t msgSize() const { return m_msgSize; } [[nodiscard]] std::span data() { return m_message.data; } [[nodiscard]] Message& getMessage() { return m_message; } private: std::uint32_t m_typeId{}; std::uint32_t m_transactionId{}; std::uint32_t m_msgSize{}; Message m_message; }; } // namespace netio3::asyncmsg #endif // NETIO3BACKEND_BACKENDASYNCMSG_RECEIVEMESSAGE_HPP