avrora.sim.util
Class MulticastWatch

java.lang.Object
  extended byavrora.sim.util.MulticastWatch
All Implemented Interfaces:
Simulator.Watch

public class MulticastWatch
extends java.lang.Object
implements Simulator.Watch

The MulticastProbe is a wrapper around multiple watches that allows them to act as a single watch. It is useful for composing multiple watches into one and is used internally in the simulator.

See Also:
Simulator

Constructor Summary
MulticastWatch()
           
 
Method Summary
 void add(Simulator.Watch b)
          The add() method allows another watch to be inserted into the multicast set.
 void fireAfterRead(Instr i, int address, State state, int data_addr, byte val)
          The fireAfterRead() method is called after the probed address is read by the program.
 void fireAfterWrite(Instr i, int address, State state, int data_addr, byte val)
          The fireAfterWrite() method is called after the probed address is written by the program.
 void fireBeforeRead(Instr i, int address, State state, int data_addr, byte val)
          The fireBeforeRead() method is called before the probed address is read by the program.
 void fireBeforeWrite(Instr i, int address, State state, int data_addr, byte val)
          The fireBeforeWrite() method is called before the probed address is written by the program.
 boolean isEmpty()
          The isEmpty() method tests whether the multicast set of this watch is empty.
 void remove(Simulator.Watch b)
          The remove method removes a watch from the multicast set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MulticastWatch

public MulticastWatch()
Method Detail

add

public void add(Simulator.Watch b)
The add() method allows another watch to be inserted into the multicast set. It will be inserted at the end of the list of current watch and will therefore fire after any probes already in the multicast set.

Parameters:
b - the watch to insert

remove

public void remove(Simulator.Watch b)
The remove method removes a watch from the multicast set. The order of the remaining probes is not changed. The comparison used is reference equality, not the .equals() method.

Parameters:
b - the watch to remove

isEmpty

public boolean isEmpty()
The isEmpty() method tests whether the multicast set of this watch is empty.

Returns:
false otherwise

fireBeforeRead

public void fireBeforeRead(Instr i,
                           int address,
                           State state,
                           int data_addr,
                           byte val)
The fireBeforeRead() method is called before the probed address is read by the program. In the implementation of the multicast probe, it simply calls the fireBeforeRead() method on each of the probes in the multicast set in the order in which they were inserted.

Specified by:
fireBeforeRead in interface Simulator.Watch
Parameters:
i - the instruction being probed
address - the address at which this instruction resides
state - the state of the simulation
val - the value of the memory location being read
data_addr - the address of the data being referenced

fireAfterRead

public void fireAfterRead(Instr i,
                          int address,
                          State state,
                          int data_addr,
                          byte val)
The fireAfterRead() method is called after the probed address is read by the program. In the implementation of the multicast probe, it simply calls the fireAfterRead() method on each of the probes in the multicast set in the order in which they were inserted.

Specified by:
fireAfterRead in interface Simulator.Watch
Parameters:
i - the instruction being probed
address - the address at which this instruction resides
state - the state of the simulation
val - the value of the memory location being read
data_addr - the address of the data being referenced

fireBeforeWrite

public void fireBeforeWrite(Instr i,
                            int address,
                            State state,
                            int data_addr,
                            byte val)
The fireBeforeWrite() method is called before the probed address is written by the program. In the implementation of the multicast probe, it simply calls the fireBeforeWrite() method on each of the probes in the multicast set in the order in which they were inserted.

Specified by:
fireBeforeWrite in interface Simulator.Watch
Parameters:
i - the instruction being probed
address - the address at which this instruction resides
state - the state of the simulation
val - the value being written to the memory location
data_addr - the address of the data being referenced

fireAfterWrite

public void fireAfterWrite(Instr i,
                           int address,
                           State state,
                           int data_addr,
                           byte val)
The fireAfterWrite() method is called after the probed address is written by the program. In the implementation of the multicast probe, it simply calls the fireAfterWrite() method on each of the probes in the multicast set in the order in which they were inserted.

Specified by:
fireAfterWrite in interface Simulator.Watch
Parameters:
i - the instruction being probed
address - the address at which this instruction resides
state - the state of the simulation
val - the value being written to the memory location
data_addr - the address of the data being referenced