[gephex-devel] gephex-0.5 unit and linktype templates
Georg Seidel
georg at gephex.org
Tue Apr 26 20:39:17 CEST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
this is only a rough sketch of an idea I discussed with Martin a few
times in the past
(originally it is based on martins idea of "higher order" linktypes
like lists of images).
The basic idea is to introduce a C++ template like mechanism for units
and linktypes.
There will be a "UnitTemplate" and a LinktypeTemplate" interface that
allows to
instantiate units and linktypes with different values of template
parameters.
The following types of template parameters are allowed:
1/ linktype (at instantiation this parameter will hold a pointer to
a linktype interface)
2/ int
3 string (0-terminated array of bytes, utf-8)
The interface of UnitTemplate in pseudo code could look like that:
class UnitTemplate
{
public:
ParameterInfo get_param_info() const;
Unit* instantiate(ParameterValues params);
};
Note that the units returned by instantiate might have different number
and type of
ports depending on the template parameters.
For example, think about a SwitchN template, with a single template
parameter of
type int (= number of input ports).
Best regards,
Georg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
iD8DBQFCborZ/rP0cdKF/ToRApdfAKCpqyPOqW1feEE0A/Hl2Tg+4mZB5gCfag88
fl+549peVz0kXCTIWXF65lk=
=Zkaj
-----END PGP SIGNATURE-----
More information about the gephex-devel
mailing list