|
Diag-Client-Lib
|
Immutable class to store received tcp message. More...
#include <tcp_message.h>
Public Types | |
| enum class | SocketState : std::uint8_t { kIdle = 0x00 , kSocketOnline , kSocketOffline , kSocketRxMessageReceived , kSocketTxMessageSend , kSocketTxMessageConf , kSocketError } |
| Definition of different socket state. More... | |
| enum class | SocketError : std::uint8_t { kNone = 0x00 } |
| Definition of different socket error that could occur. More... | |
| using | BufferType = std::vector< std::uint8_t > |
| Type alias for underlying buffer. More... | |
| using | IpAddressType = std::string_view |
| Type alias of IP address type. More... | |
Public Member Functions | |
| TcpMessage (IpAddressType host_ip_address, std::uint16_t host_port_number, BufferType payload) | |
| Constructs an instance of TcpMessage. More... | |
| TcpMessage (TcpMessage &&other) noexcept=default | |
| TcpMessage & | operator= (TcpMessage &&other) noexcept=default |
| TcpMessage (const TcpMessage &other)=default | |
| TcpMessage & | operator= (const TcpMessage &other)=default |
| ~TcpMessage ()=default | |
| Destructs an instance of TcpMessage. More... | |
| IpAddressType | GetHostIpAddress () const |
| Get the host ip address. More... | |
| std::uint16_t | GetHostPortNumber () const |
| Get the host port number. More... | |
| core_type::Span< std::uint8_t const > | GetPayload () const |
| Get the readable view on received payload. More... | |
| SocketState | GetSocketState () const |
| Get the state of underlying socket. More... | |
| SocketError | GetSocketError () const |
| Get the error of underlying socket. More... | |
Private Attributes | |
| SocketState | socket_state_ |
| Store the socket state. More... | |
| SocketError | socket_error_ |
| Store the socket error. More... | |
| BufferType | payload_ |
| The reception buffer. More... | |
| std::string | host_ip_address_ |
| Store remote ip address. More... | |
| std::uint16_t | host_port_number_ |
| Store remote port number. More... | |
Immutable class to store received tcp message.
Definition at line 26 of file tcp_message.h.
| using boost_support::message::tcp::TcpMessage::BufferType = std::vector<std::uint8_t> |
Type alias for underlying buffer.
Definition at line 49 of file tcp_message.h.
| using boost_support::message::tcp::TcpMessage::IpAddressType = std::string_view |
Type alias of IP address type.
Definition at line 54 of file tcp_message.h.
|
strong |
Definition of different socket error that could occur.
| Enumerator | |
|---|---|
| kNone | |
Definition at line 44 of file tcp_message.h.
|
strong |
Definition of different socket state.
| Enumerator | |
|---|---|
| kIdle | |
| kSocketOnline | |
| kSocketOffline | |
| kSocketRxMessageReceived | |
| kSocketTxMessageSend | |
| kSocketTxMessageConf | |
| kSocketError | |
Definition at line 31 of file tcp_message.h.
|
inline |
Constructs an instance of TcpMessage.
| [in] | host_ip_address | The host ip address |
| [in] | host_port_number | The host port number |
| [in] | payload | The received data payload |
Definition at line 66 of file tcp_message.h.
|
defaultnoexcept |
|
default |
|
default |
Destructs an instance of TcpMessage.
|
inline |
Get the host ip address.
Definition at line 88 of file tcp_message.h.
References host_ip_address_.
|
inline |
Get the host port number.
Definition at line 94 of file tcp_message.h.
References host_port_number_.
|
inline |
Get the readable view on received payload.
Definition at line 100 of file tcp_message.h.
References payload_.
|
inline |
Get the error of underlying socket.
Definition at line 114 of file tcp_message.h.
References socket_error_.
|
inline |
Get the state of underlying socket.
Definition at line 108 of file tcp_message.h.
References socket_state_.
|
default |
|
defaultnoexcept |
|
private |
Store remote ip address.
Definition at line 135 of file tcp_message.h.
Referenced by GetHostIpAddress().
|
private |
Store remote port number.
Definition at line 140 of file tcp_message.h.
Referenced by GetHostPortNumber().
|
private |
|
private |
Store the socket error.
Definition at line 125 of file tcp_message.h.
Referenced by GetSocketError().
|
private |
Store the socket state.
Definition at line 120 of file tcp_message.h.
Referenced by GetSocketState().