MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ subscribe() [1/2]

void Lila::EventBus::subscribe ( EventType  type,
const std::shared_ptr< Subscription > &  subscriber 
)

Subscribe to an event type with a Subscription object.

Parameters
typeEventType to subscribe to
subscriberShared pointer to Subscription

Definition at line 12 of file EventBus.cpp.

13{
14 std::lock_guard lock(m_mutex);
15 m_subscribers[type].emplace_back(subscriber);
16}
std::mutex m_mutex
Mutex for thread safety.
Definition EventBus.hpp:183
std::unordered_map< EventType, std::vector< std::weak_ptr< Subscription > > > m_subscribers
Subscribers by event type.
Definition EventBus.hpp:182

References m_mutex, and m_subscribers.

Referenced by subscribe().

+ Here is the caller graph for this function: