VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters > Class Template Reference

#include <TEventBus.hpp>

Inheritance diagram for tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >:
Collaboration diagram for tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >:

Public Member Functions

 Subscription (EventBus *, const EventId, const Callback &&)
 
 ~Subscription ()
 
- Public Member Functions inherited from tklb::EventBus< EVENT_COUNT, EventId, MutexType >::BaseSubscription
virtual ~BaseSubscription ()
 

Private Types

using Callback = Delegate< void(Parameters...)>
 

Private Attributes

friend EventBus
 
Callback mCallback
 
EventBus *const mBus = nullptr
 
const EventId mEventId
 

Detailed Description

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
class tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >

Definition at line 45 of file TEventBus.hpp.

Member Typedef Documentation

◆ Callback

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
using tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::Callback = Delegate<void(Parameters...)>
private

Definition at line 47 of file TEventBus.hpp.

Constructor & Destructor Documentation

◆ Subscription()

template<int EVENT_COUNT, typename EventId , class MutexType >
template<typename... Parameters>
tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::Subscription ( EventBus bus,
const EventId  eventId,
const Callback &&  callback 
)

Definition at line 81 of file TEventBus.hpp.

83 : mBus(bus), mEventId(eventId), mCallback(callback) {
84 TKLB_ASSERT(bus != nullptr)
85 bus->addSubscriber(this, eventId);
86 }
#define TKLB_ASSERT(condition)
Wrap assertions.
Definition: TAssert.h:18
void addSubscriber(BaseSubscription *sub, const EventId eventId)
Definition: TEventBus.hpp:23
Here is the call graph for this function:

◆ ~Subscription()

template<int EVENT_COUNT, typename EventId , class MutexType >
template<typename... Parameters>
tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::~Subscription

Definition at line 75 of file TEventBus.hpp.

75 {
77 }
void removeSubscriber(BaseSubscription *sub, const EventId eventId)
Definition: TEventBus.hpp:29
Here is the call graph for this function:

Member Data Documentation

◆ EventBus

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
friend tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::EventBus
private

Definition at line 46 of file TEventBus.hpp.

◆ mBus

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
EventBus* const tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::mBus = nullptr
private

Definition at line 49 of file TEventBus.hpp.

◆ mCallback

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
Callback tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::mCallback
private

Definition at line 48 of file TEventBus.hpp.

◆ mEventId

template<int EVENT_COUNT, typename EventId = int, class MutexType = MutexDummy>
template<typename... Parameters>
const EventId tklb::EventBus< EVENT_COUNT, EventId, MutexType >::Subscription< Parameters >::mEventId
private

Definition at line 50 of file TEventBus.hpp.


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