NeatTools


Module Event Broadcast Model

Module Event Broadcast Model
(as I understand it)

Rob Salgado
30 Mar 1999

By connecting the SwitchObj-output to IntegerObj-input, we allow for the following dialogue to occur:

SwitchObj::engine(OUTPORT)
SwitchObj::broadcast(OUTPORT)
IntegerObj::engine(INPORT,LINKOBJ)
IntegerObj::LINKOBJ(DATA)
SwitchObj::access(OUTPORT,LINKOBJ,DATATYPE)
IntegerObj::broadcast(OUTPORT)

In more detail,

Suppose we depress the SwitchObj Module.

 

This invokes its engine() method.
[Other computations may occur in engine().]
Within this method, the broadcast() method is called.
The SwitchObj::broadcast(OUTPORT) method ("pings") invokes the engine() method of every Module connected to the particular output port (OUTPORT) of the SwitchObj.
Thus, the IntegerObj::engine() method is invoked.

The IntegerObj Module is passed two variables:
  • (INPORT) the particular input port that received the ping
  • (&LINKOBJ) a link to the Module that pinged this input port
In engine(), LINKOBJ.access(DATA) is called.
The LINKOBJ.access(DATA) method is a request by the IntegerObj Module via the LINKOBJ for data from the SwitchObj Module. This method then invokes the SwitchObj::access(OUTPORT, &LINKOBJ, DATATYPE) method.
Thus, the SwitchObj::access() method is invoked.

The SwitchObj Module is passed three variables:
  • (OUTPORT) that was pinged and has just replied
  • (& LINKOBJ) a link to the Module that replied to this ping
  • (DATATYPE) a data type of requested data
Then, SwitchObj::access() then returns the requested data to the IntegerObj Module via the LINKOBJ.
The IntegerObj::engine() method continues.

Within this method, the broadcast() method is called.
The IntegerObj::broadcast(OUTPORT) method ("pings") invokes the engine() method of every Module connected to the particular output port (OUTPORT) of the IntegerObj.

And so on...

For instance, one can connect the IntegerObj-output to 1DMeterObj-input.

Based on Yuh-Jye Chang's Ph.D. dissertation (draft) and my personal experience with writing external modules.