rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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_service &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
 
 SMRequestor (const std::string &endpoint, const std::string &identity, boost::asio::io_service &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

template<typename TYPEREQ , typename TYPEREP >
rad::SMRequestor< TYPEREQ, TYPEREP >::SMRequestor ( const std::string &  endpoint,
const std::string &  identity,
boost::asio::io_service &  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.
template<typename TYPEREQ , typename TYPEREP >
rad::SMRequestor< TYPEREQ, TYPEREP >::~SMRequestor ( )
virtual

Denstructor for the SMRequestor class.

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

Member Function Documentation

template<typename TYPEREQ , typename TYPEREP >
const TYPEREP & rad::SMRequestor< TYPEREQ, TYPEREP >::GetReplyPayload ( )
Returns
the payload associated to the reply.
template<typename TYPEREQ, typename TYPEREP>
const TYPEREP& rad::SMRequestor< TYPEREQ, TYPEREP >::GetReplyPayload ( )
template<typename TYPEREQ, typename TYPEREP>
SMRequestor& rad::SMRequestor< TYPEREQ, TYPEREP >::operator= ( const SMRequestor< TYPEREQ, TYPEREP > &  )
delete
template<typename TYPEREQ, typename TYPEREP>
SMRequestor& rad::SMRequestor< TYPEREQ, TYPEREP >::operator= ( const SMRequestor< TYPEREQ, TYPEREP > &  )
delete
template<typename TYPEREQ, typename TYPEREP>
size_t rad::SMRequestor< TYPEREQ, TYPEREP >::Send ( const TYPEREQ &  payload,
const long  timeout = 0 
)
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 files: