This a version of DEDynForkBase for integer portholes. On demand a new porthole is added to or removed from a MultiPortHole during runtime. All particles to its input are checked for the right receiver and sent only to it.
Derived from: DEDynForkBase
Location: $PTOLEMY/src/domains/de/contrib/stars
Version: 1.3 "01/15/98"
Author: J. Voigt
in | int | input for all dynamically created blocks |
out (multiple) | int | will get one PortHole for each instance |
This star is an implementation of the dynamic fork function for integer portholes. We define the methods declared in DEDynForkBase and provide a simple go-method. This star is used for a proof of concept demo for DynMap and that stuff and is probably not too usefull anywhere else.
More useful stars have to have portholes of another datatype than integer and to override (at least) the go-method.
This method is called from DEDynMapBase::createDynBlock whenever a new block is to put into the system configuration. It just creates a new porthole in the out-multiporthole and puts it into an internal list so that we can find it back lateron. A pointer to the porthole is returned.
This method is called from DEDynMapBase::deleteDynBlock whenever a block is to be taken out of the system configuration. From DEDynMapBase::deleteDynBlock we get a pointer to one of the portholes in ourout-multiporthole and look for it in a list. If we found this porthole, we remove it from the multiporthole's list and delete it.
By convention, it has to get an integer, which is the instancenumber of one of the blocks which are connected to one of the portholes in the out-multiporthole. It looks for that porthole in the internal list and sends exactly that instancenumber to the block. If no porthole for a block with the received instancenumber is found then nothing will happen.
See: source code,
DynForkInt users
copyright (c) 1997 Dresden University of Technology, WiNeS-Project. All rights reserved. See the file $PTOLEMY/copyright for copyright notice, limitation of liability, and disclaimer of warranty provisions.