This code is not allowed:
class constructor TOmniMultiPipelineStage.Create;
var
RTTIType: TRttiType;
begin
RTTIType:= TRttiContext.GetType(self);
end;
[dcc32 Error] OtlParallel.pas(5040): E2003 Undeclared identifier: 'self'
The variant is also not allowed:
class constructor TOmniMultiPipelineStage.Create;
var
RTTIType: TRttiType;
begin
//Not really what I want because I want the actual type of the class
//Not a fixed ancestor type
RTTIType:= TRttiContext.GetType(TOmniMultiPipelineStage);
end;
[dcc32 Error] OtlParallel.pas(5039): E2076 This form of method call only allowed for class methods or constructor
How do I get RTTI info on a class in its class constructor?
Note to self: loop over all descendants of a class: Delphi: At runtime find classes that descend from a given base class?