JSON-RPC 2.0
JSON-RPC 2.0 Modern C++ Library
Loading...
Searching...
No Matches
transport.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5namespace jsonrpc::transport {
6
12class Transport {
13 public:
14 Transport() = default;
15 virtual ~Transport() = default;
16
17 Transport(const Transport &) = default;
18 auto operator=(const Transport &) -> Transport & = default;
19
20 Transport(Transport &&) = delete;
21 auto operator=(Transport &&) -> Transport & = delete;
22
27 virtual void SendMessage(const std::string &message) = 0;
28
33 virtual auto ReceiveMessage() -> std::string = 0;
34};
35
36} // namespace jsonrpc::transport
Base class for JSON-RPC transport.
Definition transport.hpp:12
virtual auto ReceiveMessage() -> std::string=0
Receives a message from the transport layer.
virtual ~Transport()=default
auto operator=(const Transport &) -> Transport &=default
Transport(const Transport &)=default
Transport(Transport &&)=delete
auto operator=(Transport &&) -> Transport &=delete
virtual void SendMessage(const std::string &message)=0
Sends a message in string to the transport layer.