NDEVR
API Documentation

Manages crash handling, exception reporting, and mini-dump creation. More...

Inheritance diagram for CrashManager:
[legend]
Collaboration diagram for CrashManager:
[legend]

Public Member Functions

 CrashManager ()
 Constructs a CrashManager with default settings.
virtual ~CrashManager ()
 Destroys the CrashManager and cleans up any registered handlers.
bool handleException (void *e)
 Handles a platform-specific exception, potentially writing a crash report or mini-dump.
bool recordAllExceptions () const
 Returns whether all exceptions should be recorded.
bool setAsTopLevelExceptionHandler ()
 Registers this CrashManager as the top-level unhandled exception handler for the process.
void setCallback (std::function< void(const Exception &)> callback)
 Sets a callback function to be invoked when an exception is caught.
void setMiniDumpDirectory (const File &file)
 Sets the directory where mini-dump files will be written on crash.

Static Public Member Functions

static CrashManagerCurrentCrashManager ()
 Retrieves the currently active CrashManager instance.

Protected Attributes

std::function< void(const Exception &)> m_callback
 Callback invoked when an exception is caught.
File m_minidump_directory
 Directory where mini-dump files are written on crash.

Detailed Description

Manages crash handling, exception reporting, and mini-dump creation.


Definition at line 45 of file CrashManager.h.

Member Function Documentation

◆ CurrentCrashManager()

CrashManager * CrashManager::CurrentCrashManager ( )
static

Retrieves the currently active CrashManager instance.

Returns
A pointer to the current CrashManager, or nullptr if none is set.

References CrashManager().

◆ handleException()

bool CrashManager::handleException ( void * e)

Handles a platform-specific exception, potentially writing a crash report or mini-dump.

Parameters
[in]eA pointer to the platform-specific exception record (e.g., EXCEPTION_POINTERS on Windows).
Returns
True if the exception was handled, false otherwise.

◆ recordAllExceptions()

bool CrashManager::recordAllExceptions ( ) const
inline

Returns whether all exceptions should be recorded.

Returns
Always returns false in the base implementation.

Definition at line 68 of file CrashManager.h.

◆ setAsTopLevelExceptionHandler()

bool CrashManager::setAsTopLevelExceptionHandler ( )

Registers this CrashManager as the top-level unhandled exception handler for the process.

Returns
True if the handler was successfully installed, false otherwise.

◆ setCallback()

void CrashManager::setCallback ( std::function< void(const Exception &)> callback)
inline

Sets a callback function to be invoked when an exception is caught.

Parameters
[in]callbackThe function to call with the caught Exception.

Definition at line 84 of file CrashManager.h.

References m_callback.

◆ setMiniDumpDirectory()

void CrashManager::setMiniDumpDirectory ( const File & file)
inline

Sets the directory where mini-dump files will be written on crash.

Parameters
[in]fileThe directory path for mini-dump output.

Definition at line 90 of file CrashManager.h.

References file, and m_minidump_directory.


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