Wire(const char *name): The Wire
constructor accepts a name which represents the wire and passes it to
its base class, Connector for initialization. An
initial signal is then added to the wire's signal list by the
constructor using the add_signal() member function.
Signal get_signal(ckt_time time): During
simulation, components must be able to obtain the value of a signal that
travelled along the wire at a specified time. The
get_signal() method performs this task by traversing its
linked list of signals for the correct signal. Checks are made during
the search to ensure that the client code is not attempting to look for
a signal which has not yet occurred.
void send_signal(Signal sig): When the
Wire object receives this message, it adds the signal to its
signal list by calling its add_signal() member function. It
then attempts to propagate the signal to all the components in its
fan-out list by invoking the propagate() method of its base
Connector class.
void show_signals(): This method will display an
output stanza header and the signal values and times
currently residing on the wire by calling the private
display_signals() function. It is invoked indirectly by
the show_outputs() member function of the
Component class after a simulation has been completed.
void add_signal(Signal sig): This method will
append the specified signal to the signal list maintained by the wire.
The implementation of this function ensures that the signal is in
time-order with respect to the last signal in the signal list; if
not, then a diagnostic warning will be displayed. This function is used
during the initialization of the wire and by the
send_signal() member function. It is also used by the
Runtime_Component class to add the initial signals to the
primary input wires during the construction of the component.