dxd - dynax driver framework 2.2.0d109
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx_exception.h File Reference
#include "dx_platform.h"
#include <stdexcept>
#include <iomanip>
#include <chrono>
#include <mutex>
#include <sstream>
+ Include dependency graph for dx_exception.h:
+ This graph shows which files directly or indirectly include this file:

Classes

class  dx::exception
 

Namespaces

namespace  dx
 dynax driver framework user mode interface namespace
 
namespace  dx::thread
 thread
 
namespace  dx::trace
 

Macros

#define __dx_catchall(inject, ...)
 
#define dx_catchall(inject, ...)
 
#define dx_catchall_handler(object, inject, ...)
 
#define dx_catchall_handler_or_rethrow(object, test, inject, ...)
 
#define dx_catchall_rethrow(inject, ...)
 
#define dx_pass(test, ...)
 
#define dx_pass_strict(test, ...)
 

Functions

void dx::halt ()
 
std::string dx::thread::name ()
 
std::ostream & dx::operator<< (std::ostream &os, const exception &exception) noexcept
 
std::string dx::trace::pretty (std::string function) noexcept
 
std::string dx::to (uint32_t fourchar)
 
void dx::trace::unfold (std::ostream &os, const exception &exception, unsigned int indent=0) noexcept
 

Variables

std::recursive_mutex dx::io_mutex
 

Macro Definition Documentation

◆ __dx_catchall

#define __dx_catchall ( inject,
... )
Value:
catch(const dx::exception& __dx_exception){\
try{\
dx::exception exception(\
&__dx_exception,\
__dx_exception.error,\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
}catch(...){}\
}catch(const std::exception& __std_exception){\
try{\
dx::exception exception(\
__std_exception.what(),\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
}catch(...){}\
}catch(...){\
try{\
dx::exception exception(\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
}catch(...){}\
}
Definition dx_exception.h:141
os_result error
Definition dx_exception.h:144
@ unknown
Definition macOS/dx_platform.h:177
#define __PRETTY_FUNCTION__
mock compiler idiosyncrasies
Definition windows/dx_platform.h:47

◆ dx_catchall

#define dx_catchall ( inject,
... )
Value:
__dx_catchall(inject std::cerr<< \
dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__)<< \
std::endl;, ##__VA_ARGS__)
#define __dx_catchall(inject,...)
Definition dx_exception.h:58

◆ dx_catchall_handler

#define dx_catchall_handler ( object,
inject,
... )
Value:
__dx_catchall(inject \
(object)->exception(dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__));, \
##__VA_ARGS__)

◆ dx_catchall_handler_or_rethrow

#define dx_catchall_handler_or_rethrow ( object,
test,
inject,
... )
Value:
dx_catchall_rethrow(inject if(test) \
(object)->exception(dx::exception(&exception, exception.error, __PRETTY_FUNCTION__, __FILE__, __LINE__)); else,\
##__VA_ARGS__)\
#define dx_catchall_rethrow(inject,...)
Definition dx_exception.h:97

◆ dx_catchall_rethrow

#define dx_catchall_rethrow ( inject,
... )
Value:
catch(const dx::exception& __dx_exception){\
dx::exception exception(\
&__dx_exception,\
__dx_exception.error,\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
throw exception;\
}catch(const std::exception& __std_exception){\
dx::exception exception(\
__std_exception.what(),\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
throw exception;\
}catch(...){\
dx::exception exception(\
__FILE__, __LINE__,\
##__VA_ARGS__);\
inject\
throw exception;\
}

◆ dx_pass

#define dx_pass ( test,
... )
Value:
{\
dx::os_result __dx_test_status=(test);\
if (dx::os_error(__dx_test_status)){\
dx::halt();\
throw dx::exception(\
DX_STRINGIFY(test),\
__dx_test_status,\
__FILE__, __LINE__,\
##__VA_ARGS__);}}
#define DX_STRINGIFY(x)
Definition dx_macros.h:32
::mach_error_t os_result
Definition macOS/dx_platform.h:164
bool os_error(os_result result) noexcept
Definition macOS/dx_platform.h:187

◆ dx_pass_strict

#define dx_pass_strict ( test,
... )
Value:
{\
dx::os_result __dx_test_status=(test);\
if (__dx_test_status){\
dx::halt();\
throw dx::exception(\
DX_STRINGIFY(test),\
__dx_test_status,\
__FILE__, __LINE__,\
##__VA_ARGS__);}}

(c) copyright 2009 dynamic acoustics e.U. generated on Mon Apr 21 2025

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.