System.Rtti.TRawVirtualClass

From RAD Studio API Documentation
Jump to: navigation, search

System.TInterfacedObjectSystem.TObjectTRawVirtualClass

Delphi

TRawVirtualClass = class(TInterfacedObject, IInterface)

C++

class PASCALIMPLEMENTATION TRawVirtualClass : public System::TInterfacedObject

Properties

Type Visibility Source Unit Parent
class public
System.Rtti.pas
System.Rtti.hpp
System.Rtti System.Rtti

Description

Provides a basis for dynamically creating instances that implement interfaces.

The TRawVirtualClass object provides a basis for dynamically creating instances that implement interfaces. The support implemented by this class is extremely raw. You create an instance of a virtual class by handing it a VTable. The VTable is a specialized type defined as a subclass of TRawVirtualClass. The VTable will be populated with slots that point to small thunks that dispatch to user code.

The basic usage model is to construct a virtual class with a VTable, and a list of GUIDs of interfaces that the VTable matches. Thus, if you have an interface declared to inherit a line of several parents, the single VTable will represent each of the parent interfaces.

TRawVirtualClass implements QueryInterface, AddRef, and Release for the interface, so that you can query an instance and get back a Delphi interface that can be used as if it were any Delphi interface.

See Also