16#include "CoreMinimal.h"
55 template <
typename Self>
63 template <
typename Self>
64 using SelfRef = TSharedRef<std::decay_t<Self>>;
67 template <
typename Self>
71 return SharedThis(&self);
88 template <
typename Derived,
typename Self>
91 if constexpr (CDerivedFrom<Derived, Self>)
93 return StaticCastSharedPtr<Derived>(
A barebones base class for types which may store their type-name as a string.
TSharedPtr< Derived > AsExactly(this Self &&self)
Very simple dynamic casting of this object to a derived top-level type.
virtual ~IHaveType()=default
FORCEINLINE FString GetTypeString() const
FORCEINLINE FName const & GetTypeFName() const
FORCEINLINE FType const & GetType() const
void SetType(this Self &&self)
This function needs to be called on top level derived type for runtime reflection to work.
SelfRef< Self > WithType(this Self &&self)
Fluent API for setting tpye for deferred initialization (for example in factory functions)
TSharedRef< std::decay_t< Self > > SelfRef
This namespace provide some introspection into template instantiations.
auto AsMutablePtr(T *input)
Tired of typing const_cast<FMyLongUnwieldyTypeName*>(...)? use this instead.
FName TTypeFName()
Same as TTypeName converted to FName. This is not cached and a new FName is created every time this i...
C++ native static reflection utilities, not to be confused with reflection of UObjects.
Group together type info for identification. Can have an invalid state when no type is specified.