packio
Public Member Functions | List of all members
packio::completion_handler< Rpc > Class Template Reference

The completion_handler class. More...

#include <packio/handler.h>

Public Member Functions

 ~completion_handler ()
 The destructor will notify an error if the completion_handler has not been used.
 
 completion_handler (completion_handler &&other)
 Move constructor.
 
completion_handleroperator= (completion_handler &&other)
 Move assignment operator.
 
template<typename T >
void set_value (T &&return_value)
 Notify successful completion of the procedure and set the return value. More...
 
void set_value ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void set_error (T &&error_value)
 Notify erroneous completion of the procedure with an associated error. More...
 
void set_error ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void operator() (T &&return_value)
 Same as set_value.
 
void operator() ()
 Same as set_value.
 

Detailed Description

template<typename Rpc>
class packio::completion_handler< Rpc >

The completion_handler class.

Template Parameters
RpcRPC protocol implementation

First argument of AsyncProcedure, the completion_handler is a callable used to notify the completion of an asynchronous procedure. You must only call set_value or set_error once.

Member Function Documentation

◆ set_error()

template<typename Rpc >
template<typename T >
void packio::completion_handler< Rpc >::set_error ( T &&  error_value)
inline

Notify erroneous completion of the procedure with an associated error.

Parameters
error_valueError value

◆ set_value()

template<typename Rpc >
template<typename T >
void packio::completion_handler< Rpc >::set_value ( T &&  return_value)
inline

Notify successful completion of the procedure and set the return value.

Parameters
return_valueThe value that the procedure will return to the client

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