Doxygen with github
|
Implements event handle, used to automatically unbind callback on destruction. More...
#include <ksEventHandle.h>
Public Member Functions | |
ksEventHandle (std::weak_ptr< ksEventInterface > &&eventBaseWp, std::size_t callbackUID) | |
Constructs event handle. | |
virtual | ~ksEventHandle () |
Destructs event handle. Unbinds assigned callback from the list. | |
Protected Attributes | |
std::weak_ptr< ksEventInterface > | eventBaseWp |
Weak pointer to event object. | |
std::size_t | callbackUID {0} |
Unique callback ID. | |
Implements event handle, used to automatically unbind callback on destruction.
This is very important to avoid crashing the program in case that user forgets to unbind the callback. Instead, the event handle will unbind the callback automatically when parent object is destroyed.
ksf::evt::ksEventHandle::ksEventHandle | ( | std::weak_ptr< ksEventInterface > && | eventBaseWp, |
std::size_t | callbackUID ) |
Constructs event handle.
eventBaseWp | R-value reference to weak pointer to event object. |
callbackUID | Unique callback ID. |