Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/lifecycleregistry.hpp"
Registry of callback functions accessible by a label (ID) provided at registration.
Registered functions will be added to a list, which can be triggered via label. Used by AppState to implement the lumiera lifecycle (init, shutdown) hooks.
Definition at line 56 of file lifecycleregistry.hpp.
Public Types | |
typedef std::set< Hook > | Callbacks |
typedef void(* | Hook) (void) |
typedef Callbacks::iterator | Iter |
Public Member Functions | |
bool | enrol (Symbol label, Hook toCall) |
void | execute (Symbol label) |
Static Public Member Functions | |
static LifecycleRegistry & | instance () |
get the (single) LifecycleRegistry instance. More... | |
Private Attributes | |
std::map< Symbol, Callbacks > | table_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
|
inline |
Definition at line 66 of file lifecycleregistry.hpp.
References LifecycleRegistry::instance(), and lumiera::ON_BASIC_INIT.
Referenced by LifecycleHook::add().
|
static |
get the (single) LifecycleRegistry instance.
#include "lib/depend.hpp"
, on static initialisation the handle planted within that include would invoke DependencyFactory<LifecycleRegistry>
, which is defined later in the same header and thus not yet initialised. Definition at line 41 of file lifecycle.cpp.
Referenced by LifecycleHook::add(), LifecycleRegistry::enrol(), and LifecycleHook::trigger().