System.Rtti.TVirtualMethodInterceptor.Proxify

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Proxify(AInstance: TObject);

C++

void __fastcall Proxify(System::TObject* AInstance);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Rtti.pas
System.Rtti.hpp
System.Rtti TVirtualMethodInterceptor

Description

Changes the run-time class of the specified class instance.

Proxify changes the run-time class of the specified instance, AInstance, to the descendant dynamically created by TVirtualMethodInterceptor. This descendent intercepts the virtual methods.

When a class has its virtual methods intercepted by a TVirtualMethodInterceptor instance, the existing class, and instances of it, are unaffected. In order to actually intercept virtual calls on any given instance, the instance needs to be passed to this routine.

To restore the original class, call System.Rtti.TVirtualMethodInterceptor.Unproxify.

Code Examples