|
From: Christophe Prud'h. <pru...@MI...> - 2000-10-01 20:23:49
|
> Yes, but what of the type information? This was the purpose of the meta
> class, and more importantly, the Library Load abstraction. Work with me
> on the metaclass, it will be a much more rewarding and flexible
> framework.
what would you want me to do ?
what about inheritance?
in mt simple metaclass stuff I propagate the information through a macro
if I want to have this feature for a derived class (ths parent class must
have it of course)
I add something like that to the class Class
Macro(Class, Parent class);
then I have things like
- getClassName()
- isTypeOf()
- isA()
where Macro is defined like this
#define Macro(thisClass,superclass) \
virtual const char *getClassName() const {return #thisClass;};\
static bool isTypeOf(const char *type) \
{ \
if ( !strcmp(#thisClass,type) ) \
{ \
return 1; \
} \
return superclass::isTypeOf(type); \
} \
virtual bool isA(const char *type) \
{ \
return this->thisClass::isTypeOf(type); \
}
as you can see what I did is simple but was ok for what I want.
what do you plan to do about this?
this==inheritance
C.
--
Christophe Prud'homme |
MIT, 77, Mass Ave, Rm 3-243 | Un prud'homme était un homme
Cambridge MA 02139 | d'honneur et de valeur,
Tel (Office) : (00 1) (617) 253 0229 | sage et loyal.
Fax (Office) : (00 1) (617) 258 8559 | -- Chateaubriand
http://augustine.mit.edu/~prudhomm |
Following the hacker spirit
|