|
unilink
0.4.3
A simple C++ library for unified async communication
|
Common interface for 1:1 point-to-point communication (e.g., TcpClient, Serial, Udp) More...
#include <ichannel.hpp>
Public Types | |
| using | MessageHandler = std::function< void(const MessageContext &)> |
| using | ConnectionHandler = std::function< void(const ConnectionContext &)> |
| using | ErrorHandler = std::function< void(const ErrorContext &)> |
Public Member Functions | |
| virtual | ~ChannelInterface ()=default |
| virtual std::future< bool > | start ()=0 |
| virtual void | stop ()=0 |
| virtual bool | is_connected () const =0 |
| virtual void | send (std::string_view data)=0 |
| virtual void | send_line (std::string_view line)=0 |
| virtual ChannelInterface & | on_data (MessageHandler handler)=0 |
| virtual ChannelInterface & | on_connect (ConnectionHandler handler)=0 |
| virtual ChannelInterface & | on_disconnect (ConnectionHandler handler)=0 |
| virtual ChannelInterface & | on_error (ErrorHandler handler)=0 |
| virtual ChannelInterface & | auto_manage (bool manage=true)=0 |
Common interface for 1:1 point-to-point communication (e.g., TcpClient, Serial, Udp)
Definition at line 34 of file ichannel.hpp.
| using unilink::wrapper::ChannelInterface::ConnectionHandler = std::function<void(const ConnectionContext&)> |
Definition at line 37 of file ichannel.hpp.
| using unilink::wrapper::ChannelInterface::ErrorHandler = std::function<void(const ErrorContext&)> |
Definition at line 38 of file ichannel.hpp.
| using unilink::wrapper::ChannelInterface::MessageHandler = std::function<void(const MessageContext&)> |
Definition at line 36 of file ichannel.hpp.
|
virtualdefault |
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.
|
pure virtual |
Implemented in unilink::wrapper::Udp, unilink::wrapper::TcpClient, and unilink::wrapper::Serial.