UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::TEventRegistrar< ParamTypes > Class Template Reference

#include <Event.h>

Classes

struct  SRegisteredListener
 

Public Types

using FunctionType = uLang::TFunction< void(ParamTypes...)>
 
using SubscriberId = EventSubscriberId
 

Public Member Functions

template<typename FunctorType , typename = typename TEnableIf< TAnd< TNot<TIsTFunction<typename TDecay<FunctorType>::Type>>, Private::TFuncCanBindToFunctor<void(ParamTypes...), FunctorType> >::Value >::Type>
SubscriberId Subscribe (FunctorType &&InFunc)
 
SubscriberId Subscribe (const FunctionType &Listener)
 
bool Unsubscribe (const SubscriberId ListenerId)
 
bool IsBound () const
 
int32_t Num () const
 
void Reset ()
 

Protected Attributes

SubscriberId _NextId = 0
 
TArray< SRegisteredListener_Listeners
 

Friends

template<typename... >
class TEvent
 

Detailed Description

template<typename... ParamTypes>
class uLang::TEventRegistrar< ParamTypes >

Registration portion of an TEvent<>. Split out as a standalone class, so systems can expose direct registration functionality without exposing execution rights, like so:

 class CMySystem
 {
 public:
     using CMyEvent = TEvent<int>
     CMyEvent::Registrar& GetEvent() { return MyEvent; } // For external subscription
 private:
     CMyEvent MyEvent;

Member Typedef Documentation

◆ FunctionType

template<typename... ParamTypes>
using uLang::TEventRegistrar< ParamTypes >::FunctionType = uLang::TFunction<void(ParamTypes...)>

◆ SubscriberId

template<typename... ParamTypes>
using uLang::TEventRegistrar< ParamTypes >::SubscriberId = EventSubscriberId

Member Function Documentation

◆ IsBound()

template<typename... ParamTypes>
bool uLang::TEventRegistrar< ParamTypes >::IsBound ( ) const
inline

◆ Num()

template<typename... ParamTypes>
int32_t uLang::TEventRegistrar< ParamTypes >::Num ( ) const
inline

◆ Reset()

template<typename... ParamTypes>
void uLang::TEventRegistrar< ParamTypes >::Reset ( )
inline

◆ Subscribe() [1/2]

template<typename... ParamTypes>
SubscriberId uLang::TEventRegistrar< ParamTypes >::Subscribe ( const FunctionType Listener)
inline

◆ Subscribe() [2/2]

template<typename... ParamTypes>
template<typename FunctorType , typename = typename TEnableIf< TAnd< TNot<TIsTFunction<typename TDecay<FunctorType>::Type>>, Private::TFuncCanBindToFunctor<void(ParamTypes...), FunctorType> >::Value >::Type>
SubscriberId uLang::TEventRegistrar< ParamTypes >::Subscribe ( FunctorType &&  InFunc)
inline

◆ Unsubscribe()

template<typename... ParamTypes>
bool uLang::TEventRegistrar< ParamTypes >::Unsubscribe ( const SubscriberId  ListenerId)
inline

Friends And Related Symbol Documentation

◆ TEvent

template<typename... ParamTypes>
template<typename... >
friend class TEvent
friend

Member Data Documentation

◆ _Listeners

template<typename... ParamTypes>
TArray<SRegisteredListener> uLang::TEventRegistrar< ParamTypes >::_Listeners
protected

◆ _NextId

template<typename... ParamTypes>
SubscriberId uLang::TEventRegistrar< ParamTypes >::_NextId = 0
protected

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