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::SMRequestorRaw Class Reference

#include <smRequestorRaw.hpp>

Public Member Functions

 SMRequestorRaw (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 ~SMRequestorRaw ()
 
size_t Send (const std::string &payload_type, const std::string &payload, const long timeout=0)
 
void ReplyHandler (const std::error_code &err_code, const std::string &msg_type_id, const void *data, const size_t data_size)
 
const std::string & GetReplyPayloadType ()
 
const std::string & GetReplyPayload ()
 
 SMRequestorRaw (const SMRequestorRaw &)=delete
 
SMRequestorRawoperator= (const SMRequestorRaw &)=delete
 
 SMRequestorRaw (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 ~SMRequestorRaw ()
 
size_t Send (const std::string &payload_type, const std::string &payload, const long timeout=0)
 
void ReplyHandler (const std::error_code &err_code, const std::string &msg_type_id, const void *data, const size_t data_size)
 
const std::string & GetReplyPayloadType ()
 
const std::string & GetReplyPayload ()
 
 SMRequestorRaw (const SMRequestorRaw &)=delete
 
SMRequestorRawoperator= (const SMRequestorRaw &)=delete
 

Detailed Description

This class allows to send a request and receive a reply asynchronously. Upon reception of the reply an event OK or ERR event is injected in the SM engine.

Constructor & Destructor Documentation

rad::SMRequestorRaw::SMRequestorRaw ( 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 SMRequestorRaw 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.
rad::SMRequestorRaw::~SMRequestorRaw ( )
virtual

Destructor for the SMRequestorRaw class.

rad::SMRequestorRaw::SMRequestorRaw ( const SMRequestorRaw )
delete
rad::SMRequestorRaw::SMRequestorRaw ( 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 rad::SMRequestorRaw::~SMRequestorRaw ( )
virtual
rad::SMRequestorRaw::SMRequestorRaw ( const SMRequestorRaw )
delete

Member Function Documentation

const std::string & rad::SMRequestorRaw::GetReplyPayload ( )
Returns
The reply payload.
const std::string& rad::SMRequestorRaw::GetReplyPayload ( )
const std::string & rad::SMRequestorRaw::GetReplyPayloadType ( )
Returns
The reply payload type.
const std::string& rad::SMRequestorRaw::GetReplyPayloadType ( )
SMRequestorRaw& rad::SMRequestorRaw::operator= ( const SMRequestorRaw )
delete
SMRequestorRaw& rad::SMRequestorRaw::operator= ( const SMRequestorRaw )
delete
void rad::SMRequestorRaw::ReplyHandler ( const std::error_code &  err_code,
const std::string &  msg_type_id,
const void *  data,
const size_t  data_size 
)
void rad::SMRequestorRaw::ReplyHandler ( const std::error_code &  err_code,
const std::string &  msg_type_id,
const void *  data,
const size_t  data_size 
)

Handler for raw replies. It is invoked when a reply is received.

Parameters
[in]err_codeError code.
[in]msg_type_idType of the reply's payload.
[in]dataPointer to the reply's payload.
[in]data_sizeSize in bytes of the reply's payload.
size_t rad::SMRequestorRaw::Send ( const std::string &  payload_type,
const std::string &  payload,
const long  timeout = 0 
)

Send a raw request to an endpoint.

Parameters
[in]payload_typeType of the payload to send.
[in]payloadPayload to send.
[in]timeoutTimeout in msec.
Returns
The size in bytes of the request sent, 0 in case of errors.
size_t rad::SMRequestorRaw::Send ( const std::string &  payload_type,
const std::string &  payload,
const long  timeout = 0 
)

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