43 using Lock = std::recursive_mutex;
44 using Locker = std::lock_guard<Lock>;
54 template <
class Enable,
class... Args>
57 template <
class... Args>
61 RE::BSScript::is_return_convertible<Args>...>>,
87 for (
auto& handle : _handles) {
89 vm->SendEvent(handle, eventName, args);
95 std::tuple args(
VMArg(std::forward<Args>(a_args))...);
99 task->AddTask([args,
this]()
mutable {
106 template <
class Tuple, std::size_t... I>
107 inline void SendEvent_Tuple(Tuple&& a_tuple, std::index_sequence<I...>)
109 SendEvent(std::get<I>(std::forward<Tuple>(a_tuple)).Unpack()...);
139 for (
auto& handle : _handles) {
141 vm->SendEvent(handle, eventName, args);
150 task->AddTask([
this]() {
157 template <
class... Args>
Definition: ActiveEffect.h:22
Definition: BGSBaseAlias.h:12
static VirtualMachine * GetSingleton()
Definition: RegistrationSet.h:20
std::string _eventName
Definition: RegistrationSet.h:50
bool Register(const RE::ActiveEffect *a_effect)
RegistrationSetBase(const std::string_view &a_eventName)
bool Unregister(const RE::ActiveEffect *a_effect)
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:44
RegistrationSetBase()=delete
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:49
Lock _lock
Definition: RegistrationSet.h:51
bool Unregister(const void *a_object, RE::VMTypeID a_typeID)
std::recursive_mutex Lock
Definition: RegistrationSet.h:43
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:93
RegistrationSet(const std::string_view &a_eventName)
Definition: RegistrationSet.h:73
void SendEvent(Args... a_args)
Definition: RegistrationSet.h:82
~RegistrationSet()=default
RegistrationSet(RegistrationSet &&)=default
RegistrationSet & operator=(RegistrationSet &&)=default
RegistrationSet(const std::string_view &a_eventName)
Definition: RegistrationSet.h:124
~RegistrationSet()=default
void QueueEvent()
Definition: RegistrationSet.h:146
void SendEvent()
Definition: RegistrationSet.h:133
RegistrationSet & operator=(RegistrationSet &&)=default
RegistrationSet(const RegistrationSet &)=default
RegistrationSet & operator=(const RegistrationSet &)=default
RegistrationSet(RegistrationSet &&)=default
Definition: RegistrationSet.h:55
Definition: Interfaces.h:71
std::uint32_t VMTypeID
Definition: BSCoreTypes.h:9
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: NiBinaryStream.h:94
Definition: RegistrationTraits.h:40