System.Rtti.TRttiContext.GetType
Delphi
function GetType(ATypeInfo: Pointer): TRttiType; overload;
function GetType(AClass: TClass): TRttiType; overload;
C++
TRttiType* __fastcall GetType(void * ATypeInfo)/* overload */;
TRttiType* __fastcall GetType(System::TClass AClass)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Rtti.pas System.Rtti.hpp |
System.Rtti | TRttiContext |
Description
Returns a TRttiType instance used to reflect the given type.
Use GetType to obtain an RTTI object that describes the given type. There are two variants of the GetType method:
- One that accepts a pointer to an RTTI data block that describes the type. The pointer can be obtained by using the TypeInfo standard operator.
- One that accepts a class reference for which to obtain the RTTI type object.
You cannot use GetType on a Delphi type that does not provide type information.
See Also
Code Examples