This is the namespace of ALib Module "Singletons". Please refer to the Programmer's Manual Of ALib Singletons for information about using this (single :-) Singleton class in this tiny namespace.
Type Index: | |
class | Singleton |
Function Index: | |
HashMap< MonoAllocator, lang::TypeFunctors::Key, void *, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo, lang::Caching::Auto, Recycling::None > & | DbgGetSingletons () |
int | DbgGetSingletons (NAString &target) |
void | shutdown () |
ALIB_DLL HashMap< MonoAllocator, lang::TypeFunctors::Key, void *, lang::TypeFunctors::Hash, lang::TypeFunctors::EqualTo, lang::Caching::Auto, Recycling::None > & alib::singletons::DbgGetSingletons | ( | ) |
This debug helper function returns a type map with void pointers to all singletons.
The function may be used to investigate which singleton objects are created within a process and the point in (run-) time of creation.
std::unordered_map<TypeKey, void*>&
.Definition at line 157 of file singletons.cpp.
This debug function writes all type names and addresses of each currently defined instance of class Singleton into the given AString.
true
.std::type_info
structs together with (void-) pointers to the singletons.target | The target string to write the list of singletons to. |
Definition at line 166 of file singletons.cpp.
ALIB_DLL void alib::singletons::shutdown | ( | ) |
Deletes the singletons. Upon exit of the process, programmers might want to explicitly free the hash table to avoid the detection of memory leaks by metrics tools like Valgrind . (Otherwise this can be omitted, as the memory is cleaned by the OS probably much faster when a process exits).
The standard bootstrap code of ALib, hence the (overloaded) functions alib::Shutdown will call this function.
Definition at line 123 of file singletons.cpp.