ezEngine  Milestone 7
ezReflectionUtils Class Reference

Helper functions for handling reflection related operations. More...

#include <ReflectionUtils.h>

Static Public Member Functions

static const ezRTTIGetCommonBaseType (const ezRTTI *pRtti1, const ezRTTI *pRtti2)
 
static bool IsBasicType (const ezRTTI *pRtti)
 
static ezVariant GetMemberPropertyValue (const ezAbstractMemberProperty *pProp, const void *pObject)
 
static void SetMemberPropertyValue (ezAbstractMemberProperty *pProp, void *pObject, const ezVariant &value)
 
static ezVariant GetArrayPropertyValue (const ezAbstractArrayProperty *pProp, const void *pObject, ezUInt32 uiIndex)
 
static void SetArrayPropertyValue (ezAbstractArrayProperty *pProp, void *pObject, ezUInt32 uiIndex, const ezVariant &value)
 
static void InsertSetPropertyValue (ezAbstractSetProperty *pProp, void *pObject, const ezVariant &value)
 
static void RemoveSetPropertyValue (ezAbstractSetProperty *pProp, void *pObject, ezVariant &value)
 
static ezAbstractMemberPropertyGetMemberProperty (const ezRTTI *pRtti, ezUInt32 uiPropertyIndex)
 
static ezAbstractMemberPropertyGetMemberProperty (const ezRTTI *pRtti, const char *szPropertyName)
 
static void GatherTypesDerivedFromClass (const ezRTTI *pRtti, ezSet< const ezRTTI * > &out_types, bool bIncludeDependencies)
 Gathers all RTTI types that are derived from pRtti. More...
 
static void GatherDependentTypes (const ezRTTI *pRtti, ezSet< const ezRTTI * > &inout_types)
 Gathers all RTTI types that pRtti depends on and adds them to inout_types. More...
 
static bool CreateDependencySortedTypeArray (const ezSet< const ezRTTI * > &types, ezDynamicArray< const ezRTTI * > &out_sortedTypes)
 Sorts the input types according to their dependencies. More...
 
static bool EnumerationToString (const ezRTTI *pEnumerationRtti, ezInt64 iValue, ezStringBuilder &out_sOutput)
 Converts an enum or bitfield value into its string representation. More...
 
static bool StringToEnumeration (const ezRTTI *pEnumerationRtti, const char *szValue, ezInt64 &out_iValue)
 Converts an enum or bitfield in its string representation to its value. More...
 
static ezInt64 DefaultEnumerationValue (const ezRTTI *pEnumerationRtti)
 Returns the default value (Enum::Default) for the given enumeration type.
 
static ezInt64 MakeEnumerationValid (const ezRTTI *pEnumerationRtti, ezInt64 iValue)
 Makes sure the given value is valid under the given enumeration type. More...
 

Detailed Description

Helper functions for handling reflection related operations.

Member Function Documentation

bool ezReflectionUtils::CreateDependencySortedTypeArray ( const ezSet< const ezRTTI * > &  types,
ezDynamicArray< const ezRTTI * > &  out_sortedTypes 
)
static

Sorts the input types according to their dependencies.

Types that have no dependences come first in the output followed by types that have their dependencies met by the previous entries in the output. If circular dependencies are found the function returns false.

bool ezReflectionUtils::EnumerationToString ( const ezRTTI pEnumerationRtti,
ezInt64  iValue,
ezStringBuilder out_sOutput 
)
static

Converts an enum or bitfield value into its string representation.

The type of pEnumerationRtti will be automatically detected. The syntax of out_sOutput equals MSVC debugger output.

void ezReflectionUtils::GatherDependentTypes ( const ezRTTI pRtti,
ezSet< const ezRTTI * > &  inout_types 
)
static

Gathers all RTTI types that pRtti depends on and adds them to inout_types.

Dependencies are either member properties or base classes. The output contains the transitive closure of the dependencies. Note that inout_types is not cleared when this function is called.

void ezReflectionUtils::GatherTypesDerivedFromClass ( const ezRTTI pRtti,
ezSet< const ezRTTI * > &  out_types,
bool  bIncludeDependencies 
)
static

Gathers all RTTI types that are derived from pRtti.

This includes all classes that have pRtti as a base class, either direct or indirect. If bIncludeDependencies is set to true, the resulting set will also contain all dependent types.

See Also
GatherDependentTypes
ezInt64 ezReflectionUtils::MakeEnumerationValid ( const ezRTTI pEnumerationRtti,
ezInt64  iValue 
)
static

Makes sure the given value is valid under the given enumeration type.

Invalid bitflag bits are removed and an invalid enum value is replaced by the default value.

bool ezReflectionUtils::StringToEnumeration ( const ezRTTI pEnumerationRtti,
const char *  szValue,
ezInt64 &  out_iValue 
)
static

Converts an enum or bitfield in its string representation to its value.

The type of pEnumerationRtti will be automatically detected. The syntax of szValue must equal the MSVC debugger output.


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