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

The base of any trait in this file. This trait calls handle_error() if it detects a failure, otherwise returns the result of the wrapped function. More...

#include <syscall_wrapper.hpp>

Public Types

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

template<class HandleError >
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 FailureTraits, class ... Args>
struct jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >

The base of any trait in this file. This trait calls handle_error() if it detects a failure, otherwise returns the result of the wrapped function.

Definition at line 151 of file syscall_wrapper.hpp.

Member Typedef Documentation

◆ exception_t

template<class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::exception_t = syscall::exception_t

Definition at line 152 of file syscall_wrapper.hpp.

◆ failure_code

template<class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::failure_code = typename failure_traits::failure_code

Definition at line 156 of file syscall_wrapper.hpp.

◆ failure_detection

template<class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::failure_detection = typename failure_traits::failure_detection

Definition at line 155 of file syscall_wrapper.hpp.

◆ failure_traits

template<class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::failure_traits = FailureTraits

Definition at line 153 of file syscall_wrapper.hpp.

◆ fn_ret_code

template<class FailureTraits , class ... Args>
using jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::fn_ret_code = typename failure_traits::fn_ret_code

Definition at line 154 of file syscall_wrapper.hpp.

Member Function Documentation

◆ report()

template<class FailureTraits , class ... FnArgs>
template<class HandleError >
auto jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, FnArgs >::report ( fn_ret_code  ret,
HandleError &&  handle_error 
)
inlinestaticnoexcept

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?)

Definition at line 24 of file syscall_wrapper_impl.hpp.

◆ report_error()

template<class FailureTraits , class ... Args>
void jmmcg::LIBJMMCG_VER_NAMESPACE::syscall::traits_base< FailureTraits, Args >::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(*)(Args...)  fn,
Args ...  args 
)
staticnoexcept

How the error should be reported to the client, in this case a crt_exception with suitable details is thrown.

Definition at line 35 of file syscall_wrapper_impl.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::info::function::function().


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