My Project
Public Member Functions | List of all members
IUdpCommunication Class Referenceabstract

Interface representing UdpCommunication. More...

#include <IUdpCommunication.hpp>

Inheritance diagram for IUdpCommunication:
UdpCommunication

Public Member Functions

virtual ~IUdpCommunication ()=default
 Destroy the IUdpCommunication object.
 
virtual void send (std::vector< byte > const &data)=0
 A method to send a message to the already known ip adress and port adress. More...
 
virtual void send (std::vector< byte > const &data, asio::ip::address const &address, unsigned short const &port)=0
 A method to send a message to an ip adress and port adress. More...
 
virtual void async_send (std::vector< byte > const &data, std::function< void(std::error_code const &, std::size_t)> callBack)=0
 A method to send a message to an already known ip adress and port adress in an async way. More...
 
virtual void async_send (std::vector< byte > const &data, std::function< void(std::error_code const &, std::size_t)> callBack, asio::ip::address const &address, unsigned short const &port)=0
 A method to send a message to a ip adress and port adress in an async way. More...
 
virtual std::pair< asio::ip::address, unsigned short > receive (std::vector< byte > &data)=0
 A method to receive a message. More...
 
virtual void async_receive (std::vector< byte > &data, std::function< void(std::error_code const &, std::size_t)> callBack)=0
 A method to receive a message in an async way. More...
 
virtual std::pair< asio::ip::address, unsigned short > getEnpointInfo () const =0
 Get the Enpoint Info object. More...
 
virtual void setEnpointInfo (std::pair< asio::ip::address, unsigned short > const &endpointInfo)=0
 Set the Enpoint Info object. More...
 
virtual void setEnpointInfo (asio::ip::address const &address, unsigned short const &port)=0
 Set the Enpoint Info object. More...
 

Detailed Description

Interface representing UdpCommunication.

Member Function Documentation

◆ async_receive()

virtual void IUdpCommunication::async_receive ( std::vector< byte > &  data,
std::function< void(std::error_code const &, std::size_t)>  callBack 
)
pure virtual

A method to receive a message in an async way.

Parameters
dataThe buffer to fill when the message is received
callBackThe function called once the message is received

Implemented in UdpCommunication.

◆ async_send() [1/2]

virtual void IUdpCommunication::async_send ( std::vector< byte > const &  data,
std::function< void(std::error_code const &, std::size_t)>  callBack 
)
pure virtual

A method to send a message to an already known ip adress and port adress in an async way.

Parameters
dataThe serilized
callBackThe function to call once the message is sent

Implemented in UdpCommunication.

◆ async_send() [2/2]

virtual void IUdpCommunication::async_send ( std::vector< byte > const &  data,
std::function< void(std::error_code const &, std::size_t)>  callBack,
asio::ip::address const &  address,
unsigned short const &  port 
)
pure virtual

A method to send a message to a ip adress and port adress in an async way.

Parameters
dataThe serialized message
callBackThe function called once the message is sent
addressThe ip adress to send the message
portThe port adress to send the message

Implemented in UdpCommunication.

◆ getEnpointInfo()

virtual std::pair<asio::ip::address, unsigned short> IUdpCommunication::getEnpointInfo ( ) const
pure virtual

Get the Enpoint Info object.

Returns
std::pair<asio::ip::address, unsigned short> Pair with the ip address and the port of the endpoint

Implemented in UdpCommunication.

◆ receive()

virtual std::pair<asio::ip::address, unsigned short> IUdpCommunication::receive ( std::vector< byte > &  data)
pure virtual

A method to receive a message.

Parameters
dataThe buffer to fill when the message is received
Returns
std::pair<asio::ip::address, unsigned short> The ip adress and the port adress where the message came from

Implemented in UdpCommunication.

◆ send() [1/2]

virtual void IUdpCommunication::send ( std::vector< byte > const &  data)
pure virtual

A method to send a message to the already known ip adress and port adress.

Parameters
dataThe serialized message

Implemented in UdpCommunication.

◆ send() [2/2]

virtual void IUdpCommunication::send ( std::vector< byte > const &  data,
asio::ip::address const &  address,
unsigned short const &  port 
)
pure virtual

A method to send a message to an ip adress and port adress.

Parameters
dataThe serialized message
addressThe ip adress to send the message
portThe port adress to send the message

Implemented in UdpCommunication.

◆ setEnpointInfo() [1/2]

virtual void IUdpCommunication::setEnpointInfo ( asio::ip::address const &  address,
unsigned short const &  port 
)
pure virtual

Set the Enpoint Info object.

Parameters
addressIp address of the endpoint
portPort of the endpoint

Implemented in UdpCommunication.

◆ setEnpointInfo() [2/2]

virtual void IUdpCommunication::setEnpointInfo ( std::pair< asio::ip::address, unsigned short > const &  endpointInfo)
pure virtual

Set the Enpoint Info object.

Parameters
endpointInfoPair with the ip address and the port of the endpoint

Implemented in UdpCommunication.


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