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: | |
ALIB_API HashMap< TypeFunctors::Key, void *, TypeFunctors::Hash, TypeFunctors::EqualTo > & | DbgGetSingletons () |
ALIB_API int | DbgGetSingletons (NAString &target) |
void | Shutdown () |
HashMap< TypeFunctors::Key, void *, TypeFunctors::Hash, TypeFunctors::EqualTo > & 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 183 of file singleton.cpp.
int DbgGetSingletons | ( | NAString & | target | ) |
This debug function writes all type names and addresses of each currently defined instance of class Singleton into the given AString.
true
.The method included with alib/singletons/dbgsingletons.hpp .
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 191 of file singleton.cpp.
ALIB_API void 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 164 of file singleton.cpp.