Dripline-Cpp  v2.4.2
Dripline Implementation in C++
Classes | Namespaces | Macros | Functions
return_codes.hh File Reference
#include "dripline_api.hh"
#include "indexed_factory.hh"
#include "macros.hh"
#include <memory>
#include <set>
#include <string>
#include <vector>
Include dependency graph for return_codes.hh:

Go to the source code of this file.

Classes

class  return_code
 Base class for return codes. More...
 
class  copy_code
 Stores a copy of the return-code value, name, and description, either as a custom return-code or copying from any return_code-derived class. More...
 
struct  dl_success
 
struct  dl_warning_no_action_taken
 
struct  dl_warning_deprecated_feature
 
struct  dl_warning_dry_run
 
struct  dl_warning_offline
 
struct  dl_warning_sub_service
 
struct  dl_amqp_error
 
struct  dl_amqp_error_broker_connection
 
struct  dl_amqp_error_routingkey_notfound
 
struct  dl_resource_error
 
struct  dl_resource_error_connection
 
struct  dl_resource_error_no_response
 
struct  dl_resource_error_sub_service
 
struct  dl_service_error
 
struct  dl_service_error_no_encoding
 
struct  dl_service_error_decoding_fail
 
struct  dl_service_error_bad_payload
 
struct  dl_service_error_invalid_value
 
struct  dl_service_error_timeout
 
struct  dl_service_error_invalid_method
 
struct  dl_service_error_access_denied
 
struct  dl_service_error_invalid_key
 
struct  dl_service_error_invalid_specifier
 
struct  dl_client_error
 
struct  dl_client_error_invalid_request
 
struct  dl_client_error_handling_reply
 
struct  dl_client_error_unable_to_send
 
struct  dl_client_error_timeout
 
struct  dl_unhandled_exception
 
class  custom_return_code_registrar
 

Namespaces

 dripline
 

Macros

#define DEFINE_DL_RET_CODE(name, api_macro)
 
#define DEFINE_DL_RET_CODE_NOAPI(name)
 
#define IMPLEMENT_DL_RET_CODE(name, the_value, description)
 

Functions

bool operator== (const return_code &a_lhs, const return_code &a_rhs)
 
std::ostream & operator<< (std::ostream &a_os, const return_code &a_rc)
 
void add_return_code (unsigned a_value, const std::string &a_name, const std::string &a_description)
 Helper function to add a return code (primarily for python binding); scarab::error will be thrown if the value is not unique. More...
 
bool check_and_add_return_code (unsigned a_value, const std::string &a_name, const std::string &a_description)
 
std::vector< unsigned > get_return_code_values ()
 
std::map< unsigned, std::unique_ptr< return_code > > get_return_codes_map ()
 

Macro Definition Documentation

◆ DEFINE_DL_RET_CODE

#define DEFINE_DL_RET_CODE (   name,
  api_macro 
)
Value:
struct api_macro dl_##name : public ::dripline::return_code \
{ \
static unsigned s_value; \
static std::string s_name; \
static std::string s_description; \
virtual ~dl_##name() {} \
virtual unsigned rc_value() const { return dl_##name::s_value; } \
virtual std::string rc_name() const {return dl_##name::s_name; } \
virtual std::string rc_description() const {return dl_##name::s_description; } \
};
Base class for return codes.
Definition: return_codes.hh:39
virtual unsigned rc_value() const =0
virtual std::string rc_name() const =0
virtual std::string rc_description() const =0

Defines a return_code object with class name dl_[name], using an API macro (e.g. for going in a Window DLL). This macro should go in a header file.

Definition at line 72 of file return_codes.hh.

◆ DEFINE_DL_RET_CODE_NOAPI

#define DEFINE_DL_RET_CODE_NOAPI (   name)
Value:
struct dl_##name : public ::dripline::return_code \
{ \
static unsigned s_value; \
static std::string s_name; \
static std::string s_description; \
virtual ~dl_##name() {} \
virtual unsigned rc_value() const { return dl_##name::s_value; } \
virtual std::string rc_name() const {return dl_##name::s_name; } \
virtual std::string rc_description() const {return dl_##name::s_description; } \
};
Base class for return codes.
Definition: return_codes.hh:39
virtual unsigned rc_value() const =0
virtual std::string rc_name() const =0
virtual std::string rc_description() const =0

Defines a return_code object with class name dl_[name], with no API macro. This macro should go in a header file.

Definition at line 89 of file return_codes.hh.

◆ IMPLEMENT_DL_RET_CODE

#define IMPLEMENT_DL_RET_CODE (   name,
  the_value,
  description 
)
Value:
unsigned dl_##name::s_value = the_value; \
std::string dl_##name::s_name( TOSTRING(name) ); \
std::string dl_##name::s_description( description );\
static scarab::indexed_registrar< unsigned, ::dripline::return_code, dl_##name > t_dl_##name##_rc_reg( the_value );

Implement the return_code object with class name dl_[name], and give it the value the_value. the_value should be an unsigned integer. This macro should go in a source file.

Definition at line 107 of file return_codes.hh.