![]() |
Plasma Engine
2.0
|
A coroutine type that stores a custom allocator. More...
#include <ScriptCoroutine.h>
Public Member Functions | |
plScriptCoroutineRTTI (plStringView sName, plUniquePtr< plRTTIAllocator > &&pAllocator) | |
![]() | |
plRTTI (plStringView sName, const plRTTI *pParentType, plUInt32 uiTypeSize, plUInt32 uiTypeVersion, plUInt8 uiVariantType, plBitflags< plTypeFlags > flags, plRTTIAllocator *pAllocator, plArrayPtr< const plAbstractProperty * > properties, plArrayPtr< const plAbstractFunctionProperty * > functions, plArrayPtr< const plPropertyAttribute * > attributes, plArrayPtr< plAbstractMessageHandler * > messageHandlers, plArrayPtr< plMessageSenderInfo > messageSenders, const plRTTI *(*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. | |
PL_ALWAYS_INLINE plStringView | GetTypeName () const |
Returns the name of this type. | |
PL_ALWAYS_INLINE plUInt64 | GetTypeNameHash () const |
Returns the hash of the name of this type. | |
PL_ALWAYS_INLINE const plRTTI * | GetParentType () const |
Returns the type that is the base class of this type. May be nullptr if this type has no base class. | |
PL_ALWAYS_INLINE plVariantType::Enum | GetVariantType () const |
Returns the corresponding variant type for this type or Invalid if there is none. | |
PL_ALWAYS_INLINE bool | IsDerivedFrom (const plRTTI *pBaseType) const |
Returns true if this type is derived from the given type (or of the same type). | |
template<typename BASE > | |
PL_ALWAYS_INLINE bool | IsDerivedFrom () const |
Returns true if this type is derived from or identical to the given type. | |
PL_ALWAYS_INLINE plRTTIAllocator * | GetAllocator () const |
Returns the object through which instances of this type can be allocated. | |
PL_ALWAYS_INLINE plArrayPtr< const plAbstractProperty *const > | GetProperties () const |
Returns the array of properties that this type has. Does NOT include properties from base classes. | |
PL_ALWAYS_INLINE plArrayPtr< const plAbstractFunctionProperty *const > | GetFunctions () const |
PL_ALWAYS_INLINE plArrayPtr< const plPropertyAttribute *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 (plDynamicArray< const plAbstractProperty * > &out_properties) const |
Returns the list of properties that this type has, including derived properties from all base classes. | |
PL_ALWAYS_INLINE plUInt32 | GetTypeSize () const |
Returns the size (in bytes) of an instance of this type. | |
PL_ALWAYS_INLINE plUInt32 | GetTypeVersion () const |
Returns the version number of this type. | |
PL_ALWAYS_INLINE const plBitflags< plTypeFlags > & | GetTypeFlags () const |
Returns the type flags. | |
const plAbstractProperty * | FindPropertyByName (plStringView 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. | |
PL_ALWAYS_INLINE plStringView | GetPluginName () const |
Returns the name of the plugin which this type is declared in. | |
PL_ALWAYS_INLINE const plArrayPtr< plAbstractMessageHandler * > & | GetMessageHandlers () const |
Returns the array of message handlers that this type has. | |
bool | DispatchMessage (void *pInstance, plMessage &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, plMessage &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 > | |
PL_ALWAYS_INLINE bool | CanHandleMessage () const |
Returns whether this type can handle the given message type. | |
bool | CanHandleMessage (plMessageId id) const |
Returns whether this type can handle the message type with the given id. | |
PL_ALWAYS_INLINE const plArrayPtr< plMessageSenderInfo > & | GetMessageSender () const |
![]() | |
plRefCountingImpl ()=default | |
Constructor. | |
plRefCountingImpl (const plRefCountingImpl &rhs) | |
void | operator= (const plRefCountingImpl &rhs) |
plInt32 | AddRef () const |
Increments the reference counter. Returns the new reference count. | |
plInt32 | 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. | |
plInt32 | GetRefCount () const |
Returns the current reference count. | |
Additional Inherited Members | |
![]() | |
using | PredicateFunc = plDelegate<bool(const plRTTI*), 48> |
using | VisitorFunc = plDelegate<void(const plRTTI*), 48> |
![]() | |
static void | VerifyCorrectnessForAllTypes () |
Calls VerifyCorrectness() on all plRTTI objects. | |
static const plRTTI * | FindTypeByName (plStringView sName) |
Searches all plRTTI instances for the one with the given name, or nullptr if no such type exists. | |
static const plRTTI * | FindTypeByNameHash (plUInt64 uiNameHash) |
Searches all plRTTI instances for the one with the given hashed name, or nullptr if no such type exists. | |
static const plRTTI * | FindTypeByNameHash32 (plUInt32 uiNameHash) |
static const plRTTI * | FindTypeIf (PredicateFunc func) |
Searches all plRTTI instances for one where the given predicate function returns true. | |
static void | ForEachType (VisitorFunc func, plBitflags< ForEachOptions > options=ForEachOptions::Default) |
static void | ForEachDerivedType (const plRTTI *pBaseType, VisitorFunc func, plBitflags< ForEachOptions > options=ForEachOptions::Default) |
template<typename T > | |
static PL_ALWAYS_INLINE void | ForEachDerivedType (VisitorFunc func, plBitflags< ForEachOptions > options=ForEachOptions::Default) |
![]() | |
void | UpdateType (const plRTTI *pParentType, plUInt32 uiTypeSize, plUInt32 uiTypeVersion, plUInt8 uiVariantType, plBitflags< plTypeFlags > flags) |
void | RegisterType () |
void | UnregisterType () |
void | GatherDynamicMessageHandlers () |
void | SetupParentHierarchy () |
![]() | |
plStringView | m_sPluginName |
plStringView | m_sTypeName |
plArrayPtr< const plAbstractProperty *const > | m_Properties |
plArrayPtr< const plAbstractFunctionProperty *const > | m_Functions |
plArrayPtr< const plPropertyAttribute *const > | m_Attributes |
const plRTTI * | m_pParentType = nullptr |
plRTTIAllocator * | m_pAllocator = nullptr |
plUInt32 | m_uiTypeSize = 0 |
plUInt32 | m_uiTypeVersion = 0 |
plUInt64 | m_uiTypeNameHash = 0 |
plUInt32 | m_uiTypeIndex = 0 |
plBitflags< plTypeFlags > | m_TypeFlags |
plUInt8 | m_uiVariantType = 0 |
plUInt16 | m_uiMsgIdOffset = plSmallInvalidIndex |
const plRTTI *(* | m_VerifyParent )() |
plArrayPtr< plAbstractMessageHandler * > | m_MessageHandlers |
plSmallArray< plAbstractMessageHandler *, 1, plStaticsAllocatorWrapper > | m_DynamicMessageHandlers |
plArrayPtr< plMessageSenderInfo > | m_MessageSenders |
plSmallArray< const plRTTI *, 7, plStaticsAllocatorWrapper > | m_ParentHierarchy |
A coroutine type that stores a custom allocator.
The custom allocator allows to pass more data to the created coroutine object than the default allocator. E.g. this is used to pass the visual script graph to a visual script coroutine without the user needing to know that the coroutine is actually implemented in visual script.