MIRA
Public Member Functions | List of all members
BinaryRPCBackendTempl< BinaryFormatVersion >::ServerResponse Class Reference

Binary server-side response. More...

#include <rpc/BinaryRPCBackend.h>

Public Member Functions

 ServerResponse (ContainerType *buffer)
 
void setHeader (const std::string &callId)
 Write the response header consisting of the ID of the call. More...
 
void returnException (RPCError reason, const std::string &message)
 Write exception as result of an RPC call. More...
 
void returnException (RPCError reason, const std::string &message, const CallStack &callstack)
 Write exception as result of an RPC call. More...
 
void returnException (RPCError reason, SerializableException &ex)
 Write exception as result of an RPC call. More...
 
template<typename R >
void returnResult (const R &res)
 Write result of an RPC call. More...
 
void returnVoid ()
 Write successful end of an RPC call. More...
 

Detailed Description

template<uint8 BinaryFormatVersion>
class mira::BinaryRPCBackendTempl< BinaryFormatVersion >::ServerResponse

Binary server-side response.

The response is written to the buffer that is passed in the constructor.

See also
Backends

Constructor & Destructor Documentation

◆ ServerResponse()

ServerResponse ( ContainerType buffer)
inline

Member Function Documentation

◆ setHeader()

void setHeader ( const std::string &  callId)
inline

Write the response header consisting of the ID of the call.

This method is called first by the RPCServer to create a response for a finished RPC call. It will be followed by a call of either returnException(), returnResult() or returnVoid().

◆ returnException() [1/3]

void returnException ( RPCError  reason,
const std::string &  message 
)
inline

Write exception as result of an RPC call.

This method is called after setHeader() in case of an error or exception while processing the call.

◆ returnException() [2/3]

void returnException ( RPCError  reason,
const std::string &  message,
const CallStack callstack 
)
inline

Write exception as result of an RPC call.

This method is called after setHeader() in case of an error or exception while processing the call.

◆ returnException() [3/3]

void returnException ( RPCError  reason,
SerializableException ex 
)
inline

Write exception as result of an RPC call.

This method is called after setHeader() in case of an error or exception while processing the call.

◆ returnResult()

void returnResult ( const R &  res)
inline

Write result of an RPC call.

This method is called after setHeader() in case of a successful RPC call that returns a value.

◆ returnVoid()

void returnVoid ( )
inline

Write successful end of an RPC call.

This method is called after setHeader() in case of a successful RPC call that does NOT return a value.


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