|
From: Christophe Prud'h. <pru...@MI...> - 2001-02-23 10:22:52
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> (defclass corelinux::SomeClass
> =09(defproperty "Value" : native=3Dint)
> =09(defmetaproperty "Parents" {MetaClassRoot})
> )
Ok sounds cool !
actually I was thinking about doing this through macros
PROPERTY( int Value READ getValue WRITE setValue );
getValue() and setValue() are getters and setters
> the parser reads the clmc file and generates an mci (metaclass include)
> and mcd (metaclass definition), such that when DECLARE_METACLASS expand=
s
> to (for example)
>
> #include=09<MetaClassSomeClass.mci>
> // which expands to a inner class and SomeClass statics (such as class
> pointer and accessors for it)
>
> And DEFINE_METACLASS expands to include the "mcd" file which is
> fundementally what we now have in macros, with the addition that the
> initializer adds itself to the Ontology target (in this example
> corelinux).
yes that was wht I wanted to do with parser+macros
the DEFINE_METACLASS would have been only META_CLASS and used inside the =
class
then the parser recognise the symbol and generate the meta class informat=
ion
Now if new properties are defined they are parsed also and the mcd is=20
generated automatically.
> This is the first point, I will wait before raising any others.
> Thoughts?
Your system seems to be cleaner/simpler.
However in the system I was thinking the parser would have been a strippe=
d=20
c++ parser therefore the DEFINE_METACLASS( class ); would be only=20
DEFINE_METACLASS (no arg) and the parser would generate the basic meta=20
informations (class::getClassName() for example ) on the class directly f=
rom=20
the header file. So any changes in the header file is caugth.
Moreover what if the class is a template for example? don't you need a c+=
+=20
parser to ensure that the class definition is correct when you generate t=
he=20
mcd file ?
template<typename T>
class A
{
DEFINE_METACLASS( A<T> );
blah.
};
now how do you deal with this in the clmc file ? that is how do you=20
synchronize the class definition with the clmc file and generated mcd fil=
e ?
best regards
C.
- --=20
Christophe Prud'homme |
MIT, 77, Mass Ave, Rm 3-243 | A classic is something that
Cambridge MA 02139 | everyone wants to have read an=
d
Tel (Office) : (00 1) (617) 253 0229 | nobody wants to read.
Fax (Office) : (00 1) (617) 258 8559 | -- Mark Twain,
http://augustine.mit.edu/~prudhomm | "The Disappearance of Literatu=
re"
ICQ UIN: 24560867 Alias: Jesunix |
Following the hacker spirit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjqWOjoACgkQoY+0C9S+FFCkVACfTRGVHgAttgCcn2Ftg0aWcuJN
jhEAmgOHfbNF178GWIwfxprujwlO1yqI
=3DUMer
-----END PGP SIGNATURE-----
|