Re: Reflection: Get all inherited classes of a base class

2012-12-26 Thread Adam D. Ruppe
On Tuesday, 25 December 2012 at 18:26:29 UTC, nrgyzer wrote: Thanks Adam, that's exactly what I need... is it possible to call a static method only using TypeInfo_Class or do I need to call the constructor using create-method? No, to call a static method you'd have to get to the compile time

Re: Reflection: Get all inherited classes of a base class

2012-12-26 Thread Jacob Carlborg
On 2012-12-25 19:26, nrgyzer wrote: Thanks Adam, that's exactly what I need... is it possible to call a static method only using TypeInfo_Class or do I need to call the constructor using create-method? I think using annotation would be very helpful for my idea: As far as I know you cannot call

Re: Reflection: Get all inherited classes of a base class

2012-12-25 Thread nrgyzer
On Saturday, 22 December 2012 at 22:28:57 UTC, Adam D. Ruppe wrote: On Saturday, 22 December 2012 at 22:14:28 UTC, nrgyzer wrote: is it possible to get a list of all inherited classes from a base class like this: Yes, though it isn't compile time - gotta be runtime. ClassInfo[] getChildClasse

Re: Reflection: Get all inherited classes of a base class

2012-12-23 Thread Philippe Sigaud
> It looks like the runtime _does_ give you this capability (as Adam > explains in > his reponse), so I stand corrected on that point. But a compile time > solution > is still impossible due to D's compilation model. A possible, partial solution is to get a module members at compile-time and iter

Re: Reflection: Get all inherited classes of a base class

2012-12-22 Thread Jonathan M Davis
On Saturday, December 22, 2012 14:26:23 Jonathan M Davis wrote: > Best case, if each class > registered its existance when it was loaded into the environment (e.g with > a static constructor), then you could get a list of the classes which are > currently loaded, but that's not at all what you're a

Re: Reflection: Get all inherited classes of a base class

2012-12-22 Thread Jonathan M Davis
On Saturday, December 22, 2012 23:14:28 nrgyzer wrote: > Hi everyone, > > is it possible to get a list of all inherited classes from a base > class like this: > > class A { > ... > } > class B : A { > ... > } > class C : A { > ... > } > class D : B { > ... > } > > auto myClasses

Re: Reflection: Get all inherited classes of a base class

2012-12-22 Thread Adam D. Ruppe
On Saturday, 22 December 2012 at 22:14:28 UTC, nrgyzer wrote: is it possible to get a list of all inherited classes from a base class like this: Yes, though it isn't compile time - gotta be runtime. ClassInfo[] getChildClasses(ClassInfo c) { ClassInfo[] info; // MoudleInfo is