subtyping in gephex-0.5

Georg Seidel <[email protected]>
Newsgroups gmane.comp.video.gephex.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The simplifications of the unit and link type system make
it possible to get a very cool thing working without
much work: subtyping of link types.

We can simply use the subtyping of c++.

Consider the following relation.
In the C++ implementation the respective classes
use inheritance to model it.
(LinkType and PackedImage are abstract base classes)

~   LinkType -> PackedImage ->  PackedBGRAImage
~                           |
~                            -> PackedYUVImage

The only extra thing we would have to implement is to
tell the core about this subtype relation.
This could be done in the link type spec:

~   link PackedBGRAImage
~   {
~    basetype    = "PackedImage"
~    author      = "..."
~    version     = "1.0"
~    [...]
~    }

While this is somewhat redundant to the inheritance
in C++ I do not see an easy way to avoid it.

I think that the extra complexity in the core would be
very small (maintain subtype relation, type check of
connection uses transitive closure).

Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBq4pg/rP0cdKF/ToRApYWAJ9KgQnhw6ykaZ+GO3pfmsbzYVgqAgCgxbJd
6RY3+HaklVVQOQkhVOjU8jI=
=5G4S
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.