libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::exception< API, Mdl > Class Template Reference

#include <exception.hpp>

Inheritance diagram for jmmcg::exception< API, Mdl >:
[legend]

Public Types

typedef std::runtime_error base_t
 
typedef ppd::api_threading_traits< API, Mdl > thread_traits
 
typedef thread_traits::lock_traits lock_traits
 

Public Member Functions

 exception (const tstring &r, const info::function &f, const info::revision &ri) noexcept(false)
 
 exception (const tostringstream &r, const info::function &f, const info::revision &ri) noexcept(false)
 
 exception (const exception &ex) noexcept(false)
 
void operator= (exception const &)=delete
 
void operator= (exception &&)=delete
 
virtual ~exception () noexcept(true)
 
virtual exit_codes::codes __fastcall code () const noexcept(true)
 
const char *__CLR_OR_THIS_CALL what () const noexcept(true) final override
 
virtual const tstring __fastcall to_string () const noexcept(false)
 

Protected Attributes

const thread_traits::api_params_type::pid_type process_id
 
const thread_traits::api_params_type::tid_type thread_id
 
const thread_traits::api_params_type::username_type current_username
 

Friends

tostream &__fastcall operator<< (tostream &o, const exception &e) noexcept(false)
 

Detailed Description

template<ppd::generic_traits::api_type API, typename Mdl>
class jmmcg::exception< API, Mdl >

Inheritance from "std::runtime_error" is done in case of object slicing (which can occur with exceptions) so I set the error string in the exception as best I can. Note that for derived exception classes, the error string held n "std::exception" may not have everything in it compared to the overrriden "what()". But it is better than sweet f.a.

Definition at line 78 of file exception.hpp.

Member Typedef Documentation

◆ base_t

template<ppd::generic_traits::api_type API, typename Mdl >
typedef std::runtime_error jmmcg::exception< API, Mdl >::base_t

Definition at line 80 of file exception.hpp.

◆ lock_traits

template<ppd::generic_traits::api_type API, typename Mdl >
typedef thread_traits::lock_traits jmmcg::exception< API, Mdl >::lock_traits

Definition at line 82 of file exception.hpp.

◆ thread_traits

template<ppd::generic_traits::api_type API, typename Mdl >
typedef ppd::api_threading_traits<API, Mdl> jmmcg::exception< API, Mdl >::thread_traits

Definition at line 81 of file exception.hpp.

Constructor & Destructor Documentation

◆ exception() [1/3]

template<ppd::generic_traits::api_type API, typename Mdl >
NEVER_INLINE jmmcg::exception< API, Mdl >::exception ( const tstring r,
const info::function f,
const info::revision ri 
)
inlinenoexcept

Definition at line 42 of file exception_impl.hpp.

◆ exception() [2/3]

template<ppd::generic_traits::api_type API, typename Mdl >
NEVER_INLINE jmmcg::exception< API, Mdl >::exception ( const tostringstream r,
const info::function f,
const info::revision ri 
)
inlinenoexcept

Definition at line 54 of file exception_impl.hpp.

◆ exception() [3/3]

template<ppd::generic_traits::api_type API, typename Mdl >
NEVER_INLINE jmmcg::exception< API, Mdl >::exception ( const exception< API, Mdl > &  ex)
inlinenoexcept

Definition at line 66 of file exception_impl.hpp.

◆ ~exception()

template<ppd::generic_traits::api_type API, typename Mdl >
virtual jmmcg::exception< API, Mdl >::~exception ( )
inlinevirtualnoexcept

Definition at line 89 of file exception.hpp.

Member Function Documentation

◆ code()

template<ppd::generic_traits::api_type API, typename Mdl >
virtual exit_codes::codes __fastcall jmmcg::exception< API, Mdl >::code ( ) const
inlinevirtualnoexcept

◆ operator=() [1/2]

template<ppd::generic_traits::api_type API, typename Mdl >
void jmmcg::exception< API, Mdl >::operator= ( exception< API, Mdl > &&  )
delete

◆ operator=() [2/2]

template<ppd::generic_traits::api_type API, typename Mdl >
void jmmcg::exception< API, Mdl >::operator= ( exception< API, Mdl > const &  )
delete

◆ to_string()

template<ppd::generic_traits::api_type API, typename Mdl >
const NEVER_INLINE tstring __fastcall jmmcg::exception< API, Mdl >::to_string ( ) const
inlinevirtualnoexcept

◆ what()

template<ppd::generic_traits::api_type API, typename Mdl >
NEVER_INLINE const char *__CLR_OR_THIS_CALL jmmcg::exception< API, Mdl >::what ( ) const
inlinefinaloverridenoexcept

Definition at line 85 of file exception_impl.hpp.

Friends And Related Function Documentation

◆ operator<<

template<ppd::generic_traits::api_type API, typename Mdl >
tostream& __fastcall operator<< ( tostream o,
const exception< API, Mdl > &  e 
)
friend
Todo:
Implement using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Definition at line 105 of file exception.hpp.

Referenced by jmmcg::exception< API, Mdl >::code().

Member Data Documentation

◆ current_username

template<ppd::generic_traits::api_type API, typename Mdl >
const thread_traits::api_params_type::username_type jmmcg::exception< API, Mdl >::current_username
protected

Definition at line 112 of file exception.hpp.

◆ process_id

template<ppd::generic_traits::api_type API, typename Mdl >
const thread_traits::api_params_type::pid_type jmmcg::exception< API, Mdl >::process_id
protected

Definition at line 110 of file exception.hpp.

◆ thread_id

template<ppd::generic_traits::api_type API, typename Mdl >
const thread_traits::api_params_type::tid_type jmmcg::exception< API, Mdl >::thread_id
protected

Definition at line 111 of file exception.hpp.


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