5#include <Foundation/Reflection/Implementation/DynamicRTTI.h>
8PL_WARNING_DISABLE_CLANG("-Wunused-local-typedef")
9PL_WARNING_DISABLE_GCC("-Wunused-local-typedefs")
18 PL_ASSERT_DEV(pObject ==
nullptr || pObject->IsInstanceOf<NonPointerT>(),
"Invalid static cast: Object of type '{0}' is not an instance of '{1}'",
19 pObject->GetDynamicRTTI()->GetTypeName(), plGetStaticRTTI<NonPointerT>()->GetTypeName());
20 return static_cast<T
>(pObject);
30 PL_ASSERT_DEV(pObject ==
nullptr || pObject->
IsInstanceOf<NonPointerT>(),
"Invalid static cast: Object of type '{0}' is not an instance of '{1}'",
31 pObject->GetDynamicRTTI()->
GetTypeName(), plGetStaticRTTI<NonPointerT>()->GetTypeName());
32 return static_cast<T
>(pObject);
42 PL_ASSERT_DEV(in_object.
IsInstanceOf<NonReferenceT>(),
"Invalid static cast: Object of type '{0}' is not an instance of '{1}'",
43 in_object.GetDynamicRTTI()->
GetTypeName(), plGetStaticRTTI<NonReferenceT>()->GetTypeName());
44 return static_cast<T
>(in_object);
54 PL_ASSERT_DEV(
object.IsInstanceOf<NonReferenceT>(),
"Invalid static cast: Object of type '{0}' is not an instance of '{1}'",
55 object.GetDynamicRTTI()->GetTypeName(), plGetStaticRTTI<NonReferenceT>()->GetTypeName());
56 return static_cast<T
>(object);
70 return static_cast<T
>(pObject);
87 return static_cast<T
>(pObject);
PL_ALWAYS_INLINE plStringView GetTypeName() const
Returns the name of this type.
Definition RTTI.h:48
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
bool IsInstanceOf(const plRTTI *pType) const
Returns whether the type of this instance is of the given type or derived from it.
Definition DynamicRTTI.cpp:6
typename std::remove_const< typename std::remove_reference< T >::type >::type NonConstReferenceType
removes reference and const qualifier
Definition TypeTraits.h:218
typename std::remove_const< typename std::remove_reference< typename std::remove_pointer< T >::type >::type >::type NonConstReferencePointerType
removes reference, const and pointer qualifier Note that this removes the const and reference of the ...
Definition TypeTraits.h:225
typename std::remove_pointer< T >::type NonPointerType
removes pointer
Definition TypeTraits.h:215
typename std::remove_reference< T >::type NonReferenceType
removes reference
Definition TypeTraits.h:212