![]() |
Dripline-Cpp
v2.4.2
Dripline Implementation in C++
|
A singleton throw_reply object used to transfer throw_reply information to C++ from other implementations (e.g. Python) More...
#include <reply_cache.hh>
Public Member Functions | |
reply_cache & | operator= (const throw_reply &a_orig) |
void | set_cache (const return_code &a_code, const std::string &a_message, scarab::param_ptr_t a_payload_ptr) |
Set the contents of the reply cache (thread-safe) More... | |
![]() | |
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_reply & | operator= (const throw_reply &a_orig) |
template<class x_streamable > | |
throw_reply & | operator<< (x_streamable a_fragment) |
throw_reply & | operator<< (const std::string &a_fragment) |
throw_reply & | operator<< (const char *a_fragment) |
const std::string & | return_message () const noexcept |
std::string & | return_message () |
const return_code & | ret_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 Member Functions | |
reply_cache () | |
reply_cache (const reply_cache &)=delete | |
virtual | ~reply_cache () noexcept |
Friends | |
class | scarab::thread_singleton< reply_cache > |
class | scarab::destroyer< reply_cache > |
Additional Inherited Members | |
![]() | |
std::string | f_return_message |
std::shared_ptr< return_code > | f_return_code |
scarab::param_ptr_t | f_payload |
A singleton throw_reply object used to transfer throw_reply information to C++ from other implementations (e.g. Python)
Example usage: In Python, when a ThrowReply is raised, that's eventually converted automatically to an thrown exceptoin of type reply_already_set. Since we have no control over that conversion, we use the reply_cache to first store all of the information in the ThrowReply, before the C++ exception is raised. Once the exception is raised and caught, we can recognize that the origin was a Python ThrowReply, and then grab the information out of the reply_cache to send the reply.
For more details, see endpoint::on_request_message()'s technique for recognizing the type of the Python exception, and dripline-python's use of the cache in ThrowReply.py.
Definition at line 37 of file reply_cache.hh.
|
protected |
Definition at line 21 of file reply_cache.cc.
|
protecteddelete |
|
protectedvirtualnoexcept |
Definition at line 25 of file reply_cache.cc.
reply_cache & operator= | ( | const throw_reply & | a_orig | ) |
Definition at line 28 of file reply_cache.cc.
void set_cache | ( | const return_code & | a_code, |
const std::string & | a_message, | ||
scarab::param_ptr_t | a_payload_ptr | ||
) |
Set the contents of the reply cache (thread-safe)
Definition at line 35 of file reply_cache.cc.
|
friend |
Definition at line 46 of file reply_cache.hh.
|
friend |
Definition at line 46 of file reply_cache.hh.