FramedInput
The FramedInput class is the abstract base class for all FramedInput devices.
A FramedInput device processes an input stream which can be viewed as a sequence of
structured frames. The update method of all FramedInput devices is identical (see
function below).
NeatToolsModule
|
+-- InputDevice
|
+-- FramedInput
Input streams
fixed int, dataFrameSize, indicates the number of data units (untyped at this level)
in a frame.
Output streams
none.
Fields
none
Methods
- public void update() -- reads the input stream, decodes data, and puts values
in the output streams. This function is used by all FramedInput devices, but the
specific methods it uses: updateBuffer, frameDetected, extractFrame, and cleanupBuffer
are defined in subclasses.
- abstract void extractFrame() -- defined in subclass, updates output streams.
- abstract boolean frameDetected() -- indicates whether a frame is detected in the
input stream.
- abstract void updateBuffer() -- since frames are made up of multiple units of data,
this reads these units from the input stream into a local buffer.
- abstract void cleanupBuffer() -- if the buffer has enough data for a frame, but
no frame was detected, this is used to clean up the buffer.