| 
    Diag-Client-Lib
    
   | 
 
Handler class to manage different socket of various client (Udp / Tcp) More...
#include <socket_handler.h>
Public Types | |
| using | Client = ClientType | 
| Type alias for client.  More... | |
| using | Message = typename Client::Message | 
| Type alias for message.  More... | |
| using | MessagePtr = typename Client::MessagePtr | 
| Type alias for message pointer.  More... | |
| using | MessageConstPtr = typename Client::MessageConstPtr | 
| Type alias for message const pointer.  More... | |
| using | HandlerRead = std::function< void(MessagePtr)> | 
| Tcp function template used for reception.  More... | |
Public Member Functions | |
| SocketHandler (Client client) noexcept | |
| Constructs an instance of TcpSocketHandler.  More... | |
| SocketHandler (const SocketHandler &other) noexcept=delete | |
| Deleted copy assignment and copy constructor.  More... | |
| SocketHandler & | operator= (const SocketHandler &other) noexcept=delete | 
| SocketHandler (SocketHandler &&other) noexcept=default | |
| Move assignment and Move constructor.  More... | |
| SocketHandler & | operator= (SocketHandler &&other) noexcept=default | 
| ~SocketHandler ()=default | |
| Destruct an instance of TcpSocketHandler.  More... | |
| void | Initialize () noexcept | 
| Function to start the socket handler.  More... | |
| void | DeInitialize () noexcept | 
| Function to stop the socket handler.  More... | |
| void | SetReadHandler (HandlerRead read_handler) | 
| Function to set the read handler that is invoked when message is received.  More... | |
| core_type::Result< void > | ConnectToHost (std::string_view host_ip_address, std::uint16_t host_port_num) | 
| Function to connect to remote ip address and port number.  More... | |
| core_type::Result< void > | DisconnectFromHost () | 
| Function to disconnect from remote host if already connected.  More... | |
| auto | IsConnectedToHost () const noexcept -> bool | 
| Function to get the connection status.  More... | |
| core_type::Result< void > | Transmit (MessageConstPtr message) | 
| Function to transmit the provided message.  More... | |
Private Attributes | |
| Client | client_ | 
| Store the client object.  More... | |
Handler class to manage different socket of various client (Udp / Tcp)
Definition at line 24 of file socket_handler.h.
| using doip_client::sockets::SocketHandler< ClientType >::Client = ClientType | 
Type alias for client.
Definition at line 29 of file socket_handler.h.
| using doip_client::sockets::SocketHandler< ClientType >::HandlerRead = std::function<void(MessagePtr)> | 
Tcp function template used for reception.
Definition at line 49 of file socket_handler.h.
| using doip_client::sockets::SocketHandler< ClientType >::Message = typename Client::Message | 
Type alias for message.
Definition at line 34 of file socket_handler.h.
| using doip_client::sockets::SocketHandler< ClientType >::MessageConstPtr = typename Client::MessageConstPtr | 
Type alias for message const pointer.
Definition at line 44 of file socket_handler.h.
| using doip_client::sockets::SocketHandler< ClientType >::MessagePtr = typename Client::MessagePtr | 
Type alias for message pointer.
Definition at line 39 of file socket_handler.h.
      
  | 
  inlineexplicitnoexcept | 
Constructs an instance of TcpSocketHandler.
| [in] | socket | The socket used | 
Definition at line 56 of file socket_handler.h.
      
  | 
  deletenoexcept | 
Deleted copy assignment and copy constructor.
      
  | 
  defaultnoexcept | 
Move assignment and Move constructor.
      
  | 
  default | 
Destruct an instance of TcpSocketHandler.
      
  | 
  inline | 
Function to connect to remote ip address and port number.
| [in] | host_ip_address | The host ip address | 
| [in] | host_port_num | The host port number | 
Definition at line 101 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::ConnectToHost().

      
  | 
  inlinenoexcept | 
Function to stop the socket handler.
Definition at line 83 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::Stop(), and doip_client::channel::udp_channel::DoipUdpChannel::Stop().

      
  | 
  inline | 
Function to disconnect from remote host if already connected.
Definition at line 110 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::DisconnectFromHost().

      
  | 
  inlinenoexcept | 
Function to start the socket handler.
Definition at line 78 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::Start(), and doip_client::channel::udp_channel::DoipUdpChannel::Start().

      
  | 
  inlinenoexcept | 
Function to get the connection status.
Definition at line 116 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::IsConnectedToHost().

      
  | 
  deletenoexcept | 
      
  | 
  defaultnoexcept | 
      
  | 
  inline | 
Function to set the read handler that is invoked when message is received.
The ownership of provided read handler is moved
| [in] | read_handler | The handler to be set | 
Definition at line 91 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
Referenced by doip_client::channel::tcp_channel::DoipTcpChannel::Start(), and doip_client::channel::udp_channel::DoipUdpChannel::Start().

      
  | 
  inline | 
Function to transmit the provided message.
| [in] | message | The message to be sent | 
Definition at line 124 of file socket_handler.h.
References doip_client::sockets::SocketHandler< ClientType >::client_.
      
  | 
  private | 
Store the client object.
Definition at line 132 of file socket_handler.h.
Referenced by doip_client::sockets::SocketHandler< ClientType >::ConnectToHost(), doip_client::sockets::SocketHandler< ClientType >::DeInitialize(), doip_client::sockets::SocketHandler< ClientType >::DisconnectFromHost(), doip_client::sockets::SocketHandler< ClientType >::Initialize(), doip_client::sockets::SocketHandler< ClientType >::IsConnectedToHost(), doip_client::sockets::SocketHandler< ClientType >::SetReadHandler(), and doip_client::sockets::SocketHandler< ClientType >::Transmit().