ezEngine  Release 25.03
ezScriptRTTI Class Reference
Inheritance diagram for ezScriptRTTI:

Public Types

enum  { NumInplaceFunctions = 7 }
 
using FunctionList = ezSmallArray< ezUniquePtr< ezAbstractFunctionProperty >, NumInplaceFunctions >
 
using MessageHandlerList = ezSmallArray< ezUniquePtr< ezAbstractMessageHandler >, NumInplaceFunctions >
 
- Public Types inherited from ezRTTI
using PredicateFunc = ezDelegate< bool(const ezRTTI *), 48 >
 
using VisitorFunc = ezDelegate< void(const ezRTTI *), 48 >
 

Public Member Functions

 ezScriptRTTI (ezStringView sName, const ezRTTI *pParentType, FunctionList &&functions, MessageHandlerList &&messageHandlers)
 
const ezAbstractFunctionPropertyGetFunctionByIndex (ezUInt32 uiIndex) const
 
- Public Member Functions inherited from ezRTTI
 ezRTTI (ezStringView sName, const ezRTTI *pParentType, ezUInt32 uiTypeSize, ezUInt32 uiTypeVersion, ezUInt8 uiVariantType, ezBitflags< ezTypeFlags > flags, ezRTTIAllocator *pAllocator, ezArrayPtr< const ezAbstractProperty * > properties, ezArrayPtr< const ezAbstractFunctionProperty * > functions, ezArrayPtr< const ezPropertyAttribute * > attributes, ezArrayPtr< ezAbstractMessageHandler * > messageHandlers, ezArrayPtr< ezMessageSenderInfo > messageSenders, const ezRTTI *(*fnVerifyParent)())
 The constructor requires all the information about the type that this object represents.
 
void VerifyCorrectness () const
 Can be called in debug builds to check that all reflected objects are correctly set up.
 
EZ_ALWAYS_INLINE ezStringView GetTypeName () const
 Returns the name of this type.
 
EZ_ALWAYS_INLINE ezUInt64 GetTypeNameHash () const
 Returns the hash of the name of this type.
 
const EZ_ALWAYS_INLINE ezRTTIGetParentType () const
 Returns the type that is the base class of this type. May be nullptr if this type has no base class.
 
EZ_ALWAYS_INLINE ezVariantType::Enum GetVariantType () const
 Returns the corresponding variant type for this type or Invalid if there is none.
 
EZ_ALWAYS_INLINE bool IsDerivedFrom (const ezRTTI *pBaseType) const
 Returns true if this type is derived from the given type (or of the same type).
 
template<typename BASE >
EZ_ALWAYS_INLINE bool IsDerivedFrom () const
 Returns true if this type is derived from or identical to the given type.
 
EZ_ALWAYS_INLINE ezRTTIAllocatorGetAllocator () const
 Returns the object through which instances of this type can be allocated.
 
EZ_ALWAYS_INLINE ezArrayPtr< const ezAbstractProperty *const > GetProperties () const
 Returns the array of properties that this type has. Does NOT include properties from base classes.
 
EZ_ALWAYS_INLINE ezArrayPtr< const ezAbstractFunctionProperty *const > GetFunctions () const
 
EZ_ALWAYS_INLINE ezArrayPtr< const ezPropertyAttribute *const > GetAttributes () const
 
template<typename Type >
const Type * GetAttributeByType () const
 Returns the first attribute that derives from the given type, or nullptr if nothing is found.
 
void GetAllProperties (ezDynamicArray< const ezAbstractProperty * > &out_properties) const
 Returns the list of properties that this type has, including derived properties from all base classes.
 
EZ_ALWAYS_INLINE ezUInt32 GetTypeSize () const
 Returns the size (in bytes) of an instance of this type.
 
EZ_ALWAYS_INLINE ezUInt32 GetTypeVersion () const
 Returns the version number of this type.
 
const EZ_ALWAYS_INLINE ezBitflags< ezTypeFlags > & GetTypeFlags () const
 Returns the type flags.
 
const ezAbstractPropertyFindPropertyByName (ezStringView sName, bool bSearchBaseTypes=true) const
 Will iterate over all properties of this type and (optionally) the base types to search for a property with the given name.
 
EZ_ALWAYS_INLINE ezStringView GetPluginName () const
 Returns the name of the plugin which this type is declared in.
 
const EZ_ALWAYS_INLINE ezArrayPtr< ezAbstractMessageHandler * > & GetMessageHandlers () const
 Returns the array of message handlers that this type has.
 
bool DispatchMessage (void *pInstance, ezMessage &ref_msg) const
 Dispatches the given message to the proper message handler, if there is one available. Returns true if so, false if no message handler for this type exists.
 
bool DispatchMessage (const void *pInstance, ezMessage &ref_msg) const
 Dispatches the given message to the proper message handler, if there is one available. Returns true if so, false if no message handler for this type exists.
 
template<typename MessageType >
EZ_ALWAYS_INLINE bool CanHandleMessage () const
 Returns whether this type can handle the given message type.
 
bool CanHandleMessage (ezMessageId id) const
 Returns whether this type can handle the message type with the given id.
 
const EZ_ALWAYS_INLINE ezArrayPtr< ezMessageSenderInfo > & GetMessageSender () const
 
- Public Member Functions inherited from ezRefCountingImpl
 ezRefCountingImpl ()=default
 Constructor.
 
 ezRefCountingImpl (const ezRefCountingImpl &rhs)
 
void operator= (const ezRefCountingImpl &rhs)
 
ezInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
 
ezInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.
 
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
 
ezInt32 GetRefCount () const
 Returns the current reference count.
 

Additional Inherited Members

- Static Public Member Functions inherited from ezRTTI
static void VerifyCorrectnessForAllTypes ()
 Calls VerifyCorrectness() on all ezRTTI objects.
 
static const ezRTTIFindTypeByName (ezStringView sName)
 Searches all ezRTTI instances for the one with the given name, or nullptr if no such type exists.
 
static const ezRTTIFindTypeByNameHash (ezUInt64 uiNameHash)
 Searches all ezRTTI instances for the one with the given hashed name, or nullptr if no such type exists.
 
static const ezRTTIFindTypeByNameHash32 (ezUInt32 uiNameHash)
 
static const ezRTTIFindTypeIf (PredicateFunc func)
 Searches all ezRTTI instances for one where the given predicate function returns true.
 
static void ForEachType (VisitorFunc func, ezBitflags< ForEachOptions > options=ForEachOptions::Default)
 
static void ForEachDerivedType (const ezRTTI *pBaseType, VisitorFunc func, ezBitflags< ForEachOptions > options=ForEachOptions::Default)
 
template<typename T >
static EZ_ALWAYS_INLINE void ForEachDerivedType (VisitorFunc func, ezBitflags< ForEachOptions > options=ForEachOptions::Default)
 
- Protected Member Functions inherited from ezRTTI
void UpdateType (const ezRTTI *pParentType, ezUInt32 uiTypeSize, ezUInt32 uiTypeVersion, ezUInt8 uiVariantType, ezBitflags< ezTypeFlags > flags)
 
void RegisterType ()
 
void UnregisterType ()
 
void GatherDynamicMessageHandlers ()
 
void SetupParentHierarchy ()
 
- Protected Attributes inherited from ezRTTI
ezStringView m_sPluginName
 
ezStringView m_sTypeName
 
ezArrayPtr< const ezAbstractProperty *const > m_Properties
 
ezArrayPtr< const ezAbstractFunctionProperty *const > m_Functions
 
ezArrayPtr< const ezPropertyAttribute *const > m_Attributes
 
const ezRTTIm_pParentType = nullptr
 
ezRTTIAllocatorm_pAllocator = nullptr
 
ezUInt32 m_uiTypeSize = 0
 
ezUInt32 m_uiTypeVersion = 0
 
ezUInt64 m_uiTypeNameHash = 0
 
ezUInt32 m_uiTypeIndex = 0
 
ezBitflags< ezTypeFlagsm_TypeFlags
 
ezUInt8 m_uiVariantType = 0
 
ezUInt16 m_uiMsgIdOffset = ezSmallInvalidIndex
 
const ezRTTI *(* m_VerifyParent )()
 
ezArrayPtr< ezAbstractMessageHandler * > m_MessageHandlers
 
ezSmallArray< ezAbstractMessageHandler *, 1, ezStaticsAllocatorWrapperm_DynamicMessageHandlers
 
ezArrayPtr< ezMessageSenderInfom_MessageSenders
 
ezSmallArray< const ezRTTI *, 7, ezStaticsAllocatorWrapperm_ParentHierarchy
 

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