LeviLamina
Loading...
Searching...
No Matches
ll::event::EventBus Class Reference

Public Types

using FactoryFn = std::function<std::unique_ptr<EmitterBase>()>
 

Public Member Functions

LLAPI void publish (Event &, EventIdView const &)
 
LLAPI void publish (std::string_view modName, Event &, EventIdView const &)
 
LLAPI bool setEventEmitter (FactoryFn fn, EventIdView const &eventId, std::weak_ptr< mod::Mod > mod=mod::NativeMod::current())
 
template<std::derived_from< Event > T>
bool setEventEmitter (FactoryFn fn, std::weak_ptr< mod::Mod > mod=mod::NativeMod::current())
 
template<class T >
requires (std::derived_from<std::remove_cvref_t<T>, Event>)
void publish (T &&event)
 
template<class T >
requires (std::derived_from<std::remove_cvref_t<T>, Event>)
void publish (std::string_view modName, T &&event)
 
LLNDAPI coro::Generator< EventIdViewevents (std::string_view modName) const
 
LLNDAPI coro::Generator< std::pair< std::string_view, EventIdView > > events () const
 
LLNDAPI bool hasEvent (EventIdView const &eventId) const
 
LLNDAPI size_t getListenerCount (EventIdView const &)
 
template<std::derived_from< Event > T>
size_t getListenerCount ()
 
LLAPI bool addListener (ListenerPtr const &, EventIdView const &)
 
template<class T , template< class... > class L, class... LT>
requires ((std::derived_from<T, LT> || ...) && std::derived_from<L<LT...>, ListenerBase>)
bool addListener (std::shared_ptr< L< LT... > > const &listener)
 
template<class T = void, template< class... > class L, class... LT>
requires (std::same_as<T, void> && std::derived_from<L<LT...>, ListenerBase>)
bool addListener (std::shared_ptr< L< LT... > > const &listener)
 
template<std::derived_from< Event > T, std::derived_from< ListenerBase > L = Listener<T>, class... Args>
auto emplaceListener (Args &&... args)
 
LLAPI bool removeListener (ListenerPtr const &, EventIdView const &)
 
bool removeListener (ListenerPtr const &listener)
 
template<std::derived_from< Event > T>
bool removeListener (ListenerPtr const &listener)
 
bool hasListener (ListenerPtr const &listener) const
 
template<std::derived_from< Event > T>
bool hasListener (ListenerPtr const &listener) const
 
LLNDAPI ListenerPtr getListener (ListenerId id) const
 
bool removeListener (ListenerId id)
 
template<std::derived_from< Event > T>
bool removeListener (ListenerId id)
 
LLNDAPI bool hasListener (ListenerId, EventIdView const &) const
 
bool hasListener (ListenerId id) const
 
template<std::derived_from< Event > T>
bool hasListener (ListenerId id) const
 

Static Public Member Functions

static LLNDAPI EventBusgetInstance ()
 

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