> You'll have the problem to know the specific class at compile time no
matter whether you use generics or inheritance
Not really, with inheritance, I can just cast the TObject returned by
GetObjectProp to the parent class (TGenClass). Because that's all I need:
accessing TGenClass members.
> If
Am 31.10.2015 05:31 schrieb "leledumbo" :
>
> > TGenClass<> is not a full type, only TGenClass is, so you need
to
> use - in your example - TSpecType(Obj)
>
> Yes, I'm aware of this. The problem is I don't know TSpecType which I said
> the last note. It could be any user defined specialization of T
> TGenClass<> is not a full type, only TGenClass is, so you need to
use - in your example - TSpecType(Obj)
Yes, I'm aware of this. The problem is I don't know TSpecType which I said
the last note. It could be any user defined specialization of TGenClass.
Back to above code, but closer to my actual
On 30.10.2015 20:10, leledumbo wrote:
Consider the following:
type
generic TGenClass = class
...
end;
TSpecType = specialize TGenClass;
TMyClass = class
FST: TSpecType;
procedure p;
published
ST: TSpecType read FST write FST;
end;
procedure TMyClass.p;
...
Consider the following:
type
generic TGenClass = class
...
end;
TSpecType = specialize TGenClass;
TMyClass = class
FST: TSpecType;
procedure p;
published
ST: TSpecType read FST write FST;
end;
procedure TMyClass.p;
...
begin
PropCount := GetPropList(Self,Props);
fo