Skip to content

AsyncReply

class AsyncReply

A functor to place an asynchronous reply during slot execution.

  • Create only inside a slot call of a SignalSlotable
  • Can be copied around as wished
  • Call either the operator or the error(..) method exactly once for one of the copies.
  • Call these methods from another context/thread, i.e. between creation and use of its methods you have to leave the thread at least once)
  • Must not be used once the SignalSlotable object that created it is (being) destructed (e.g. protect by bind_weak to member functions of the SignalSlotable)

Operators

Name Description
operator() Place the reply - almost like using SignalSlotable::reply in the synchronous case. The difference is that here the reply is immediately sent and cannot be overwritten by a following call. args : 0-4 objects of the types known to serialisation, e.g. float, vector, Hash,...

Functions

Name Description
AsyncReply Construct functor for an asynchronous reply.
error If a proper reply cannot be placed, please use this to reply an error message : is the short text for the RemoteException details : further details, usually an exception trace (e.g. data::Exception::detailedMsg()), default is empty for backward compatibility reasons

Operator Details

operator()

template <typename... Args> void operator()(const Args&... args) const

Place the reply - almost like using SignalSlotable::reply in the synchronous case. The difference is that here the reply is immediately sent and cannot be overwritten by a following call.

args : 0-4 objects of the types known to serialisation, e.g. float, vector, Hash,...

Function Details

AsyncReply

explicit AsyncReply(SignalSlotable* signalSlotable)

Construct functor for an asynchronous reply. Create only within a slot call of a SignalSlotable

signalSlotable : pointer to the SignalSlotable whose slot is currently executed (usually: this)

error

void error(const std::string& message, const std::string& details = std::string()) const

If a proper reply cannot be placed, please use this to reply an error

message : is the short text for the RemoteException

details : further details, usually an exception trace (e.g. data::Exception::detailedMsg()), default is empty for backward compatibility reasons