20 #ifndef ANTKEEPER_EVENT_SUBSCRIPTION_HPP
21 #define ANTKEEPER_EVENT_SUBSCRIPTION_HPP
53 [[nodiscard]]
bool expired() const noexcept;
Unsubscribes a subscriber on destruction.
bool expired() const noexcept
Returns true if the subscription is no longer active, false otherwise.
std::function< void()> unsubscribe_type
Unsubscribe function object type.
~subscription()
Unsubscribes the subscriber and destructs the subscription.
void unsubscribe()
Unsubscribes the subscriber.
subscription(std::weak_ptr< void > &&subscriber, unsubscribe_type &&unsubscriber)
Constructs a subscription.
Publish-subscribe messaging.
std::function< void(const T &)> subscriber
Subscriber function object type.
std::shared_ptr< subscription > shared_subscription
Shared pointer to a subscription.