Connector, ConnectorView - base classes for connector subjects and
views
#include <Unidraw/Components/connector.h>
Connector is an abstract base class for graphical component
subjects that enforce different connectivity semantics depending on the
particular connector subclass. ConnectorView is the abstract base class for
views of connector subjects. A connector can be connected to one or more
other connectors. Once connected, two connectors can affect each other's
position in specific ways as defined by the semantics of the connection.
Connectors also participate in the propagation of state variable
values during dataflow. Two connected connectors with bound state variables
will assign the value of one state variable to other, and the direction of
transfer depends on the connectors' transmission method. For example, if the
transmission method of connector C1 with bound state variable S1 is In, and
if the transmission method of connector C2 with bound state variable S2 is
Out, and if C1 and C2 are connected, then S1 will be assigned the value of
S2 during dataflow.
- Connector(Graphic*
= nil)
- Initialize the connector instance, optionally with a graphic whose center
defines the connector's position.
- virtual void
ConnectMe(Connector*)
- virtual void
DisconnectMe(Connector*)
- Connectors maintain a list of the connectors to which they are connected.
The Connect and Disconnect operations update this connector's list, while
the ConnectMe and DisconnectMe operations inform their argument to update
their lists.
- void
Retransmit(Path*)
- void
Retransmit(Connector* peer, Path*)
- boolean
Transferable(Connector* peer)
- The Transmit operation uses these operations to propagate state variable
values. The first Retransmit function calls the second one on each of the
connector's peers (i.e., the connectors to which it is connected) if the
path records that this connector has not already been visited (otherwise
propagation ceases). The first Retransmit copies the path if necessary to
avoid accumulating visit information from multiple branches. The second
Retransmit calls Transferable, which returns whether the value of this
connector's state variable can be transferred to the given peer's state
variable based on the two connectors' transmission methods. If the values
are transferable, then the Transferable operation carries out the
assignment to the peer's state variable as a side-effect. The second
Retransmit also enables further propagation by evaluating the transfer
function of the peer's parent and by calling the first Retransmit
operation on the peer.
CGlue(3U), GraphicComp(3U), GraphicView(3U), Path(3U),
StateVar(3U), edit(3U0, globals(3U)