rad 6.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rad::cii::Request< REP_TYPE, REQ_TYPE > Class Template Reference

#include <request.hpp>

Public Member Functions

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

Default assignment operators.

Requestoperator= (const Request &)=default
 
Requestoperator= (Request &&) noexcept(std::is_nothrow_move_assignable_v< REQ_TYPE >)=default
 
const REQ_TYPE & 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
 
template<class T >
void SetException (const T &e) const
 

Detailed Description

template<typename REP_TYPE, typename REQ_TYPE = void>
class rad::cii::Request< REP_TYPE, REQ_TYPE >

This class contains a copy of the payload of a MAL request and allows to send a MAL reply.

Template Parameters
REP_TYPEType of the reply's payload.
REQ_TYPEType of the request's payload (default is 'void').

Constructor & Destructor Documentation

◆ Request() [1/3]

template<typename REP_TYPE , typename REQ_TYPE = void>
rad::cii::Request< REP_TYPE, REQ_TYPE >::Request ( const REQ_TYPE & 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() [2/3]

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

◆ Request() [3/3]

template<typename REP_TYPE , typename REQ_TYPE = void>
rad::cii::Request< REP_TYPE, REQ_TYPE >::Request ( Request< REP_TYPE, REQ_TYPE > && ) const
defaultnoexcept

Member Function Documentation

◆ GetReplyFuture()

template<typename REP_TYPE , typename REQ_TYPE = void>
elt::mal::future< REP_TYPE > rad::cii::Request< REP_TYPE, REQ_TYPE >::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.

◆ GetReplyPromise()

template<typename REP_TYPE , typename REQ_TYPE = void>
std::shared_ptr< elt::mal::promise< REP_TYPE > > rad::cii::Request< REP_TYPE, REQ_TYPE >::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()

template<typename REP_TYPE , typename REQ_TYPE = void>
const REQ_TYPE & rad::cii::Request< REP_TYPE, REQ_TYPE >::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/2]

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

◆ operator=() [2/2]

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

◆ SetException()

template<typename REP_TYPE , typename REQ_TYPE = void>
template<class T >
void rad::cii::Request< REP_TYPE, REQ_TYPE >::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.

◆ SetReplyValue()

template<typename REP_TYPE , typename REQ_TYPE = void>
void rad::cii::Request< REP_TYPE, REQ_TYPE >::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: