45 using Lock = std::recursive_mutex;
46 using Locker = std::lock_guard<Lock>;
56 template <
class Enable,
class... Args>
59 template <
class... Args>
63 RE::BSScript::is_return_convertible<Args>...>>,
89 for (
auto& handle : _handles) {
91 vm->SendEvent(handle, eventName, args);
97 std::tuple args(
VMArg(std::forward<Args>(a_args))...);
101 task->AddTask([args,
this]()
mutable {
108 template <
class Tuple, std::size_t... I>
109 inline void SendEvent_Tuple(Tuple&& a_tuple, std::index_sequence<I...>)
111 SendEvent(std::get<I>(std::forward<Tuple>(a_tuple)).Unpack()...);
141 for (
auto& handle : _handles) {
143 vm->SendEvent(handle, eventName, args);
152 task->AddTask([
this]() {
159 template <
class... Args>
Definition: ActiveEffect.h:27
Definition: BGSBaseAlias.h:12
static VirtualMachine * GetSingleton()
Definition: RegistrationSet.h:20
std::string _eventName
Definition: RegistrationSet.h:52
bool Register(const RE::ActiveEffect *a_effect)
RegistrationSetBase(const std::string_view &a_eventName)
bool Unregister(const RE::ActiveEffect *a_effect)
void Revert(SerializationInterface *)
bool Save(SerializationInterface *a_intfc)
RegistrationSetBase & operator=(const RegistrationSetBase &a_rhs)
bool Register(const RE::BGSBaseAlias *a_alias)
std::lock_guard< Lock > Locker
Definition: RegistrationSet.h:46
RegistrationSetBase()=delete
bool Unregister(RE::VMHandle a_handle)
bool Register(const RE::TESForm *a_form)
bool Unregister(const RE::TESForm *a_form)
bool Register(const void *a_object, RE::VMTypeID a_typeID)
std::set< RE::VMHandle > _handles
Definition: RegistrationSet.h:51
Lock _lock
Definition: RegistrationSet.h:53
bool Unregister(const void *a_object, RE::VMTypeID a_typeID)
std::recursive_mutex Lock
Definition: RegistrationSet.h:45
bool Save(SerializationInterface *a_intfc, std::uint32_t a_type, std::uint32_t a_version)
bool Load(SerializationInterface *a_intfc)
RegistrationSetBase & operator=(RegistrationSetBase &&a_rhs)
RegistrationSetBase(const RegistrationSetBase &a_rhs)
RegistrationSetBase(RegistrationSetBase &&a_rhs)
bool Unregister(const RE::BGSBaseAlias *a_alias)
RegistrationSet(const RegistrationSet &)=default
RegistrationSet & operator=(const RegistrationSet &)=default
void QueueEvent(Args... a_args)
Definition: RegistrationSet.h:95
RegistrationSet(const std::string_view &a_eventName)
Definition: RegistrationSet.h:75
void SendEvent(Args... a_args)
Definition: RegistrationSet.h:84
~RegistrationSet()=default
RegistrationSet(RegistrationSet &&)=default
RegistrationSet & operator=(RegistrationSet &&)=default
RegistrationSet(const std::string_view &a_eventName)
Definition: RegistrationSet.h:126
~RegistrationSet()=default
void QueueEvent()
Definition: RegistrationSet.h:148
void SendEvent()
Definition: RegistrationSet.h:135
RegistrationSet & operator=(RegistrationSet &&)=default
RegistrationSet(const RegistrationSet &)=default
RegistrationSet & operator=(const RegistrationSet &)=default
RegistrationSet(RegistrationSet &&)=default
Definition: RegistrationSet.h:57
Definition: Interfaces.h:82
std::uint32_t VMTypeID
Definition: BSCoreTypes.h:9
std::uint64_t VMHandle
Definition: BSCoreTypes.h:7
BSScript::IFunctionArguments * MakeFunctionArguments(Args &&... a_args)
Definition: FunctionArguments.h:80
VMArg(T &&) -> VMArg< T >
string(const CharT(&)[N]) -> string< CharT, N - 1 >
const TaskInterface * GetTaskInterface() noexcept
Definition: EffectArchetypes.h:65
Definition: RegistrationTraits.h:40