libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::Subscription Class Reference

#include <Signal.hpp>

Public Member Functions

bool IsEmpty () const
 
Subscriptionoperator= (Subscription &&other)
 
Subscriptionoperator= (const Subscription &other)=delete
 
void Release ()
 
 Subscription ()
 
 Subscription (Subscription &&other)
 
 Subscription (const Subscription &other)=delete
 
 ~Subscription ()
 

Friends

template<typename... >
class Signal
 
class SignalBase
 

Detailed Description

A valid Subscription is created by calling Sinnal::Subscribe. The main purpose of this class is to automatically unsibscribe the function when this Subscription is destructed. This way it's easy to make sure that a subscribed function won't be called after your class instance was destructed - simply keep the Subscription as a member of that class, or use a SubscriptionsManager.

A Subscription may be empty (when default-constructed or released), in such case it represents no subscription and can be assigned a new one.

See also
Signal, SubscriptionsManager

Constructor & Destructor Documentation

AlgAudio::Subscription::Subscription ( )
inline

Default constructor creates an empty Subscription which represents no event.

AlgAudio::Subscription::Subscription ( Subscription &&  other)

Subscriptions are movable.

AlgAudio::Subscription::~Subscription ( )
inline
AlgAudio::Subscription::Subscription ( const Subscription other)
delete

Member Function Documentation

bool AlgAudio::Subscription::IsEmpty ( ) const
inline

Returns true if this instance represents no subscription.

Subscription& AlgAudio::Subscription::operator= ( Subscription &&  other)

Subscriptions are movable.

Subscription& AlgAudio::Subscription::operator= ( const Subscription other)
delete
void AlgAudio::Subscription::Release ( )

Use this function to remove a subscription from a signal. This way the subscribed function will no longer be called when the Signal happens.

Friends And Related Function Documentation

template<typename... >
friend class Signal
friend
friend class SignalBase
friend

The documentation for this class was generated from the following file: