Dripline-Cpp  v2.4.2
Dripline Implementation in C++
Public Member Functions | Protected Attributes | List of all members
throw_reply Class Reference

Object that can be thrown while processing a request to send a reply. More...

#include <throw_reply.hh>

Inheritance diagram for throw_reply:
Inheritance graph

Public Member Functions

 throw_reply ()
 
 throw_reply (const return_code &a_code, scarab::param_ptr_t a_payload_ptr=scarab::param_ptr_t(new scarab::param()))
 
 throw_reply (const throw_reply &a_orig)
 
virtual ~throw_reply () noexcept
 
throw_replyoperator= (const throw_reply &a_orig)
 
template<class x_streamable >
throw_replyoperator<< (x_streamable a_fragment)
 
throw_replyoperator<< (const std::string &a_fragment)
 
throw_replyoperator<< (const char *a_fragment)
 
const std::string & return_message () const noexcept
 
std::string & return_message ()
 
const return_coderet_code () const noexcept
 
void set_return_code (const return_code &a_code)
 
const scarab::param & payload () const noexcept
 
scarab::param & payload ()
 
void set_payload (scarab::param_ptr_t a_payload)
 
const scarab::param_ptr_t & get_payload_ptr () const noexcept
 

Protected Attributes

std::string f_return_message
 
std::shared_ptr< return_codef_return_code
 
scarab::param_ptr_t f_payload
 

Detailed Description

Object that can be thrown while processing a request to send a reply.

Author
N.S. Oblath

The throw_reply is intended to be thrown during message processing. It's caught in endpoint::on_request_message() to translate the information into a reply message.

Three pieces of information can be transmitted:

  1. (required) The return code is provided by an object derived from return_code. It's passed to the throw_reply in the constructor.
  2. (optional) The return message explains the reply in human-readable terms. It's passed to the throw_reply using operator<<().
  3. (optional) The payload can contain further information to reply to the requstor. It's passed to the throw_reply in the constructor. The default is a null (scarab::param) object.

Definition at line 41 of file throw_reply.hh.

Constructor & Destructor Documentation

◆ throw_reply() [1/3]

Definition at line 18 of file throw_reply.cc.

◆ throw_reply() [2/3]

throw_reply ( const return_code a_code,
scarab::param_ptr_t  a_payload_ptr = scarab::param_ptr_t(new scarab::param()) 
)

Definition at line 24 of file throw_reply.cc.

◆ throw_reply() [3/3]

throw_reply ( const throw_reply a_orig)

Definition at line 30 of file throw_reply.cc.

◆ ~throw_reply()

~throw_reply ( )
virtualnoexcept

Definition at line 36 of file throw_reply.cc.

Member Function Documentation

◆ get_payload_ptr()

const scarab::param_ptr_t & get_payload_ptr ( ) const
inlinenoexcept

Definition at line 136 of file throw_reply.hh.

◆ operator<<() [1/3]

throw_reply & operator<< ( x_streamable  a_fragment)

Definition at line 79 of file throw_reply.hh.

◆ operator<<() [2/3]

throw_reply & operator<< ( const std::string &  a_fragment)
inline

Definition at line 87 of file throw_reply.hh.

◆ operator<<() [3/3]

throw_reply & operator<< ( const char *  a_fragment)
inline

Definition at line 93 of file throw_reply.hh.

◆ operator=()

throw_reply & operator= ( const throw_reply a_orig)

Definition at line 39 of file throw_reply.cc.

◆ payload() [1/2]

const scarab::param & payload ( ) const
inlinenoexcept

Definition at line 120 of file throw_reply.hh.

◆ payload() [2/2]

scarab::param & payload ( )
inline

Definition at line 125 of file throw_reply.hh.

◆ ret_code()

const return_code & ret_code ( ) const
inlinenoexcept

Definition at line 109 of file throw_reply.hh.

◆ return_message() [1/2]

const std::string & return_message ( ) const
inlinenoexcept

Definition at line 99 of file throw_reply.hh.

◆ return_message() [2/2]

std::string & return_message ( )
inline

Definition at line 104 of file throw_reply.hh.

◆ set_payload()

void set_payload ( scarab::param_ptr_t  a_payload)
inline

Definition at line 130 of file throw_reply.hh.

◆ set_return_code()

void set_return_code ( const return_code a_code)
inline

Definition at line 114 of file throw_reply.hh.

Member Data Documentation

◆ f_payload

scarab::param_ptr_t f_payload
protected

Definition at line 74 of file throw_reply.hh.

◆ f_return_code

std::shared_ptr< return_code > f_return_code
protected

Definition at line 73 of file throw_reply.hh.

◆ f_return_message

std::string f_return_message
protected

Definition at line 72 of file throw_reply.hh.


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