libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args > Struct Template Reference

If different operations need to be performed on different return-codes, then this trait may be used. More...

#include <syscall_wrapper.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >:
[legend]
Collaboration diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >:
[legend]

Public Types

using base_t = traits_base< FailureTraits, Args... >
 
using case_statements = typename CaseStatements::case_labels
 
- Public Types inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args... >
using exception_t = syscall::exception_t
 
using failure_traits = FailureTraits
 
using fn_ret_code = typename failure_traits::fn_ret_code
 
using failure_detection = typename failure_traits::failure_detection
 
using failure_code = typename failure_traits::failure_code
 

Static Public Member Functions

static constexpr auto select_error (int err, char const *file_name, unsigned line_num, char const *fn_name, tchar const *const rev_info, tchar const *const err_msg, fn_ret_code(*fn)(Args...), Args ...args)
 
- Static Public Member Functions inherited from jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args... >
static auto report (fn_ret_code ret, HandleError &&handle_error) noexcept(false)
 This operation is run to either return the result of the wrapped function or execute handle_error(), which should throw an exception. (Otherwise what is the point of this wrapper?) More...
 
static void report_error (int err, char const *file_name, unsigned line_num, char const *fn_name, tchar const *const rev_info, tchar const *const err_msg, fn_ret_code(*fn)(Args...), Args ...args) noexcept(false) NEVER_INLINE
 How the error should be reported to the client, in this case a crt_exception with suitable details is thrown. More...
 

Detailed Description

template<class CaseStatements, class FailureTraits, class ... Args>
struct jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >

If different operations need to be performed on different return-codes, then this trait may be used.

Definition at line 187 of file syscall_wrapper.hpp.

Member Typedef Documentation

◆ base_t

template<class CaseStatements , class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >::base_t = traits_base<FailureTraits, Args...>

Definition at line 188 of file syscall_wrapper.hpp.

◆ case_statements

template<class CaseStatements , class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >::case_statements = typename CaseStatements::case_labels

Create this type like this example:

using all_case_statements=syscall::case_statements_t< syscall::a_case_statement<1, [](){return 1;}>, syscall::a_case_statement<2, [](){return 2;}> >;

See also
case_statements_t, a_case_statement

Definition at line 203 of file syscall_wrapper.hpp.

Member Function Documentation

◆ select_error()

template<class CaseStatements , class FailureTraits , class ... Args>
constexpr auto jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::switch_traits< CaseStatements, FailureTraits, Args >::select_error ( int  err,
char const *  file_name,
unsigned  line_num,
char const *  fn_name,
tchar const *const  rev_info,
tchar const *const  err_msg,
fn_ret_code(*)(Args...)  fn,
Args ...  args 
)
inlinestaticconstexpr

Definition at line 53 of file syscall_wrapper_impl.hpp.


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