The template
Expander
is meant to be a base classe for components with one input port and
several output ports. Each of these output ports can be assigned an attribute (its type is defined
by the template parameter).
- Upon construction,
Expander
requires the number of ports to be created. The created
ports are named "output 1", "output 2", ... . However, new ports can be added with the help
of the method
addPort(String, Object)
using the port name and its attribute. With
removePort(String)
an
output port can be removed.
- The attributes can be changed subsequently using
setPortParameter(int, Object)
, which
requires port identification with its index (1, 2,... , n).
- The purely virtual method
handleMessageIndication(Message)
must be defined in derived
classes.
- The type used for the output ports in both classes is
SynchronousOutputPort
, i.e. no
blocking may occur at an output port.
An expander element generally has one input port and an arbitrary number of
(synchronous) output ports.
To each output port in the generic class Expander
an attribute
can be associated whose type is the generic parameter.
An initial number of output ports can be defined on construction. The names
of the ports are then "output 1", "output 2", ... Moreover, it is possible to
add and remove ports dynamically using AddPort
and
RemovePort
.