rad 8.2.0
Loading...
Searching...
No Matches
rad::cii::Request< REP_TYPE, void > Class Template Reference

#include <request.hpp>

Public Member Functions

 Request ()
 
 Request (const void &req_payload)
 
Default copy constructor.
 Request (const Request &)=default
 
 Request (Request &&) noexcept=default
 
Default copy constructor.
 Request (const Request &)=default
 
 Request (Request &&) noexcept(std::is_nothrow_move_constructible< void >())=default
 

Default assignment operators.

Request & operator= (const Request &)=default
 
Request & operator= (Request &&) noexcept=default
 
elt::mal::future< REP_TYPE > GetReplyFuture () const
 
std::shared_ptr< elt::mal::promise< REP_TYPE > > GetReplyPromise () const
 
void SetReplyValue (const REP_TYPE &reply) const
 
template<class T>
void SetException (const T &e) const
 

Default assignment operators.

Request & operator= (const Request &)=default
 
Request & operator= (Request &&) noexcept(std::is_nothrow_move_assignable_v< void >)=default
 
const void & GetRequestPayload () const
 
elt::mal::future< REP_TYPE > GetReplyFuture () const
 
std::shared_ptr< elt::mal::promise< REP_TYPE > > GetReplyPromise () const
 
void SetReplyValue (const REP_TYPE &reply) const
 
void SetException (const T &e) const
 

Detailed Description

template<class REP_TYPE>
class rad::cii::Request< REP_TYPE, void >

This class allows to send a MAL reply to a request WITHOUT payload.

Template Parameters
REP_TYPEType of the reply's payload.

Constructor & Destructor Documentation

◆ Request() [1/6]

template<class REP_TYPE>
rad::cii::Request< REP_TYPE, void >::Request ( )
inline

Default constructor that creates a promise associated to the MAL reply.

◆ Request() [2/6]

template<class REP_TYPE>
rad::cii::Request< REP_TYPE, void >::Request ( const Request< REP_TYPE, void > & )
default

◆ Request() [3/6]

template<class REP_TYPE>
rad::cii::Request< REP_TYPE, void >::Request ( Request< REP_TYPE, void > && )
defaultnoexcept

◆ Request() [4/6]

rad::cii::Request< REP_TYPE, void >::Request ( const void & req_payload)
inlineexplicit

This constructor copies the payload associated to a MAL request and creates a promise for the MAL reply.

Parameters
req_payloadPayload associated to the MAL request.
Template Parameters
REQ_TYPEType of the payload associated to the MAL request.

◆ Request() [5/6]

rad::cii::Request< REP_TYPE, void >::Request ( const Request< REP_TYPE, void > & )
default

◆ Request() [6/6]

rad::cii::Request< REP_TYPE, void >::Request ( Request< REP_TYPE, void > && )
defaultnoexcept

Member Function Documentation

◆ GetReplyFuture() [1/2]

elt::mal::future< REP_TYPE > rad::cii::Request< REP_TYPE, void >::GetReplyFuture ( ) const
inline

This method can be used to get the 'future' indicating when a reply is ready to be sent.

Returns
The future associated to the reply.

◆ GetReplyFuture() [2/2]

template<class REP_TYPE>
elt::mal::future< REP_TYPE > rad::cii::Request< REP_TYPE, void >::GetReplyFuture ( ) const
inline

This method can be used to get the 'future' indicating when a reply is ready to be sent.

Returns
A future associated to the reply.

◆ GetReplyPromise() [1/2]

std::shared_ptr< elt::mal::promise< REP_TYPE > > rad::cii::Request< REP_TYPE, void >::GetReplyPromise ( ) const
inline

This method can be used to expose the promise that backs the 'future' indicating when a reply is ready to be sent.

In some scenario (see EICSSW-2560) the MAL reply promise is required to live beyond the life time of the Request object.

Returns
Shared pointer to the promise associated to the reply.

◆ GetReplyPromise() [2/2]

template<class REP_TYPE>
std::shared_ptr< elt::mal::promise< REP_TYPE > > rad::cii::Request< REP_TYPE, void >::GetReplyPromise ( ) const
inline

This method can be used to expose the promise that backs the 'future' indicating when a reply is ready to be sent.

In some scenario (see EICSSW-2560) the MAL reply promise is required to live beyond the life time of the Request object.

Returns
Shared pointer to the promise associated to the reply.

◆ GetRequestPayload()

const void & rad::cii::Request< REP_TYPE, void >::GetRequestPayload ( ) const
inline

This method can be used to retrieve the payload associated to the received MAL request.

Returns
The payload associated to the MAL request.

◆ operator=() [1/4]

Request & rad::cii::Request< REP_TYPE, void >::operator= ( const Request< REP_TYPE, void > & )
default

◆ operator=() [2/4]

template<class REP_TYPE>
Request & rad::cii::Request< REP_TYPE, void >::operator= ( const Request< REP_TYPE, void > & )
default

◆ operator=() [3/4]

Request & rad::cii::Request< REP_TYPE, void >::operator= ( Request< REP_TYPE, void > && )
defaultnoexcept

◆ operator=() [4/4]

template<class REP_TYPE>
Request & rad::cii::Request< REP_TYPE, void >::operator= ( Request< REP_TYPE, void > && )
defaultnoexcept

◆ SetException() [1/2]

void rad::cii::Request< REP_TYPE, void >::SetException ( const T & e) const
inline

This method allows to set an error reply.

Template Parameters
TType of exception, which as a precondition from MAL must derive from elt::mal::MalException.
Parameters
eException containing error description.

◆ SetException() [2/2]

template<class REP_TYPE>
template<class T>
void rad::cii::Request< REP_TYPE, void >::SetException ( const T & e) const
inline

This method allows to set the payload for an ERROR reply.

Template Parameters
TType of exception which should derive from elt::mal::MalException.
Parameters
eException containing error description.

◆ SetReplyValue() [1/2]

void rad::cii::Request< REP_TYPE, void >::SetReplyValue ( const REP_TYPE & reply) const
inline

This method allows to set the payload for the OK reply.

Parameters
replyPayload of the reply.

◆ SetReplyValue() [2/2]

template<class REP_TYPE>
void rad::cii::Request< REP_TYPE, void >::SetReplyValue ( const REP_TYPE & reply) const
inline

This method allows to set the payload for the OK reply.

Parameters
replyPayload of the reply.

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