Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
kcenon::thread::scoped_crash_callback Class Reference

RAII helper for automatic crash callback registration. More...

#include <crash_handler.h>

Collaboration diagram for kcenon::thread::scoped_crash_callback:
Collaboration graph

Public Member Functions

 scoped_crash_callback (const std::string &name, crash_callback callback, int priority=100)
 
 ~scoped_crash_callback ()
 
 scoped_crash_callback (const scoped_crash_callback &)=delete
 
scoped_crash_callbackoperator= (const scoped_crash_callback &)=delete
 
 scoped_crash_callback (scoped_crash_callback &&)=default
 
scoped_crash_callbackoperator= (scoped_crash_callback &&)=default
 

Private Attributes

size_t registration_id_
 

Detailed Description

RAII helper for automatic crash callback registration.

Examples
crash_protection/main.cpp.

Definition at line 200 of file crash_handler.h.

Constructor & Destructor Documentation

◆ scoped_crash_callback() [1/3]

kcenon::thread::scoped_crash_callback::scoped_crash_callback ( const std::string & name,
crash_callback callback,
int priority = 100 )
inline

Definition at line 202 of file crash_handler.h.

203 : registration_id_(crash_handler::instance().register_crash_callback(name, callback, priority)) {}
static crash_handler & instance()
Get the global crash handler instance.
@ callback
Call user callback for custom decision.
@ priority
Priority-based scheduling.

◆ ~scoped_crash_callback()

kcenon::thread::scoped_crash_callback::~scoped_crash_callback ( )
inline

Definition at line 205 of file crash_handler.h.

205 {
207 }
void unregister_crash_callback(size_t registration_id)
Unregister a crash callback.

References kcenon::thread::crash_handler::instance(), registration_id_, and kcenon::thread::crash_handler::unregister_crash_callback().

Here is the call graph for this function:

◆ scoped_crash_callback() [2/3]

kcenon::thread::scoped_crash_callback::scoped_crash_callback ( const scoped_crash_callback & )
delete

◆ scoped_crash_callback() [3/3]

kcenon::thread::scoped_crash_callback::scoped_crash_callback ( scoped_crash_callback && )
default

Member Function Documentation

◆ operator=() [1/2]

scoped_crash_callback & kcenon::thread::scoped_crash_callback::operator= ( const scoped_crash_callback & )
delete

◆ operator=() [2/2]

scoped_crash_callback & kcenon::thread::scoped_crash_callback::operator= ( scoped_crash_callback && )
default

Member Data Documentation

◆ registration_id_

size_t kcenon::thread::scoped_crash_callback::registration_id_
private

Definition at line 216 of file crash_handler.h.

Referenced by ~scoped_crash_callback().


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