![]() |
GA::kit v0.3
G&A's in-house C++ application framework
|
#include <sigslot.hpp>
Public Member Functions | |
| virtual | ~observer_base ()=default |
Protected Member Functions | |
| void | disconnect_all () |
Friends | |
| template<typename , typename ... > | |
| class | signal_base |
Observer is a base class for intrusive lifetime tracking of objects.
This is an alternative to trackable pointers, such as std::shared_ptr, and manual connection management by keeping connection objects in scope. Deriving from this class allows automatic disconnection of all the slots connected to any signal when an instance is destroyed.
|
virtualdefault |
|
inlineprotected |
Disconnect all signals connected to this object.
To avoid invocation of slots on a semi-destructed instance, which may happen in multi-threaded contexts, derived classes should call this method in their destructor. This will ensure proper disconnection prior to the destruction.