[gephex-devel] 0.5 type system -> C++?
Georg Seidel
georg at gephex.org
Sat Nov 20 09:43:26 CET 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
the questions of Jean-Sebastian about out C-only module and type
interface made me think once more about our current type system
for units and links in gephex-0.5.
We already decided that the current _very_ compiler and language
independent vtable approach is too complicated, and that we
should use plain (packes) C-structs instead.
The last days I have been thinking that it might be a good idea
to throw the whole vtable overhead away and use C++ data types
(with some restrictions such as no STL in interfaces or members).
I know, I was the one who always fought for language independence.
But I did not think that the plugin compiler would become that
complicated (It took me ca. 2 weeks to write).
So the plugin interface would not change at all, but instead of
vtables, the board() function would return ptrs. to C++
objects (factory classes for units and links).
This would also allow us to derive all linktypes from a common
base-class which would implement this timestamp functionality we
already talked about.
(And if we want plugins in different languages, we can write a wrapper
class in C++.)
So let me summarize:
~ Advantages:
~ * much much simpler type system (c++ does it for us)
~ * much better type system (inheritance)
~ * Less glue code
~ Disadvantages:
~ * C plugins and plugins in other languages not directly possible
~ * Compiler dependent plugins (only plugins that are compiled
~ with a "compatible" compiler can be loaded)
Hmm...
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBnwOu/rP0cdKF/ToRAtDdAKCE3qyBo0ckM9KjI0grgNSjv3egDwCgtdXu
FL7DLFmdaa7gOO17i0hBGeQ=
=1sst
-----END PGP SIGNATURE-----
More information about the gephex-devel
mailing list