Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
IPListener Class Referenceabstract

Contains the common part of TCP and UDP Receiver. This class manage the io_service thread, and the onNewDataReceived method. In both cases (UDP or TCP), we do the same thing when new data are received : More...

#include <ip_listener.h>

Inheritance diagram for IPListener:
Inheritance graph
[legend]

Public Member Functions

 IPListener (const std::string &ip, uint16_t port)
 
void onNewDataReceived (const boost::system::error_code &error, std::size_t bytes_transfered)
 
virtual ~IPListener ()
 

Protected Member Functions

virtual void listenNextData (void)=0
 

Protected Attributes

std::thread asioThread
 
boost::array< uint8_t, 8192 > datas
 
const std::string ip
 
ixblue_stdbin_decoder::StdBinDecoder parser
 
const uint16_t port
 
ROSPublisher rosPublisher
 
boost::asio::io_service service
 

Private Member Functions

 IPListener ()=delete
 

Detailed Description

Contains the common part of TCP and UDP Receiver. This class manage the io_service thread, and the onNewDataReceived method. In both cases (UDP or TCP), we do the same thing when new data are received :

Definition at line 22 of file ip_listener.h.

Constructor & Destructor Documentation

IPListener::IPListener ( )
privatedelete
IPListener::IPListener ( const std::string &  ip,
uint16_t  port 
)

Definition at line 6 of file ip_listener.cpp.

IPListener::~IPListener ( )
virtual

Definition at line 8 of file ip_listener.cpp.

Member Function Documentation

virtual void IPListener::listenNextData ( void  )
protectedpure virtual

This is the pro-actor pattern implemented by boost asio. Each daughter class must use this abstract method to listen next data.

Implemented in UDPListener.

void IPListener::onNewDataReceived ( const boost::system::error_code &  error,
std::size_t  bytes_transfered 
)

Definition at line 14 of file ip_listener.cpp.

Member Data Documentation

std::thread IPListener::asioThread
protected

Definition at line 46 of file ip_listener.h.

boost::array<uint8_t, 8192> IPListener::datas
protected

Definition at line 44 of file ip_listener.h.

const std::string IPListener::ip
protected

Definition at line 39 of file ip_listener.h.

ixblue_stdbin_decoder::StdBinDecoder IPListener::parser
protected

Definition at line 42 of file ip_listener.h.

const uint16_t IPListener::port
protected

Definition at line 40 of file ip_listener.h.

ROSPublisher IPListener::rosPublisher
protected

Definition at line 47 of file ip_listener.h.

boost::asio::io_service IPListener::service
protected

Definition at line 45 of file ip_listener.h.


The documentation for this class was generated from the following files:


ixblue_ins_driver
Author(s): Adrien BARRAL , Laure LE BRETON
autogenerated on Wed Jan 27 2021 03:37:01