1 #ifndef SAFE_CALLBACK_CLASS
2 #define SAFE_CALLBACK_CLASS
25 class callback_data_block;
26 class global_live_objects;
122 void begin_availability();
a simple place-holder that anonymizes the type passed to the callback.
virtual ~callback_data_block()
A reasonably easy way to make callbacks safe from shutdown ordering issues.
DEFINE_CLASS_NAME("safe_callback")
bool invoke_callback(callback_data_block &new_data)
this function is invoked by a user of the safe_callback derived object.
bool decoupled() const
if true, then end_availability() was already invoked on the object.
virtual void real_callback(callback_data_block &new_data)=0
derived classes implement this to provide their callback functionality.
void end_availability()
prepares to shut down this object.
virtual ~safe_callback()
actually destroys the object.
safe_callback()
construction signifies that the callback is now in operation.
global_live_objects & _invocables()
provides access to the program-wide list of healthy callback objects.