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

Error handler interface. More...

#include <error_handler.h>

Inheritance diagram for kcenon::thread::error_handler:
Inheritance graph
Collaboration diagram for kcenon::thread::error_handler:
Collaboration graph

Public Types

using error_callback
 

Public Member Functions

virtual ~error_handler ()=default
 
virtual void handle_error (const std::string &context, const std::string &error)=0
 Handle an error.
 
virtual void set_error_callback (error_callback callback)=0
 Set a callback for error handling.
 

Detailed Description

Error handler interface.

Provides a way to handle errors in the thread system without depending on a specific error handling implementation.

Definition at line 27 of file error_handler.h.

Member Typedef Documentation

◆ error_callback

Initial value:
std::function<void(const std::string& context,
const std::string& error)>
@ error
Error events that might still allow continuation.

Definition at line 29 of file error_handler.h.

Constructor & Destructor Documentation

◆ ~error_handler()

virtual kcenon::thread::error_handler::~error_handler ( )
virtualdefault

Member Function Documentation

◆ handle_error()

virtual void kcenon::thread::error_handler::handle_error ( const std::string & context,
const std::string & error )
pure virtual

Handle an error.

Parameters
contextContext where the error occurred
errorError message

Implemented in kcenon::thread::default_error_handler.

◆ set_error_callback()

virtual void kcenon::thread::error_handler::set_error_callback ( error_callback callback)
pure virtual

Set a callback for error handling.

Parameters
callbackCallback function to be called on errors

Implemented in kcenon::thread::default_error_handler.


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