Re: Change in the unittype and linktype interface

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

While thinking some more about it, I came to the conclusion that it
would be better
to call this interface UnitFactory isntead of UnitType:

|     interface UnitType
|     {
|       bool init(Logger)                                : constructor;
|       void deinit()                                    : destructor;
|
|       Unit new_instance()                              : method;
|
|       ptr char get_spec()                              : method;
|
|       ptr char get_port_spec(in int index)             : method;
|     }

=>

~     interface UnitFactory
~     {
~       init(Logger)                                : constructor;
~       deinit()                                    : destructor;

~       ptr char get_spec()                         : method;

~       ptr char get_port_spec(in int index)        : method;

~       Unit create()                               : method;
~     }

(I also removed the return types from init and deinit, since that's not
~ legal gidl and renamed new_instance to create).

This whole type-stuff was always somewhat confusing, even more since in
the old system type was used for the entities that are now called
links...

Btw., having these Factory classes gets us one step closer to "dynamic"
units (I think of units that have a variable number of ports for
example, like an adder for as many numbers as you want).
Since dynamic units complicate things, I would not try to really support
them, but it might be good to think about the mechansims that would be
necessary and to keep the door open for future extensions...


Georg




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

iD8DBQFAKfWI/rP0cdKF/ToRAiFuAJ9vSlDg0XfunPIovj48zRRGNMrLsQCePodF
aFrxcJ996B3+7wp0uopavmA=
=9cKD
-----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.