ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
subscription Class Referencefinal

RAII handle for managing event subscriptions. More...

#include <event_bus.hpp>

Collaboration diagram for subscription:
Collaboration graph

Public Types

using unsubscribe_fn = std::function< void()>
 

Public Member Functions

 subscription (unsubscribe_fn fn)
 
 subscription (const subscription &)=delete
 
subscriptionoperator= (const subscription &)=delete
 
 subscription (subscription &&other) noexcept
 
subscriptionoperator= (subscription &&other) noexcept
 
bool is_active () const
 Check if the subscription is active.
 
void unsubscribe ()
 Manually unsubscribe before destruction.
 

Detailed Description

RAII handle for managing event subscriptions.

When destroyed, automatically unsubscribes from the event bus. Can be moved but not copied.