Getting derived classes

Steven Schveighoffer schveiguy at yahoo.com
Fri Oct 17 08:28:08 PDT 2008


"Sean Kelly" wrote
> Andrei Alexandrescu wrote:
>>
>> Anyhow, there's a start with the function static Object.factory(string).
>> You give it a string, it gives you a newly-instanced object. So the
>> information is there, it just needs exposing.
>
> Much of it is even exposed, just not in a convenient manner.  A list of 
> classes is available via ModuleInfo, and ClassInfo provides a means of 
> finding the ClassInfo instance of a class by name.  From there it should 
> be possible to obtain a list of parent classes, and so one could build a 
> hierarchy graph with some work.

Sure, but what do you do with that graph ;)  Calling methods/ctors is not 
exactly easy with D currently.

-Steve 





More information about the Digitalmars-d mailing list