The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for the ‘Delphi XE’ Category

Delphi: TRttiContext.GetType versus TRttiContext.GetTypes is not about singular versus plural, but about all versus public types

Posted by jpluimers on 2014/03/25

I’m so glad I just bumped into the below quote of at Delphi sorcery: CodeRage 6 feedback and DSharp news:

He put an entire class into the implementation part of a unit registering it to the container in the initialization part of the unit. I mentioned the dependency on the container in that case and tried something else: using TRttiContext.GetTypes to iterate all known types looking for attributes that tell to register that type. But it did not list the class in the implementation part of the unit. The class was not thrown out by the smart linker because it was actually used. It just seems to be the case that GetTypes does not find any types in the implementation part while GetType(…) works.

I bumped into this for interface and class types a while ago when writing demos for the upcoming Coding In Delphi book by Nick Hodges.

Part of the demo is RttiHelper.pas, which in part consists of record helpers that extend TRttiContext.

TRttiContext has a few methods, of which FindType, the GetType overloads and GetTypes are the most interesting ones. At first glance, you’d think the get* methods would return results in the same way: GetTypes just returns all the types that GetType could return. But that is not true. GetTypes should have been named after FindType.

FindType already gives you a hint in its parameter `AQualifiedName: string` and the decription:

FindType searches for the type in all packages and works only for public types that have qualified names.

Private types (types in the implementation section of units) do not get qualified names.

In fact, then you call the method TRttiType.QualifiedName on a type that is in the interface section (private) it won’t find any, and return an error like this::

ENonPublicType: Type ‘IPrivateImplementedInterface’ is not declared in the interface section of a unit.

So I introduced TRttiTypeHelper and named all methods that depend on GetTypes with the name FindType or FindTypes:


type
TRttiTypeHelper = class helper for TRttiType
function GetBestName(): string; virtual;
function GetUnitName(): string; virtual;
end;
function TRttiTypeHelper.GetBestName(): string;
begin
// you cannot ask for QualifiedName on a non-public RttiType
if Self.IsPublicType then
Result := Self.QualifiedName
else
Result := Self.Name;
end;
function TRttiTypeHelper.GetUnitName(): string;
begin
Result := Copy(QualifiedName, 1, Length(QualifiedName) – Length(Name) – 1);
end;

Two notes here:

  1. There are two other exceptions Rtti can get you: EInsufficientRtti and EInvocationError. I won’t go into detail in this posting, maybe in a later one.
  2. System.TObject.QualifiedClassName does not suffer from the limitation: it just shows you the unit name for both private and public types.

The second note came to me as a big surprise: the RTTI infrastructure things differently about qualified names than TObject!

To demonstrate this, I’ve written the unit RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit:


unit RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit;
interface
type
IPublicImplementedInterface = interface(IInterface)
['{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}']
end;
IPublicNonImplementedInterface = interface(IInterface)
['{AD72354C-BD8D-4453-8838-A9C261115A25}']
end;
IPublicNonImplementedInterfaceThatHasNoTypeInfoCalls = interface(IInterface)
['{A846E993-EF55-4463-93F1-E7979D17F605}']
end;
TPublicImplementingObject = class(TInterfacedObject, IPublicImplementedInterface)
end;
IPublicImplementedInterfaceThatHasNoTypeInfoCalls = interface(IInterface)
['{D471001B-77CA-4B8E-87D4-1AF1F17C0128}']
end;
TPublicImplementingObjectWithoutTypeInfoCalls = class(TInterfacedObject, IPublicImplementedInterfaceThatHasNoTypeInfoCalls)
end;
procedure Main();
implementation
uses
System.Rtti,
RttiContext_GetTypes_vs_GetType_on_Interfaces_ConsoleReportUnit;
type
IPrivateImplementedInterface = interface(IInterface)
['{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}']
end;
IPrivateNonImplementedInterface = interface(IInterface)
['{AD72354C-BD8D-4453-8838-A9C261115A25}']
end;
IPrivateNonImplementedInterfaceThatHasNoTypeInfoCalls = interface(IInterface)
['{A846E993-EF55-4463-93F1-E7979D17F605}']
end;
TPrivateImplementingObject = class(TInterfacedObject, IPrivateImplementedInterface)
end;
IPrivateImplementedInterfaceThatHasNoTypeInfoCalls = interface(IInterface)
['{D471001B-77CA-4B8E-87D4-1AF1F17C0128}']
end;
TPrivateImplementingObjectWithoutTypeInfoCalls = class(TInterfacedObject, IPrivateImplementedInterfaceThatHasNoTypeInfoCalls)
end;
procedure Main();
var
PublicImplementedInterfaceReference: IPublicImplementedInterface;
PublicImplementedInterfaceThatHasNoTypeInfoCallsReference: IPublicImplementedInterfaceThatHasNoTypeInfoCalls;
PrivateImplementedInterfaceReference: IPrivateImplementedInterface;
PrivateImplementedInterfaceThatHasNoTypeInfoCallsReference: IPrivateImplementedInterfaceThatHasNoTypeInfoCalls;
RttiContext: TRttiContext;
begin
PublicImplementedInterfaceReference := TPublicImplementingObject.Create();
PublicImplementedInterfaceThatHasNoTypeInfoCallsReference := TPublicImplementingObjectWithoutTypeInfoCalls.Create();
PrivateImplementedInterfaceReference := TPrivateImplementingObject.Create();
PrivateImplementedInterfaceThatHasNoTypeInfoCallsReference := TPrivateImplementingObjectWithoutTypeInfoCalls.Create();
RttiContext := TRttiContext.Create();
try
{TODO -o##jwp -cExtend : see what happens if we interface them from another unit}
ReportRttiTypes(RttiContext, IInterface, 'IInterface', TypeInfo(IInterface));
Writeln;
ReportRttiTypes(RttiContext, IPublicImplementedInterface, 'IPublicImplementedInterface', TypeInfo(IPublicImplementedInterface));
ReportRttiTypes(RttiContext, IPublicNonImplementedInterface, 'IPublicNonImplementedInterface', TypeInfo(IPublicNonImplementedInterface));
// we don't want to call TypeInfo on IPublicNonImplementedInterfaceThatHasNoTypeInfoCalls and IPublicImplementedInterfaceThatHasNoTypeInfoCalls
ReportRttiTypes(RttiContext, IPublicNonImplementedInterfaceThatHasNoTypeInfoCalls, 'IPublicNonImplementedInterfaceThatHasNoTypeInfoCalls', nil);
ReportRttiTypes(RttiContext, IPublicImplementedInterfaceThatHasNoTypeInfoCalls, 'IPublicImplementedInterfaceThatHasNoTypeInfoCalls', nil);
Writeln;
ReportRttiTypes(RttiContext, IPrivateImplementedInterface, 'IPrivateImplementedInterface', TypeInfo(IPrivateImplementedInterface));
ReportRttiTypes(RttiContext, IPrivateNonImplementedInterface, 'IPrivateNonImplementedInterface', TypeInfo(IPrivateNonImplementedInterface));
// we don't want to call TypeInfo on IPrivateNonImplementedInterfaceThatHasNoTypeInfoCalls and IPrivateImplementedInterfaceThatHasNoTypeInfoCalls
ReportRttiTypes(RttiContext, IPrivateNonImplementedInterfaceThatHasNoTypeInfoCalls, 'IPrivateNonImplementedInterfaceThatHasNoTypeInfoCalls', nil);
ReportRttiTypes(RttiContext, IPrivateImplementedInterfaceThatHasNoTypeInfoCalls, 'IPrivateImplementedInterfaceThatHasNoTypeInfoCalls', nil);
Writeln;
ReportImplementedInterfacesByClass(RttiContext, TPublicImplementingObject);
ReportImplementedInterfacesByClass(RttiContext, TPublicImplementingObjectWithoutTypeInfoCalls);
Writeln;
ReportImplementedInterfacesByClass(RttiContext, TPrivateImplementingObject);
ReportImplementedInterfacesByClass(RttiContext, TPrivateImplementingObjectWithoutTypeInfoCalls);
finally
RttiContext.Free;
end;
end;
end.

Together with RttiContext_GetTypes_vs_GetType_on_Interfaces_ConsoleReportUnit it will return the output at the end of the post of which I’ll show two excertps

You see the really odd lines there:

Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best private name "IPrivateImplementedInterface"
Found GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}" with best private name "IPrivateNonImplementedInterface"
private "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPrivateImplementingObject" with RTTI name "TPrivateImplementingObject"
private "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPrivateImplementingObjectWithoutTypeInfoCalls" with RTTI name "TPrivateImplementingObjectWithoutTypeInfoCalls

There you clearly see the difference between the two ways of getting a qualified name. Very confusing!

The other amazing thing is that GetTypes does not work for anything private in the implementation section:

public best name "RttiHelpers.TRttiTypeHelper" with QualifiedClassName "RttiHelpers.TRttiTypeHelper"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterface"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInterface"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObject" with QualifiedClassName "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObject"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfaceThatHasNoTypeInfoCalls"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls" with QualifiedClassName "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls"

–jeroen

via: Delphi sorcery: CodeRage 6 feedback and DSharp news.


TRttiType occurances for interface "IInterface" with GUID "{00000000-0000-0000-C000-000000000046}"
GUID from InterfaceTypeInfo: {00000000-0000-0000-C000-000000000046}
RttiInterfaceType found by TypeInfo:
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
RttiInterfaceType found by GUID:
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
RTTI by GUID and RTTI by TypeInfo have the same GUID: {00000000-0000-0000-C000-000000000046}
TRttiType occurances for interface "IPublicImplementedInterface" with GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}"
GUID from InterfaceTypeInfo: {E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}
RttiInterfaceType found by TypeInfo:
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfac
e"
RttiInterfaceType found by GUID:
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfac
e"
RTTI by GUID and RTTI by TypeInfo have the same GUID: {E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}
TRttiType occurances for interface "IPublicNonImplementedInterface" with GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}"
GUID from InterfaceTypeInfo: {AD72354C-BD8D-4453-8838-A9C261115A25}
RttiInterfaceType found by TypeInfo:
Found GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInter
face"
RttiInterfaceType found by GUID:
Found GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInter
face"
RTTI by GUID and RTTI by TypeInfo have the same GUID: {AD72354C-BD8D-4453-8838-A9C261115A25}
TRttiType occurances for interface "IPublicNonImplementedInterfaceThatHasNoTypeInfoCalls" with GUID "{A846E993-EF55-4463-93F1-E7979D17F605}"
no InterfaceTypeInfo
RttiInterfaceType not found through GUID "{A846E993-EF55-4463-93F1-E7979D17F605}"
RTTI by GUID and RTTI by TypeInfo are both nil.
TRttiType occurances for interface "IPublicImplementedInterfaceThatHasNoTypeInfoCalls" with GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}"
no InterfaceTypeInfo
RttiInterfaceType found by GUID:
Found GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfac
eThatHasNoTypeInfoCalls"
RTTI by TypeInfo is nil, but RTTI by GUID has a GUID: {D471001B-77CA-4B8E-87D4-1AF1F17C0128}
TRttiType occurances for interface "IPrivateImplementedInterface" with GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}"
GUID from InterfaceTypeInfo: {E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}
name mismatch: RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterface <> IPrivateImplementedInterface
RttiInterfaceType found by TypeInfo:
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best private name "IPrivateImplementedInterface"
RttiInterfaceType found by GUID:
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfac
e"
RTTI by GUID and RTTI by TypeInfo have the same GUID: {E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}
TRttiType occurances for interface "IPrivateNonImplementedInterface" with GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}"
GUID from InterfaceTypeInfo: {AD72354C-BD8D-4453-8838-A9C261115A25}
name mismatch: RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInterface <> IPrivateNonImplementedInterface
RttiInterfaceType found by TypeInfo:
Found GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}" with best private name "IPrivateNonImplementedInterface"
RttiInterfaceType found by GUID:
Found GUID "{AD72354C-BD8D-4453-8838-A9C261115A25}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInter
face"
RTTI by GUID and RTTI by TypeInfo have the same GUID: {AD72354C-BD8D-4453-8838-A9C261115A25}
TRttiType occurances for interface "IPrivateNonImplementedInterfaceThatHasNoTypeInfoCalls" with GUID "{A846E993-EF55-4463-93F1-E7979D17F605}"
no InterfaceTypeInfo
RttiInterfaceType not found through GUID "{A846E993-EF55-4463-93F1-E7979D17F605}"
RTTI by GUID and RTTI by TypeInfo are both nil.
TRttiType occurances for interface "IPrivateImplementedInterfaceThatHasNoTypeInfoCalls" with GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}"
no InterfaceTypeInfo
RttiInterfaceType found by GUID:
Found GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfac
eThatHasNoTypeInfoCalls"
RTTI by TypeInfo is nil, but RTTI by GUID has a GUID: {D471001B-77CA-4B8E-87D4-1AF1F17C0128}
public "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObject" with RTTI name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit
.TPublicImplementingObject"
implements 1 interfaces:
Interface at index 0 has GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}"
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterface"
public "System.TInterfacedObject" with RTTI name "System.TInterfacedObject"
implements 1 interfaces:
Interface at index 0 has GUID "{00000000-0000-0000-C000-000000000046}"
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
public "System.TObject" implements no interfaces
public "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls" with RTTI name "RttiContext_GetTypes_vs_GetType_on
_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls"
implements 1 interfaces:
Interface at index 0 has GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}"
Found GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfaceT
hatHasNoTypeInfoCalls"
public "System.TInterfacedObject" with RTTI name "System.TInterfacedObject"
implements 1 interfaces:
Interface at index 0 has GUID "{00000000-0000-0000-C000-000000000046}"
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
public "System.TObject" implements no interfaces
private "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPrivateImplementingObject" with RTTI name "TPrivateImplementingObject"
implements 1 interfaces:
Interface at index 0 has GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}"
Found GUID "{E1962EFF-64CD-4ABB-9C44-1503E3CE77A9}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterface"
public "System.TInterfacedObject" with RTTI name "System.TInterfacedObject"
implements 1 interfaces:
Interface at index 0 has GUID "{00000000-0000-0000-C000-000000000046}"
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
public "System.TObject" implements no interfaces
private "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPrivateImplementingObjectWithoutTypeInfoCalls" with RTTI name "TPrivateImplementingObjectWithou
tTypeInfoCalls"
implements 1 interfaces:
Interface at index 0 has GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}"
Found GUID "{D471001B-77CA-4B8E-87D4-1AF1F17C0128}" with best public name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfaceT
hatHasNoTypeInfoCalls"
public "System.TInterfacedObject" with RTTI name "System.TInterfacedObject"
implements 1 interfaces:
Interface at index 0 has GUID "{00000000-0000-0000-C000-000000000046}"
Found GUID "{00000000-0000-0000-C000-000000000046}" with best public name "System.IInterface"
public "System.TObject" implements no interfaces
public best name "RttiHelpers.TRttiTypeHelper" with QualifiedClassName "RttiHelpers.TRttiTypeHelper"
public best name "System.SysUtils.TLangRec"
public best name "System.SysUtils.TLanguages" with QualifiedClassName "System.SysUtils.TLanguages"
public best name "System.SysUtils.Exception" with QualifiedClassName "System.SysUtils.Exception"
public best name "System.SysUtils.EArgumentException" with QualifiedClassName "System.SysUtils.EArgumentException"
public best name "System.SysUtils.EArgumentOutOfRangeException" with QualifiedClassName "System.SysUtils.EArgumentOutOfRangeException"
public best name "System.SysUtils.EListError" with QualifiedClassName "System.SysUtils.EListError"
public best name "System.SysUtils.EInvalidOpException" with QualifiedClassName "System.SysUtils.EInvalidOpException"
public best name "System.SysUtils.EHeapException" with QualifiedClassName "System.SysUtils.EHeapException"
public best name "System.SysUtils.EOutOfMemory" with QualifiedClassName "System.SysUtils.EOutOfMemory"
public best name "System.SysUtils.EInOutError" with QualifiedClassName "System.SysUtils.EInOutError"
public best name "System.SysUtils.EExternal" with QualifiedClassName "System.SysUtils.EExternal"
public best name "System.SysUtils.EExternalException" with QualifiedClassName "System.SysUtils.EExternalException"
public best name "System.SysUtils.EIntError" with QualifiedClassName "System.SysUtils.EIntError"
public best name "System.SysUtils.EDivByZero" with QualifiedClassName "System.SysUtils.EDivByZero"
public best name "System.SysUtils.ERangeError" with QualifiedClassName "System.SysUtils.ERangeError"
public best name "System.SysUtils.EIntOverflow" with QualifiedClassName "System.SysUtils.EIntOverflow"
public best name "System.SysUtils.EMathError" with QualifiedClassName "System.SysUtils.EMathError"
public best name "System.SysUtils.EInvalidOp" with QualifiedClassName "System.SysUtils.EInvalidOp"
public best name "System.SysUtils.EZeroDivide" with QualifiedClassName "System.SysUtils.EZeroDivide"
public best name "System.SysUtils.EOverflow" with QualifiedClassName "System.SysUtils.EOverflow"
public best name "System.SysUtils.EUnderflow" with QualifiedClassName "System.SysUtils.EUnderflow"
public best name "System.SysUtils.EInvalidPointer" with QualifiedClassName "System.SysUtils.EInvalidPointer"
public best name "System.SysUtils.EInvalidCast" with QualifiedClassName "System.SysUtils.EInvalidCast"
public best name "System.SysUtils.EConvertError" with QualifiedClassName "System.SysUtils.EConvertError"
public best name "System.SysUtils.EAccessViolation" with QualifiedClassName "System.SysUtils.EAccessViolation"
public best name "System.SysUtils.EPrivilege" with QualifiedClassName "System.SysUtils.EPrivilege"
public best name "System.SysUtils.EStackOverflow" with QualifiedClassName "System.SysUtils.EStackOverflow"
public best name "System.SysUtils.EControlC" with QualifiedClassName "System.SysUtils.EControlC"
public best name "System.SysUtils.EVariantError" with QualifiedClassName "System.SysUtils.EVariantError"
public best name "System.SysUtils.EPropReadOnly" with QualifiedClassName "System.SysUtils.EPropReadOnly"
public best name "System.SysUtils.EPropWriteOnly" with QualifiedClassName "System.SysUtils.EPropWriteOnly"
public best name "System.SysUtils.EAssertionFailed" with QualifiedClassName "System.SysUtils.EAssertionFailed"
public best name "System.SysUtils.EAbstractError" with QualifiedClassName "System.SysUtils.EAbstractError"
public best name "System.SysUtils.EIntfCastError" with QualifiedClassName "System.SysUtils.EIntfCastError"
public best name "System.SysUtils.EOSError" with QualifiedClassName "System.SysUtils.EOSError"
public best name "System.SysUtils.ESafecallException" with QualifiedClassName "System.SysUtils.ESafecallException"
public best name "System.SysUtils.EMonitor" with QualifiedClassName "System.SysUtils.EMonitor"
public best name "System.SysUtils.EMonitorLockException" with QualifiedClassName "System.SysUtils.EMonitorLockException"
public best name "System.SysUtils.ENoMonitorSupportException" with QualifiedClassName "System.SysUtils.ENoMonitorSupportException"
public best name "System.SysUtils.ENotImplemented" with QualifiedClassName "System.SysUtils.ENotImplemented"
public best name "System.SysUtils.EObjectDisposed" with QualifiedClassName "System.SysUtils.EObjectDisposed"
public best name "System.SysUtils.TFormatSettings.TEraInfo"
public best name "System.SysUtils.TFormatSettings"
public best name "System.SysUtils.IReadWriteSync"
public best name "System.SysUtils.PThreadInfo"
public best name "System.SysUtils.TThreadInfo"
public best name "System.SysUtils.TThreadLocalCounter" with QualifiedClassName "System.SysUtils.TThreadLocalCounter"
public best name "System.SysUtils.TMultiReadExclusiveWriteSynchronizer" with QualifiedClassName "System.SysUtils.TMultiReadExclusiveWriteSynchronizer"
public best name "System.SysUtils.TStringBuilder" with QualifiedClassName "System.SysUtils.TStringBuilder"
public best name "System.SysUtils.EEncodingError" with QualifiedClassName "System.SysUtils.EEncodingError"
public best name "System.SysUtils.TEncoding" with QualifiedClassName "System.SysUtils.TEncoding"
public best name "System.SysUtils.TMBCSEncoding" with QualifiedClassName "System.SysUtils.TMBCSEncoding"
public best name "System.SysUtils.TUTF7Encoding" with QualifiedClassName "System.SysUtils.TUTF7Encoding"
public best name "System.SysUtils.TUTF8Encoding" with QualifiedClassName "System.SysUtils.TUTF8Encoding"
public best name "System.SysUtils.TUnicodeEncoding" with QualifiedClassName "System.SysUtils.TUnicodeEncoding"
public best name "System.SysUtils.TBigEndianUnicodeEncoding" with QualifiedClassName "System.SysUtils.TBigEndianUnicodeEncoding"
public best name "System.SysUtils.TMarshaller.PDisposeRec"
public best name "System.SysUtils.TMarshaller.TDisposeProc"
public best name "System.SysUtils.TMarshaller.TDisposeRec"
public best name "System.SysUtils.TMarshaller.IDisposer"
public best name "System.SysUtils.TMarshaller.TDisposer" with QualifiedClassName "System.SysUtils.TMarshaller.TDisposer"
public best name "System.SysUtils.TMarshaller"
public best name "System.SysUtils.TFunc<System.TArray<System.TCustomAttribute>>"
public best name "System.TArray<System.Rtti.TRttiType>"
public best name "System.TArray<System.Byte>"
public best name "System.Boolean"
public best name "System.AnsiChar"
public best name "System.Char"
public best name "System.ShortInt"
public best name "System.SmallInt"
public best name "System.Integer"
public best name "System.Byte"
public best name "System.Word"
public best name "System.Pointer"
public best name "System.Cardinal"
public best name "System.Int64"
public best name "System.UInt64"
public best name "System.NativeInt"
public best name "System.NativeUInt"
public best name "System.Single"
public best name "System.Extended"
public best name "System.Double"
public best name "System.Comp"
public best name "System.Currency"
public best name "System.ShortString"
public best name "System.PAnsiChar"
public best name "System.PWideChar"
public best name "System.ByteBool"
public best name "System.WordBool"
public best name "System.LongBool"
public best name "System.string"
public best name "System.WideString"
public best name "System.AnsiString"
public best name "System.Variant"
public best name "System.TClass"
public best name "System.HRESULT"
public best name "System.TGUID"
public best name "System.PInterfaceEntry"
public best name "System.TInterfaceEntry"
public best name "System.PInterfaceTable"
public best name "System.TInterfaceTable"
public best name "System.TMethod"
public best name "System.TObject" with QualifiedClassName "System.TObject"
public best name "System.TCustomAttribute" with QualifiedClassName "System.TCustomAttribute"
public best name "System.WeakAttribute" with QualifiedClassName "System.WeakAttribute"
public best name "System.VolatileAttribute" with QualifiedClassName "System.VolatileAttribute"
public best name "System.IInterface"
public best name "System.IEnumerable"
public best name "System.IDispatch"
public best name "System.TInterfacedObject" with QualifiedClassName "System.TInterfacedObject"
public best name "System.TClassHelperBase" with QualifiedClassName "System.TClassHelperBase"
public best name "System.PShortString"
public best name "System.UTF8String"
public best name "System.RawByteString"
public best name "System.PByte"
public best name "System.PInt64"
public best name "System.PExtended"
public best name "System.PCurrency"
public best name "System.PVariant"
public best name "System.TDateTime"
public best name "System.TDate"
public best name "System.TTime"
public best name "System.TVarArrayBound"
public best name "System.TVarArrayBoundArray"
public best name "System.PVarArray"
public best name "System.TVarArray"
public best name "System.TVarRecord"
public best name "System.TVarData"
public best name "System.TVarRec"
public best name "System.TPtrWrapper"
public best name "System.TMarshal" with QualifiedClassName "System.TMarshal"
public best name "System.TTypeTable"
public best name "System.PTypeTable"
public best name "System.PPackageTypeInfo"
public best name "System.TPackageTypeInfo"
public best name "System.TArray<System.Char>"
public best name "System.TArray<System.Word>"
public best name "System.TArray<System.ShortInt>"
public best name "System.TArray<System.SmallInt>"
public best name "System.TArray<System.Integer>"
public best name "System.TArray<System.Int64>"
public best name "System.TArray<System.TPtrWrapper>"
public best name "System.PLibModule"
public best name "System.TLibModule"
public best name "System.PResStringRec"
public best name "System.TResStringRec"
public best name "System.TFloatSpecial"
public best name "System.TExtended80Rec"
public best name "System.PExceptionRecord"
public best name "System.TExceptionRecord"
public best name "System.TArray<System.IInterface>"
public best name "System.IEnumerable<System.IInterface>"
public best name "System.TArray<System.Classes.TCollectionItem>"
public best name "System.IEnumerable<System.Classes.TCollectionItem>"
public best name "System.TArray<System.string>"
public best name "System.TArray<System.TObject>"
public best name "System.IEnumerable<System.TObject>"
public best name "System.TArray<System.Classes.TComponent>"
public best name "System.IEnumerable<System.Classes.TComponent>"
public best name "System.TArray<System.Classes.TPair<System.Integer,System.Classes.IInterfaceList>>"
public best name "System.TArray<System.Classes.IInterfaceList>"
public best name "System.TArray<System.Classes.TBasicActionLink>"
public best name "System.IEnumerable<System.Classes.TBasicActionLink>"
public best name "System.TArray<System.SysUtils.TLangRec>"
public best name "System.IEnumerable<System.string>"
public best name "System.TArray<System.SysUtils.TMarshaller.TDisposeRec>"
public best name "System.TArray<System.TCustomAttribute>"
public best name "System.TArray<System.Rtti.TRttiMethod>"
public best name "System.TArray<System.Rtti.TRttiField>"
public best name "System.TArray<System.Rtti.TRttiProperty>"
public best name "System.TArray<System.Rtti.TRttiIndexedProperty>"
public best name "System.TArray<System.Rtti.TRttiManagedField>"
public best name "System.TArray<System.Rtti.TValue>"
public best name "System.TArray<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.IEnumerable<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.TArray<System.Rtti.TRttiParameter>"
public best name "System.TArray<System.Rtti.TRttiInterfaceType>"
public best name "System.TArray<System.Rtti.TPair<System.Pointer,System.Rtti.TRttiObject>>"
public best name "System.TArray<System.Pointer>"
public best name "System.TArray<System.Rtti.TRttiObject>"
public best name "System.TArray<System.Rtti.TRttiPackage>"
public best name "System.TypInfo.TTypeKind"
public best name "System.TypInfo.TOrdType"
public best name "System.TypInfo.TFloatType"
public best name "System.TypInfo.TMemberVisibility"
public best name "System.TypInfo.TMethodKind"
public best name "System.TypInfo.TParamFlag"
public best name "System.TypInfo.TParamFlags"
public best name "System.TypInfo.TIntfFlag"
public best name "System.TypInfo.TIntfFlags"
public best name "System.TypInfo.TIntfFlagsBase"
public best name "System.TypInfo.TSymbolName"
public best name "System.TypInfo.TTypeInfoFieldAccessor"
public best name "System.TypInfo.TCallConv"
public best name "System.TypInfo.PAttrData"
public best name "System.TypInfo.PVmtMethodEntryTail"
public best name "System.TypInfo.PIntfMethodEntryTail"
public best name "System.TypInfo.PTypeData"
public best name "System.TypInfo.PPropData"
public best name "System.TypInfo.PPTypeInfo"
public best name "System.TypInfo.PTypeInfo"
public best name "System.TypInfo.TTypeInfo"
public best name "System.TypInfo.TAttrData"
public best name "System.TypInfo.PFieldExEntry"
public best name "System.TypInfo.TFieldExEntry"
public best name "System.TypInfo.PVmtFieldEntry"
public best name "System.TypInfo.TVmtFieldEntry"
public best name "System.TypInfo.PVmtFieldClassTab"
public best name "System.TypInfo.TVmtFieldClassTab"
public best name "System.TypInfo.PVmtMethodEntry"
public best name "System.TypInfo.TVmtMethodEntry"
public best name "System.TypInfo.TVmtMethodEntryTail"
public best name "System.TypInfo.PVmtMethodExEntry"
public best name "System.TypInfo.TVmtMethodExEntry"
public best name "System.TypInfo.PArrayPropInfo"
public best name "System.TypInfo.TArrayPropInfo"
public best name "System.TypInfo.TManagedField"
public best name "System.TypInfo.PProcedureParam"
public best name "System.TypInfo.TProcedureParam"
public best name "System.TypInfo.PProcedureSignature"
public best name "System.TypInfo.TProcedureSignature"
public best name "System.TypInfo.PIntfMethodTable"
public best name "System.TypInfo.TIntfMethodTable"
public best name "System.TypInfo.PIntfMethodEntry"
public best name "System.TypInfo.TIntfMethodEntry"
public best name "System.TypInfo.TIntfMethodEntryTail"
public best name "System.TypInfo.TArrayTypeData"
public best name "System.TypInfo.PRecordTypeField"
public best name "System.TypInfo.TRecordTypeField"
public best name "System.TypInfo.TTypeData"
public best name "System.TypInfo.TPropData"
public best name "System.TypInfo.PPropInfo"
public best name "System.TypInfo.TPropInfo"
public best name "System.TypInfo.PPropInfoEx"
public best name "System.TypInfo.TPropInfoEx"
public best name "System.Classes.TSeekOrigin"
public best name "System.Classes.TNotifyEvent"
public best name "System.Classes.EStreamError" with QualifiedClassName "System.Classes.EStreamError"
public best name "System.Classes.EFileStreamError" with QualifiedClassName "System.Classes.EFileStreamError"
public best name "System.Classes.EFCreateError" with QualifiedClassName "System.Classes.EFCreateError"
public best name "System.Classes.EFOpenError" with QualifiedClassName "System.Classes.EFOpenError"
public best name "System.Classes.EFilerError" with QualifiedClassName "System.Classes.EFilerError"
public best name "System.Classes.EReadError" with QualifiedClassName "System.Classes.EReadError"
public best name "System.Classes.EWriteError" with QualifiedClassName "System.Classes.EWriteError"
public best name "System.Classes.EClassNotFound" with QualifiedClassName "System.Classes.EClassNotFound"
public best name "System.Classes.EInvalidImage" with QualifiedClassName "System.Classes.EInvalidImage"
public best name "System.Classes.EComponentError" with QualifiedClassName "System.Classes.EComponentError"
public best name "System.Classes.TPointerList"
public best name "System.Classes.TListSortCompare"
public best name "System.Classes.TListSortCompareFunc"
public best name "System.Classes.TListAssignOp"
public best name "System.Classes.TListEnumerator" with QualifiedClassName "System.Classes.TListEnumerator"
public best name "System.Classes.TList" with QualifiedClassName "System.Classes.TList"
public best name "System.Classes.IInterfaceList"
public best name "System.Classes.IInterfaceListEx"
public best name "System.Classes.TInterfaceListEnumerator" with QualifiedClassName "System.Classes.TInterfaceListEnumerator"
public best name "System.Classes.TInterfaceList" with QualifiedClassName "System.Classes.TInterfaceList"
public best name "System.Classes.TPersistent" with QualifiedClassName "System.Classes.TPersistent"
public best name "System.Classes.TPersistentClass"
public best name "System.Classes.TCollectionItem" with QualifiedClassName "System.Classes.TCollectionItem"
public best name "System.Classes.TCollectionItemClass"
public best name "System.Classes.TCollectionEnumerator" with QualifiedClassName "System.Classes.TCollectionEnumerator"
public best name "System.Classes.TCollection" with QualifiedClassName "System.Classes.TCollection"
public best name "System.Classes.TStream" with QualifiedClassName "System.Classes.TStream"
public best name "System.Classes.THandleStream" with QualifiedClassName "System.Classes.THandleStream"
public best name "System.Classes.TFileStream" with QualifiedClassName "System.Classes.TFileStream"
public best name "System.Classes.TCustomMemoryStream" with QualifiedClassName "System.Classes.TCustomMemoryStream"
public best name "System.Classes.TMemoryStream" with QualifiedClassName "System.Classes.TMemoryStream"
public best name "System.Classes.TGetClass"
public best name "System.Classes.TClassFinder" with QualifiedClassName "System.Classes.TClassFinder"
public best name "System.Classes.TValueType"
public best name "System.Classes.TFilerFlag"
public best name "System.Classes.TFilerFlags"
public best name "System.Classes.TReaderProc"
public best name "System.Classes.TWriterProc"
public best name "System.Classes.TStreamProc"
public best name "System.Classes.IInterfaceComponentReference"
public best name "System.Classes.TFiler" with QualifiedClassName "System.Classes.TFiler"
public best name "System.Classes.TComponentClass"
public best name "System.Classes.TFindMethodEvent"
public best name "System.Classes.TSetNameEvent"
public best name "System.Classes.TReferenceNameEvent"
public best name "System.Classes.TAncestorNotFoundEvent"
public best name "System.Classes.TReadComponentsProc"
public best name "System.Classes.TReaderError"
public best name "System.Classes.TFindComponentClassEvent"
public best name "System.Classes.TCreateComponentEvent"
public best name "System.Classes.TFindMethodInstanceEvent"
public best name "System.Classes.TFindComponentInstanceEvent"
public best name "System.Classes.TReader" with QualifiedClassName "System.Classes.TReader"
public best name "System.Classes.TFindAncestorEvent"
public best name "System.Classes.TFindMethodNameEvent"
public best name "System.Classes.TWriter" with QualifiedClassName "System.Classes.TWriter"
public best name "System.Classes.TComponentEnumerator" with QualifiedClassName "System.Classes.TComponentEnumerator"
public best name "System.Classes.TOperation"
public best name "System.Classes.TComponentState"
public best name "System.Classes.TComponentStyle"
public best name "System.Classes.TGetStreamProc"
public best name "System.Classes.TGetDeltaStreamsEvent"
public best name "System.Classes.TComponentName"
public best name "System.Classes.TObservers.TCanObserveEvent"
public best name "System.Classes.TObservers.TObserverAddedEvent"
public best name "System.Classes.TObservers" with QualifiedClassName "System.Classes.TObservers"
public best name "System.Classes.EObserverException" with QualifiedClassName "System.Classes.EObserverException"
public best name "System.Classes.TComponent" with QualifiedClassName "System.Classes.TComponent"
public best name "System.Classes.TBasicActionLink" with QualifiedClassName "System.Classes.TBasicActionLink"
public best name "System.Classes.TBasicAction" with QualifiedClassName "System.Classes.TBasicAction"
public best name "System.Classes.TIdentToInt"
public best name "System.Classes.TIntToIdent"
public best name "System.Generics.Collections.TEnumerator<System.IInterface>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.IInterface
>"
public best name "System.Generics.Collections.TEnumerable<System.IInterface>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.IInterface
>"
public best name "System.Generics.Collections.TList<System.IInterface>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.IInterface>"
public best name "System.Generics.Collections.TArrayManager<System.IInterface>" with QualifiedClassName "System.Generics.Collections.TArrayManager<System.IInter
face>"
public best name "System.Generics.Collections.TList<System.IInterface>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.IInterface>.TEnumerator" with QualifiedClassName "System.Generics.Collections.TList<System.IInterface
>.TEnumerator"
public best name "System.Generics.Collections.TList<System.IInterface>" with QualifiedClassName "System.Generics.Collections.TList<System.IInterface>"
public best name "System.Generics.Collections.TThreadList<System.IInterface>" with QualifiedClassName "System.Generics.Collections.TThreadList<System.IInterface
>"
public best name "System.Generics.Collections.TEnumerator<System.Classes.TCollectionItem>" with QualifiedClassName "System.Generics.Collections.TEnumerator<Syst
em.Classes.TCollectionItem>"
public best name "System.Generics.Collections.TEnumerable<System.Classes.TCollectionItem>" with QualifiedClassName "System.Generics.Collections.TEnumerable<Syst
em.Classes.TCollectionItem>"
public best name "System.Generics.Collections.TList<System.Classes.TCollectionItem>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Classes.TCollectionItem>"
public best name "System.Generics.Collections.TArrayManager<System.Classes.TCollectionItem>" with QualifiedClassName "System.Generics.Collections.TArrayManager<
System.Classes.TCollectionItem>"
public best name "System.Generics.Collections.TList<System.Classes.TCollectionItem>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.Classes.TCollectionItem>.TEnumerator" with QualifiedClassName "System.Generics.Collections.TList<Syst
em.Classes.TCollectionItem>.TEnumerator"
public best name "System.Generics.Collections.TList<System.Classes.TCollectionItem>" with QualifiedClassName "System.Generics.Collections.TList<System.Classes.T
CollectionItem>"
public best name "System.Generics.Collections.TEnumerator<System.TObject>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.TObject>"
public best name "System.Generics.Collections.TEnumerable<System.TObject>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.TObject>"
public best name "System.Generics.Collections.TList<System.TObject>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.TObject>"
public best name "System.Generics.Collections.TArrayManager<System.TObject>" with QualifiedClassName "System.Generics.Collections.TArrayManager<System.TObject>"
public best name "System.Generics.Collections.TList<System.TObject>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.TObject>.TEnumerator" with QualifiedClassName "System.Generics.Collections.TList<System.TObject>.TEnu
merator"
public best name "System.Generics.Collections.TList<System.TObject>" with QualifiedClassName "System.Generics.Collections.TList<System.TObject>"
public best name "System.Generics.Collections.TEnumerator<System.Classes.TComponent>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.Cl
asses.TComponent>"
public best name "System.Generics.Collections.TEnumerable<System.Classes.TComponent>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.Cl
asses.TComponent>"
public best name "System.Generics.Collections.TList<System.Classes.TComponent>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Classes.TComponent>"
public best name "System.Generics.Collections.TArrayManager<System.Classes.TComponent>" with QualifiedClassName "System.Generics.Collections.TArrayManager<Syste
m.Classes.TComponent>"
public best name "System.Generics.Collections.TList<System.Classes.TComponent>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.Classes.TComponent>.TEnumerator" with QualifiedClassName "System.Generics.Collections.TList<System.Cl
asses.TComponent>.TEnumerator"
public best name "System.Generics.Collections.TList<System.Classes.TComponent>" with QualifiedClassName "System.Generics.Collections.TList<System.Classes.TCompo
nent>"
public best name "System.Generics.Collections.TPair<System.Integer,System.Classes.IInterfaceList>"
public best name "System.Generics.Collections.TEnumerator<System.Classes.TPair<System.Integer,System.Classes.IInterfaceList>>" with QualifiedClassName "System.G
enerics.Collections.TEnumerator<System.Classes.TPair<System.Integer,System.Classes.IInterfaceList>>"
public best name "System.Generics.Collections.TEnumerable<System.Classes.TPair<System.Integer,System.Classes.IInterfaceList>>" with QualifiedClassName "System.G
enerics.Collections.TEnumerable<System.Classes.TPair<System.Integer,System.Classes.IInterfaceList>>"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TItem"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TItemArray"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Integer>"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Classes.IInterfaceList>"
public best name "System.Generics.Collections.TEnumerator<System.Integer>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.Integer>"
public best name "System.Generics.Collections.TEnumerable<System.Integer>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.Integer>"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TKeyEnumerator" with QualifiedClassName "System.Generics
.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TKeyEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TKeyCollection" with QualifiedClassName "System.Generics
.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TKeyCollection"
public best name "System.Generics.Collections.TEnumerator<System.Classes.IInterfaceList>" with QualifiedClassName "System.Generics.Collections.TEnumerator<Syste
m.Classes.IInterfaceList>"
public best name "System.Generics.Collections.TEnumerable<System.Classes.IInterfaceList>" with QualifiedClassName "System.Generics.Collections.TEnumerable<Syste
m.Classes.IInterfaceList>"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TValueEnumerator" with QualifiedClassName "System.Generi
cs.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TValueEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TValueCollection" with QualifiedClassName "System.Generi
cs.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TValueCollection"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TPairEnumerator" with QualifiedClassName "System.Generic
s.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>.TPairEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Integer,System.Classes.IInterfaceList>" with QualifiedClassName "System.Generics.Collections.TD
ictionary<System.Integer,System.Classes.IInterfaceList>"
public best name "System.Generics.Collections.TEnumerator<System.Classes.TBasicActionLink>" with QualifiedClassName "System.Generics.Collections.TEnumerator<Sys
tem.Classes.TBasicActionLink>"
public best name "System.Generics.Collections.TEnumerable<System.Classes.TBasicActionLink>" with QualifiedClassName "System.Generics.Collections.TEnumerable<Sys
tem.Classes.TBasicActionLink>"
public best name "System.Generics.Collections.TList<System.Classes.TBasicActionLink>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Classes.TBasicActionLink>"
public best name "System.Generics.Collections.TArrayManager<System.Classes.TBasicActionLink>" with QualifiedClassName "System.Generics.Collections.TArrayManager
<System.Classes.TBasicActionLink>"
public best name "System.Generics.Collections.TList<System.Classes.TBasicActionLink>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.Classes.TBasicActionLink>.TEnumerator" with QualifiedClassName "System.Generics.Collections.TList<Sys
tem.Classes.TBasicActionLink>.TEnumerator"
public best name "System.Generics.Collections.TList<System.Classes.TBasicActionLink>" with QualifiedClassName "System.Generics.Collections.TList<System.Classes.
TBasicActionLink>"
public best name "System.Generics.Collections.TEnumerator<System.Rtti.TMethodImplementation.TParamLoc>" with QualifiedClassName "System.Generics.Collections.TEn
umerator<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Collections.TEnumerable<System.Rtti.TMethodImplementation.TParamLoc>" with QualifiedClassName "System.Generics.Collections.TEn
umerable<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Collections.TList<System.Rtti.TMethodImplementation.TParamLoc>.arrayofT"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Collections.TArrayManager<System.Rtti.TMethodImplementation.TParamLoc>" with QualifiedClassName "System.Generics.Collections.T
ArrayManager<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Collections.TList<System.Rtti.TMethodImplementation.TParamLoc>.TEmptyFunc"
public best name "System.Generics.Collections.TList<System.Rtti.TMethodImplementation.TParamLoc>.TEnumerator" with QualifiedClassName "System.Generics.Collectio
ns.TList<System.Rtti.TMethodImplementation.TParamLoc>.TEnumerator"
public best name "System.Generics.Collections.TList<System.Rtti.TMethodImplementation.TParamLoc>" with QualifiedClassName "System.Generics.Collections.TList<Sys
tem.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Collections.TPair<System.Pointer,System.Rtti.TRttiObject>"
public best name "System.Generics.Collections.TEnumerator<System.Rtti.TPair<System.Pointer,System.Rtti.TRttiObject>>" with QualifiedClassName "System.Generics.C
ollections.TEnumerator<System.Rtti.TPair<System.Pointer,System.Rtti.TRttiObject>>"
public best name "System.Generics.Collections.TEnumerable<System.Rtti.TPair<System.Pointer,System.Rtti.TRttiObject>>" with QualifiedClassName "System.Generics.C
ollections.TEnumerable<System.Rtti.TPair<System.Pointer,System.Rtti.TRttiObject>>"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TItem"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TItemArray"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Pointer>"
public best name "System.Generics.Collections.TCollectionNotifyEvent<System.Rtti.TRttiObject>"
public best name "System.Generics.Collections.TEnumerator<System.Pointer>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.Pointer>"
public best name "System.Generics.Collections.TEnumerable<System.Pointer>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.Pointer>"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TKeyEnumerator" with QualifiedClassName "System.Generics.Colle
ctions.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TKeyEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TKeyCollection" with QualifiedClassName "System.Generics.Colle
ctions.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TKeyCollection"
public best name "System.Generics.Collections.TEnumerator<System.Rtti.TRttiObject>" with QualifiedClassName "System.Generics.Collections.TEnumerator<System.Rtti
.TRttiObject>"
public best name "System.Generics.Collections.TEnumerable<System.Rtti.TRttiObject>" with QualifiedClassName "System.Generics.Collections.TEnumerable<System.Rtti
.TRttiObject>"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TValueEnumerator" with QualifiedClassName "System.Generics.Col
lections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TValueEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TValueCollection" with QualifiedClassName "System.Generics.Col
lections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TValueCollection"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TPairEnumerator" with QualifiedClassName "System.Generics.Coll
ections.TDictionary<System.Pointer,System.Rtti.TRttiObject>.TPairEnumerator"
public best name "System.Generics.Collections.TDictionary<System.Pointer,System.Rtti.TRttiObject>" with QualifiedClassName "System.Generics.Collections.TDiction
ary<System.Pointer,System.Rtti.TRttiObject>"
public best name "System.Generics.Collections.TArray" with QualifiedClassName "System.Generics.Collections.TArray"
public best name "System.Generics.Collections.TCollectionNotification"
public best name "System.Generics.Collections.TDictionaryOwnerships"
public best name "System.Generics.Defaults.IComparer<System.IInterface>"
public best name "System.Generics.Defaults.IComparer<System.Classes.TCollectionItem>"
public best name "System.Generics.Defaults.IComparer<System.TObject>"
public best name "System.Generics.Defaults.IComparer<System.Classes.TComponent>"
public best name "System.Generics.Defaults.IEqualityComparer<System.Integer>"
public best name "System.Generics.Defaults.IComparer<System.Classes.TBasicActionLink>"
public best name "System.Generics.Defaults.IComparer<System.Rtti.TMethodImplementation.TParamLoc>"
public best name "System.Generics.Defaults.IEqualityComparer<System.Pointer>"
public best name "System.Generics.Defaults.TSingletonImplementation" with QualifiedClassName "System.Generics.Defaults.TSingletonImplementation"
public best name "System.Generics.Defaults.TStringComparer" with QualifiedClassName "System.Generics.Defaults.TStringComparer"
public best name "System.Generics.Defaults.TOrdinalIStringComparer" with QualifiedClassName "System.Generics.Defaults.TOrdinalIStringComparer"
public best name "System.Generics.Defaults.IEqualityComparer<System.string>"
public best name "System.Generics.Defaults.IComparer<System.string>"
public best name "System.Generics.Defaults.TCustomComparer<System.string>" with QualifiedClassName "System.Generics.Defaults.TCustomComparer<System.string>"
public best name "Winapi.Windows.PListEntry"
public best name "Winapi.Windows._LIST_ENTRY"
public best name "Winapi.Windows.PRTLCriticalSection"
public best name "Winapi.Windows.PRTLCriticalSectionDebug"
public best name "Winapi.Windows._RTL_CRITICAL_SECTION_DEBUG"
public best name "Winapi.Windows._RTL_CRITICAL_SECTION"
public best name "System.Types.TDuplicates"
public best name "System.Types.TDirection"
public best name "System.Rtti.EInsufficientRtti" with QualifiedClassName "System.Rtti.EInsufficientRtti"
public best name "System.Rtti.EInvocationError" with QualifiedClassName "System.Rtti.EInvocationError"
public best name "System.Rtti.ENonPublicType" with QualifiedClassName "System.Rtti.ENonPublicType"
public best name "System.Rtti.IValueData"
public best name "System.Rtti.TValueData"
public best name "System.Rtti.TValue"
public best name "System.Rtti.TRttiObject" with QualifiedClassName "System.Rtti.TRttiObject"
public best name "System.Rtti.TRttiNamedObject" with QualifiedClassName "System.Rtti.TRttiNamedObject"
public best name "System.Rtti.TRttiType" with QualifiedClassName "System.Rtti.TRttiType"
public best name "System.Rtti.TRttiMember" with QualifiedClassName "System.Rtti.TRttiMember"
public best name "System.Rtti.TRttiStructuredType" with QualifiedClassName "System.Rtti.TRttiStructuredType"
public best name "System.Rtti.TRttiField" with QualifiedClassName "System.Rtti.TRttiField"
public best name "System.Rtti.TRttiManagedField" with QualifiedClassName "System.Rtti.TRttiManagedField"
public best name "System.Rtti.TRttiRecordType" with QualifiedClassName "System.Rtti.TRttiRecordType"
public best name "System.Rtti.TRttiProperty" with QualifiedClassName "System.Rtti.TRttiProperty"
public best name "System.Rtti.TRttiInstanceProperty" with QualifiedClassName "System.Rtti.TRttiInstanceProperty"
public best name "System.Rtti.TRttiParameter" with QualifiedClassName "System.Rtti.TRttiParameter"
public best name "System.Rtti.TDispatchKind"
public best name "System.Rtti.TMethodImplementationCallback"
public best name "System.Rtti.TMethodImplementation.TFloatReg"
public best name "System.Rtti.TMethodImplementation.TInterceptFrame"
public best name "System.Rtti.TMethodImplementation.TFirstStageIntercept"
public best name "System.Rtti.TMethodImplementation.PInterceptFrame"
public best name "System.Rtti.TMethodImplementation.PFirstStageIntercept"
public best name "System.Rtti.TMethodImplementation.TParamLoc"
public best name "System.Rtti.TMethodImplementation.TInvokeInfo" with QualifiedClassName "System.Rtti.TMethodImplementation.TInvokeInfo"
public best name "System.Rtti.TMethodImplementation" with QualifiedClassName "System.Rtti.TMethodImplementation"
public best name "System.Rtti.TRttiMethod" with QualifiedClassName "System.Rtti.TRttiMethod"
public best name "System.Rtti.TRttiIndexedProperty" with QualifiedClassName "System.Rtti.TRttiIndexedProperty"
public best name "System.Rtti.TRttiInstanceType" with QualifiedClassName "System.Rtti.TRttiInstanceType"
public best name "System.Rtti.TRttiInterfaceType" with QualifiedClassName "System.Rtti.TRttiInterfaceType"
public best name "System.Rtti.TRttiOrdinalType" with QualifiedClassName "System.Rtti.TRttiOrdinalType"
public best name "System.Rtti.TRttiInt64Type" with QualifiedClassName "System.Rtti.TRttiInt64Type"
public best name "System.Rtti.TRttiInvokableType" with QualifiedClassName "System.Rtti.TRttiInvokableType"
public best name "System.Rtti.TRttiMethodType" with QualifiedClassName "System.Rtti.TRttiMethodType"
public best name "System.Rtti.TRttiProcedureType" with QualifiedClassName "System.Rtti.TRttiProcedureType"
public best name "System.Rtti.TRttiClassRefType" with QualifiedClassName "System.Rtti.TRttiClassRefType"
public best name "System.Rtti.TRttiEnumerationType" with QualifiedClassName "System.Rtti.TRttiEnumerationType"
public best name "System.Rtti.TRttiSetType" with QualifiedClassName "System.Rtti.TRttiSetType"
public best name "System.Rtti.TRttiStringKind"
public best name "System.Rtti.TRttiStringType" with QualifiedClassName "System.Rtti.TRttiStringType"
public best name "System.Rtti.TRttiAnsiStringType" with QualifiedClassName "System.Rtti.TRttiAnsiStringType"
public best name "System.Rtti.TRttiFloatType" with QualifiedClassName "System.Rtti.TRttiFloatType"
public best name "System.Rtti.TRttiArrayType" with QualifiedClassName "System.Rtti.TRttiArrayType"
public best name "System.Rtti.TRttiDynamicArrayType" with QualifiedClassName "System.Rtti.TRttiDynamicArrayType"
public best name "System.Rtti.TRttiPointerType" with QualifiedClassName "System.Rtti.TRttiPointerType"
public best name "System.Rtti.TRttiPackage" with QualifiedClassName "System.Rtti.TRttiPackage"
public best name "System.Rtti.TRttiContext"
public best name "System.Variants.TVarCompareResult"
public best name "System.Variants.TCustomVariantType" with QualifiedClassName "System.Variants.TCustomVariantType"
public best name "System.Variants.EVariantInvalidOpError" with QualifiedClassName "System.Variants.EVariantInvalidOpError"
public best name "System.Variants.EVariantTypeCastError" with QualifiedClassName "System.Variants.EVariantTypeCastError"
public best name "System.Variants.EVariantOverflowError" with QualifiedClassName "System.Variants.EVariantOverflowError"
public best name "System.Variants.EVariantInvalidArgError" with QualifiedClassName "System.Variants.EVariantInvalidArgError"
public best name "System.Variants.EVariantBadVarTypeError" with QualifiedClassName "System.Variants.EVariantBadVarTypeError"
public best name "System.Variants.EVariantBadIndexError" with QualifiedClassName "System.Variants.EVariantBadIndexError"
public best name "System.Variants.EVariantArrayLockedError" with QualifiedClassName "System.Variants.EVariantArrayLockedError"
public best name "System.Variants.EVariantArrayCreateError" with QualifiedClassName "System.Variants.EVariantArrayCreateError"
public best name "System.Variants.EVariantNotImplError" with QualifiedClassName "System.Variants.EVariantNotImplError"
public best name "System.Variants.EVariantOutOfMemoryError" with QualifiedClassName "System.Variants.EVariantOutOfMemoryError"
public best name "System.Variants.EVariantUnexpectedError" with QualifiedClassName "System.Variants.EVariantUnexpectedError"
public best name "System.Variants.EVariantDispatchError" with QualifiedClassName "System.Variants.EVariantDispatchError"
public best name "System.Variants.EVariantInvalidNullOpError" with QualifiedClassName "System.Variants.EVariantInvalidNullOpError"
public best name "System.SyncObjs.TWaitResult"
public best name "System.SyncObjs.TSynchroObject" with QualifiedClassName "System.SyncObjs.TSynchroObject"
public best name "System.SyncObjs.TCriticalSection" with QualifiedClassName "System.SyncObjs.TCriticalSection"
public best name "System.TimeSpan.TTimeSpan"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterface"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicNonImplementedInterface"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObject" with QualifiedClassName "RttiContext_GetTypes_vs_GetType_on_
Interfaces_MainUnit.TPublicImplementingObject"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.IPublicImplementedInterfaceThatHasNoTypeInfoCalls"
public best name "RttiContext_GetTypes_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls" with QualifiedClassName "RttiContext_Get
Types_vs_GetType_on_Interfaces_MainUnit.TPublicImplementingObjectWithoutTypeInfoCalls"

Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | 3 Comments »

Optimizing Delphi build speeds (via; Vin Colgin – Google+; IDE FixPack; DelphiSpeedUp, Microsoft KBs with speed fixes)

Posted by jpluimers on 2014/03/23

An interesting thread by Vin Colgin – Google+ – IDE FixPack 5.4.1 shows 36.5% increase in BUILD speed under….

The post and discussion covers these topics:

–jeroen

Posted in Delphi, Delphi 2007, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , | 9 Comments »

Delphi: make sure you show the `ExceptAddr` and `ClassName` if you display in exception in DEBUG mode.

Posted by jpluimers on 2014/03/21

When handling `Application.OnException` add the `ExceptAddr` to in Delphi the menu `Search` -> `Goto address` has a chance of working, and the `ClassName` so you know what happened.

You might want to always do this, depending on how scared your users get from HEX values in error messages.

This works in about every Delphi version I ever used: Read the rest of this entry »

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | 2 Comments »

[FOSDEM 2014] Visualizing Delphi with Moose – YouTube

Posted by jpluimers on 2014/03/20

Jus finished watching this very interesting talk from the last FOSDEM 2014 conference: [FOSDEM 2014] Visualizing Delphi with Moose – YouTube.

It is based on MOOSE (an open-source platform for software and data analysis) and PHARO (a free and open-source Smalltalk environment).

This is how to get started (it is in Dutch, we have great developers and researchers around here).

Be sure to watch the presenter Stefan Eggermont (StackOverflow, Twitter, LinkedIn, GitHub, FOSDEM, website www.legacycode.nl) as this kind of analysis (that is also possible for other languages and tools) can highly speedup your work.

You can download the webm version of the talk from the FOSDEV14 devroom.

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | 4 Comments »

WITH IS EVIL! (via: Paul Foster – Google+)

Posted by jpluimers on 2014/03/13

Yet another example of somehow who got bitten hard by using the with statement (I decided to give with its own category on my blog).

This time it got shared by Paul Foster on G+ and comes down to this:

Even in unsuspiciously looking code, the wit statement can bite you, especially if you need to do refactoring and (because of that) introduce two names in the same scope.

Or in Paul‘s words:

Whilst upgrading the code to remove the Containers unit (its not supported on NextGen platforms, so I have to make things work with Generics.Collections instead, (bye bye D7 support for this code) and refactor a couple stupidities in my original design (they always creep in, don’t they) I ended up with two class members of the same name.  The with block then looked OK but I was in fact not access the member I thought I was. 

–jeroen

via: Paul Foster – Google+ – WITH IS EVIL! God damn it, I know it makes code easier to….

Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Pascal, Software Development, Turbo Pascal, With statement | 18 Comments »

Interesting Spring4D based `function TDataSetExtensions.Select(): IEnumerable` on reddit

Posted by jpluimers on 2014/03/12

Very interesting helper function:

function TDataSetExtensions.Select<TResult>: IEnumerable<TResult>

–jeroen

via: Reddit: Delphi sorcery: Spring4D roadmap : delphi.

Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »

Delphi/Turbo Pascal: AppendWithRetry for text files to retry Append

Posted by jpluimers on 2014/03/10

Every once in a while you have multiple threads or processes wanting to write a short message to the same log file. Append then will give you an I/O error 32 (ERROR_SHARING_VIOLATION), but the below small routine will sleep a bit while retrying a couple of times.

It uses these Delphi aspects around the $I or $IOCHECKS compiler directive:

  • in $I+ mode, you get exceptions when certain “classic” Pascal style I/O operations fail.
  • in $I- mode, you access the IOResult to obtain the results of those I/O operations
  • IOResult gets the result of the last failed operation (if any) or zero if none failed
  • IOResult clears the underlying storage to zero
  • $IFOPT checks for a certain state of a compiler flag
  • You can store the state of $OPT in a temporary conditional define

Note there are a few tables of codes you can get back through IOResult as basically you can get many GetLastError results in IOResult as well: Read the rest of this entry »

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | 2 Comments »

FastMM4 FullDebugMode quick tip: don’t forget to give your EXE access to the correct FullDebugMode.dll

Posted by jpluimers on 2014/03/06

If you run FastMM4 in FullDebugMode, then here are two tips that new (and sometimes existing users) often overlook:

  1. If you set the FullDebugMode directive in the IDE, build your project.
  2. Don’t forget to give your EXE access to FastMM_FullDebugMode.dll (x86), or FastMM_FullDebugMode64.dll (x64) which are stored in the FastMM4 download and in the precompiled directory of the source code.
    Either put that DLL in your path, or copy it to your EXE directory.
  3. Make sure your EXE can write in the directory of the EXE.

The first makes sure all units are compiled with FullDebugMode (Delphi does not always do that automagically).

The second makes sure your EXE can access the DLL that writes out your *MemoryManager_EventLog.txt file containing memory leaks and other issues FastMM4 detected.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, FastMM, Software Development | 2 Comments »

Delphi types that cannot be used for TypeInfo

Posted by jpluimers on 2014/03/03

When writing the Spring4D unit tests for GetTypeSize to include as many TTypeKind values, I came across a few types that either did not compile, or were not supported by TypeInfo. I listed them below as I could not find them in the documentation.

I included a test named Test_EnsureAllTTypeKindsCoveredByCallsTo_Test_GetTypeSize_ that verifies that all TTypeKind values except tkUnknown are covered. So future extensions of TTypeKind will make the tests fail.

As a side issue, I really wanted to know if tkUnknown could be emitted by the compiler. It can sort of, for instance by defining discontiguous enumerations, but are incompatible with TypeInfo as well.

Types that do not compile at all: Read the rest of this entry »

Posted in Agile, Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, DUnit, Software Development, Unit Testing | 2 Comments »

Delphi: the Factory Pattern with virtual Create Constructors (via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow)

Posted by jpluimers on 2014/02/20

Delphi Component Design

Delphi Component Design

From long ago, but still very valid, as I recently had another question like “what design patterns does Delphi use?”.

The Delphi usage of patterns to make the VCL and your applications work is one of the reasons I like the Delphi Component Design: Danny Thorpe so much.
Do not let you scare by the book title: a lot of information in this book is much broader than designing components.
It is about why and how things are done in the RTL and VCL, and which patterns you can use yourself.

Try and git it while you can still get it. It is excellent, but rare to get as it has been out of print for a while.

Only a minority of the Delphi developers knows that every Delphi developer uses a Factory pattern (delphi.about.com has an example in “regular” Delphi), but then implemented using virtual Create constructors.

So: time to shed some light on that :-)

Virtual constructors are to classes like virtual methods are like object instances.

The whole idea of the factory pattern is that you decouple the logic that determines what kind (in this case “class”) of thing (in this case “object instance”) to create from the actual creation.

It works like this using virtual Create constructors:

TComponent has a virtual Create constructor so, which can be overridden by any descending class:

type
  TComponent = class(TPersistent, ...)
    constructor Create(AOwner: TComponent); virtual;
    ...
  end;

For instance the TDirectoryListBox.Create constructor overrides it:

type
  TDirectoryListBox = class(...)
    constructor Create(AOwner: TComponent); override;
    ...
  end;

You can store a class reference (the class analogy to an object instance reference) in a variable of type ‘class type’. For component classes, there is a predefined type TComponentClass in the Classes unit:

type
  TComponentClass = class of TComponent;

When you have a variable (or parameter) of type TComponentClass, you can do polymorphic construction, which is very very similar to the factory pattern:

var
  ClassToCreate: TComponentClass;

...

procedure SomeMethodInSomeUnit;
begin
  ClassToCreate := TButton;
end;

...

procedure AnotherMethodInAnotherUnit;
var
  CreatedComponent: TComponent;
begin
  CreatedComponent := ClassToCreate.Create(Application);
  ...
end;

The Delphi RTL uses this for instance here:

Result := TComponentClass(FindClass(ReadStr)).Create(nil);

and here:

// create another instance of this kind of grid
SubGrid := TCustomDBGrid(TComponentClass(Self.ClassType).Create(Self));

The first use in the Delphi RTL is how the whole creation process works of forms, datamodules, frames and components that are being read from a DFM file.

The form (datamodule/frame/…) classes actually have a (published) list of components that are on the form (datamodule/frame/…). That list includes for each component the instance name and the class reference.
When reading the DFM files, the Delphi RTL then:

  1. finds about the components instance name,
  2. uses that name to find the underlying class reference,
  3. then uses the class reference to dynamically create the correct object

A regular Delphi developer usually never sees that happen, but without it, the whole Delphi RAD experience would not exist.

Allen Bauer (the Chief Scientist at Embarcadero), wrote a short blog article about this topic as well.
There is also a SO question about where virtual constructors are being used.

Let me know if that was enough light on the virtual Create constructor topic :-)

–jeroen via: What Design Patterns do you implement in common Delphi programming? – Stack Overflow.

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Tagged: , | 4 Comments »