Public Member Functions | Private Member Functions | Private Attributes | List of all members
UdpSocket Class Reference

#include <udp_socket.h>

Inheritance diagram for UdpSocket:
Inheritance graph
[legend]

Public Member Functions

 INJECT (UdpSocket(ASSISTED(udp::endpoint) target_socket, callback))
 
virtual unsigned short Port () override
 
virtual void SendData (std::vector< uint8_t > vec) override
 
virtual void Start () override
 
virtual void Stop () override
 
 UdpSocket ()=delete
 
 ~UdpSocket ()
 
- Public Member Functions inherited from Socket
virtual ~Socket ()=default
 

Private Member Functions

void send_handler (const boost::system::error_code &error, std::size_t len)
 

Private Attributes

std::shared_ptr< std::function< void(std::vector< uint8_t >)> > callback_
 
bool is_running_ = false
 
udp::endpoint local_endpoint_ {}
 
std::unique_ptr< std::thread > recv_thread_ {nullptr}
 
std::unique_ptr< boost::asio::io_service > send_io_service_
 
std::unique_ptr< udp::socket > send_socket_
 
udp::endpoint target_socket_
 

Detailed Description

Definition at line 23 of file udp_socket.h.

Constructor & Destructor Documentation

◆ UdpSocket()

UdpSocket::UdpSocket ( )
delete

Definition at line 7 of file udp_socket.cpp.

◆ ~UdpSocket()

UdpSocket::~UdpSocket ( )

Definition at line 15 of file udp_socket.cpp.

Member Function Documentation

◆ INJECT()

UdpSocket::INJECT ( UdpSocket(ASSISTED(udp::endpoint) target_socket, callback)  )

◆ Port()

unsigned short UdpSocket::Port ( )
overridevirtual

Reimplemented from Socket.

Definition at line 62 of file udp_socket.cpp.

◆ send_handler()

void UdpSocket::send_handler ( const boost::system::error_code &  error,
std::size_t  len 
)
private

Definition at line 64 of file udp_socket.cpp.

◆ SendData()

void UdpSocket::SendData ( std::vector< uint8_t >  vec)
overridevirtual

Reimplemented from Socket.

Definition at line 71 of file udp_socket.cpp.

◆ Start()

void UdpSocket::Start ( )
overridevirtual

Reimplemented from Socket.

Definition at line 21 of file udp_socket.cpp.

◆ Stop()

void UdpSocket::Stop ( )
overridevirtual

Reimplemented from Socket.

Definition at line 55 of file udp_socket.cpp.

Member Data Documentation

◆ callback_

std::shared_ptr<std::function<void(std::vector<uint8_t>)> > UdpSocket::callback_
private

Definition at line 46 of file udp_socket.h.

◆ is_running_

bool UdpSocket::is_running_ = false
private

Definition at line 40 of file udp_socket.h.

◆ local_endpoint_

udp::endpoint UdpSocket::local_endpoint_ {}
private

Definition at line 50 of file udp_socket.h.

◆ recv_thread_

std::unique_ptr<std::thread> UdpSocket::recv_thread_ {nullptr}
private

Definition at line 44 of file udp_socket.h.

◆ send_io_service_

std::unique_ptr<boost::asio::io_service> UdpSocket::send_io_service_
private
Initial value:
{
new boost::asio::io_service()}

Definition at line 55 of file udp_socket.h.

◆ send_socket_

std::unique_ptr<udp::socket> UdpSocket::send_socket_
private
Initial value:
{
std::make_unique<udp::socket>(*send_io_service_.get())}

Definition at line 57 of file udp_socket.h.

◆ target_socket_

udp::endpoint UdpSocket::target_socket_
private

Definition at line 61 of file udp_socket.h.


The documentation for this class was generated from the following files:
UdpSocket::send_io_service_
std::unique_ptr< boost::asio::io_service > send_io_service_
Definition: udp_socket.h:55


skyway
Author(s): Toshiya Nakakura
autogenerated on Thu Oct 26 2023 02:42:21