Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::cg::CommunicationGroupServer< T, R > Class Template Reference

Communication group server skeleton. More...

#include <communication_group_server.h>

Public Member Functions

 CommunicationGroupServer (ResponseHandler< R > responseHandler)
 Constructor. More...
 
std::future< void > Broadcast (const T &msg) const
 Broadcast a request message to all the clients. More...
 
std::future< void > Message (uint32_t clientID, const T &msg) const
 Send a request message to a specific client. More...
 
void Response (uint32_t clientID, const R &responseMsg)
 Receive a response message from a client. More...
 
std::future< std::vector< uint32_t > > ListClients () const
 List all the subscribed clients. More...
 

Detailed Description

template<typename T, typename R>
class ara::com::cg::CommunicationGroupServer< T, R >

Communication group server skeleton.

Template Parameters
TRequest message type
RResponse message type

Constructor & Destructor Documentation

◆ CommunicationGroupServer()

template<typename T , typename R >
ara::com::cg::CommunicationGroupServer< T, R >::CommunicationGroupServer ( ResponseHandler< R >  responseHandler)
inlineexplicit

Constructor.

Parameters
responseHandlerOn response message received handler

Member Function Documentation

◆ Broadcast()

template<typename T , typename R >
std::future< void > ara::com::cg::CommunicationGroupServer< T, R >::Broadcast ( const T &  msg) const

Broadcast a request message to all the clients.

Parameters
msgRequest message to be broadcasted
Returns
Fire and forget future

◆ ListClients()

template<typename T , typename R >
std::future< std::vector< uint32_t > > ara::com::cg::CommunicationGroupServer< T, R >::ListClients ( ) const

List all the subscribed clients.

Returns
Subscribed clients list future

◆ Message()

template<typename T , typename R >
std::future< void > ara::com::cg::CommunicationGroupServer< T, R >::Message ( uint32_t  clientID,
const T &  msg 
) const

Send a request message to a specific client.

Parameters
clientIDCommunication group client ID
msgRequest message to be sent
Returns
Fire and forget future

◆ Response()

template<typename T , typename R >
void ara::com::cg::CommunicationGroupServer< T, R >::Response ( uint32_t  clientID,
const R &  responseMsg 
)
inline

Receive a response message from a client.

Parameters
clientIDCommunication group client ID
responseMsgReceived response message