jAER project on SourceForge

net.sf.jaer.hardwareinterface.usb.cypressfx2
Class CypressFX2.AEPacketRawPool

java.lang.Object
  extended by net.sf.jaer.hardwareinterface.usb.cypressfx2.CypressFX2.AEPacketRawPool
Enclosing class:
CypressFX2

public class CypressFX2.AEPacketRawPool
extends java.lang.Object

Object that holds pool of AEPacketRaw that handles data interchange between capture and other (rendering) threads. While the capture thread (AEReader.processData) captures events into one buffer (an AEPacketRaw) the other thread (AEViewer.run()) can render the events. The only time the monitor on the pool needs to be acquired is when swapping or initializing the buffers, to prevent either referencing unrelated data or having memory change out from under you.


Method Summary
 AEPacketRaw readBuffer()
           
 void reset()
          Set the current buffer to be the first one and clear the write buffer
 void swap()
          swaps the read and write buffers so that the buffer that was getting written is now the one that is read from, and the one that was read from is now the one written to.
 AEPacketRaw writeBuffer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

swap

public final void swap()
swaps the read and write buffers so that the buffer that was getting written is now the one that is read from, and the one that was read from is now the one written to. Thread safe.


readBuffer

public final AEPacketRaw readBuffer()
Returns:
buffer that consumer reads from.

writeBuffer

public final AEPacketRaw writeBuffer()
Returns:
buffer that acquisition thread writes to.

reset

public final void reset()
Set the current buffer to be the first one and clear the write buffer


jAER project on SourceForge