|
From: Frank V. C. <fr...@co...> - 2000-10-01 22:04:04
|
Christophe,
This is basically the idea (that your macro has) only with a bit more
information reflection details.
In the short term, class MetaType is also a factory for type instances
(which enables any kind of memory management one would desire to
override). So, take Integer for example:
{
IntegerPtr aInt = Integer::getMetaType()->create();
*aInt = 78;
Integer::getMetaType()->destroy(aInt);
}
In the longer term, we need to support things like attributes so that
Persistence can get and set data to and from the data
stores.
Also, the Ontology will allow you to traverse the hierarchy of MetaTypes
to instantiate types that you want. So when, for example, the Function
Library Loader needs to execute something from a shared library, it can
reason with the ontology for the appropriate return types, instantiate
one for the return, and viola!
Of course it is more involved. Did you see the NIHCL object.hpp I sent
you? That is the long term goal (in general functionality, not the way
it looked.)
From that point, we can add utilities which scan a ELF *.so file and
generate all the ExecutionObjectDefinitions automagically (even at run
time if we implement it so).
Generally, I was going to do most of the work with macro expansions.
This week you will see the fruits of labor start to appear.
I am working on the neccessary
Christophe Prud'homme wrote:
>
> > 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
> _______________________________________________
> Corelinux-develop mailing list
> Cor...@li...
> http://lists.sourceforge.net/mailman/listinfo/corelinux-develop
--
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux
http://PythPat.sourceforge.net
Pythons Pattern Package
|