Program Listing for File SendMessage.hpp

Return to documentation for file (BackendAsyncmsg/SendMessage.hpp)

#ifndef NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGE_HPP
#define NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGE_HPP

#include <cstdint>
#include <vector>

#include <boost/asio/buffer.hpp>

#include <asyncmsg/Message.h>

namespace netio3::asyncmsg {
  class SendMessage : public felix::asyncmsg::OutputMessage
  {
  public:
    void toBuffers(std::vector<boost::asio::const_buffer>& buffers) const override = 0;

    [[nodiscard]] std::uint32_t typeId() const override { return TYPE_ID; }

    [[nodiscard]] std::uint32_t transactionId() const override { return TRANSACTION_ID; }

    [[nodiscard]] virtual std::uint64_t key() const = 0;

  private:
    constexpr static std::uint32_t TYPE_ID{0};
    constexpr static std::uint32_t TRANSACTION_ID{0};
  };
}  // namespace netio3::asyncmsg

#endif  // NETIO3BACKEND_BACKENDASYNCMSG_SENDMESSAGE_HPP