rad 6.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rad::SMRequestor< TYPEREQ, TYPEREP > Class Template Reference

#include <smRequestor.hpp>

Public Member Functions

 SMRequestor (const std::string &endpoint, const std::string &identity, boost::asio::io_context &ios, SMAdapter &sm, UniqueEvent &&ok_event, UniqueEvent &&err_event, UniqueEvent &&timeout_event)
 
virtual ~SMRequestor ()
 
size_t Send (const TYPEREQ &payload, const long timeout=0)
 
const TYPEREP & GetReplyPayload ()
 
 SMRequestor (const SMRequestor &)=delete
 
SMRequestoroperator= (const SMRequestor &)=delete
 

Detailed Description

template<typename TYPEREQ, typename TYPEREP>
class rad::SMRequestor< TYPEREQ, TYPEREP >

This class allows to send requests and, when a reply is received to trigger one of the following events:

Constructor & Destructor Documentation

◆ SMRequestor() [1/2]

template<typename TYPEREQ , typename TYPEREP >
rad::SMRequestor< TYPEREQ, TYPEREP >::SMRequestor ( const std::string & endpoint,
const std::string & identity,
boost::asio::io_context & ios,
SMAdapter & sm,
UniqueEvent && ok_event,
UniqueEvent && err_event,
UniqueEvent && timeout_event )

Constructor for the SMRequestor class.

Parameters
[in]endpointWhere to send the request.
[in]identityIdentity of the request (used by ZMQ to associated the reply).
[in]iosReference to the event loop.
[in]smSM Adapter used to trigger events.
[in]ok_eventOK event associated to an OK reply.
[in]err_eventERR event associated to an Error reply.
[in]timeout_eventTimeout event associated to a missing reply.

◆ ~SMRequestor()

template<typename TYPEREQ , typename TYPEREP >
rad::SMRequestor< TYPEREQ, TYPEREP >::~SMRequestor ( )
virtual

Denstructor for the SMRequestor class.

◆ SMRequestor() [2/2]

template<typename TYPEREQ , typename TYPEREP >
rad::SMRequestor< TYPEREQ, TYPEREP >::SMRequestor ( const SMRequestor< TYPEREQ, TYPEREP > & )
delete

Member Function Documentation

◆ GetReplyPayload()

template<typename TYPEREQ , typename TYPEREP >
const TYPEREP & rad::SMRequestor< TYPEREQ, TYPEREP >::GetReplyPayload ( )
Returns
the payload associated to the reply.

◆ operator=()

template<typename TYPEREQ , typename TYPEREP >
SMRequestor & rad::SMRequestor< TYPEREQ, TYPEREP >::operator= ( const SMRequestor< TYPEREQ, TYPEREP > & )
delete

◆ Send()

template<typename TYPEREQ , typename TYPEREP >
size_t rad::SMRequestor< TYPEREQ, TYPEREP >::Send ( const TYPEREQ & payload,
const long timeout = 0 )

Send a request message to an destination process.

Parameters
payloadRequest's payload.
timeoutTimeout in msec.
Returns
The number of bytes sent.

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