Antkeeper
0.0.1
|
Unsubscribes a subscriber on destruction. More...
#include <subscription.hpp>
Public Types | |
typedef std::function< void()> | unsubscribe_type |
Unsubscribe function object type. More... | |
Public Member Functions | |
subscription (std::weak_ptr< void > &&subscriber, unsubscribe_type &&unsubscriber) | |
Constructs a subscription. More... | |
~subscription () | |
Unsubscribes the subscriber and destructs the subscription. More... | |
bool | expired () const noexcept |
Returns true if the subscription is no longer active, false otherwise. More... | |
void | unsubscribe () |
Unsubscribes the subscriber. More... | |
Unsubscribes a subscriber on destruction.
Definition at line 31 of file subscription.hpp.
typedef std::function<void()> event::subscription::unsubscribe_type |
Unsubscribe function object type.
Definition at line 35 of file subscription.hpp.
event::subscription::subscription | ( | std::weak_ptr< void > && | subscriber, |
unsubscribe_type && | unsubscriber | ||
) |
Constructs a subscription.
subscriber | Weak pointer to the subscriber. |
unsubscriber | Unsubscribe function object. |
Definition at line 25 of file subscription.cpp.
event::subscription::~subscription | ( | ) |
Unsubscribes the subscriber and destructs the subscription.
Definition at line 30 of file subscription.cpp.
|
noexcept |
Returns true
if the subscription is no longer active, false
otherwise.
Definition at line 35 of file subscription.cpp.
void event::subscription::unsubscribe | ( | ) |
Unsubscribes the subscriber.
Definition at line 40 of file subscription.cpp.