jubilant-funicular
Static Public Member Functions | Static Private Attributes | List of all members
nta::ErrorManager Class Reference

#include <Errors.h>

Collaboration diagram for nta::ErrorManager:
Collaboration graph
[legend]

Static Public Member Functions

static void handle_errors ()
 Handles all outstanding errors.
 
static void set_periodic_callback (const ErrorCallback &callback)
 Sets the periodic callback function.
 
static void set_push_callback (const ErrorCallback &callback)
 Sets the push callback function.
 
static void push_error (const Error &err)
 Adds and error to the front of the list.
 
static const Errorpop_error ()
 Removes (and returns) the error from the front of the list.
 
static const Errorpeek_error ()
 Returns the error at the front of the list.
 
static void clear_errors ()
 Deletes all errors (without handling any of them)
 

Static Private Attributes

static const Errorm_errors = nullptr
 A linked list of unhandled errors.
 
static ErrorCallback m_periodic_callback = [](const Error* _) {}
 The function used to handle errors at the end of each frame.
 
static ErrorCallback m_push_callback
 The function used to handle errors as they occur. More...
 

Detailed Description

Stores and handles Errors

Todo:
There should be one of each "Manager" class type per ScreenManager or one per Window (i.e. they should not be static)

Definition at line 45 of file Errors.h.

Member Data Documentation

◆ m_push_callback

ErrorCallback nta::ErrorManager::m_push_callback
staticprivate
Initial value:
= [](const Error* err) {
if (err) {
std::cout<<"An error occured. Check Log.log for details"<<std::endl;
exit(0xbad);
}
}

The function used to handle errors as they occur.

Definition at line 52 of file Errors.h.

Referenced by push_error(), and set_push_callback().


The documentation for this class was generated from the following files:
nta::cleanup
void cleanup()
deinitializes some stuff and destroys all managers
Definition: MyEngine.cpp:69