class LinuxEventBuffer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
LinuxEventBuffer.EventStruct |
(package private) class |
LinuxEventBuffer.EventStruct32Bit |
(package private) class |
LinuxEventBuffer.EventStruct64Bit |
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
bb |
private int |
currentPosition |
private static int |
EVENT_BUFFER_SIZE
EVENT_BUFFER_SIZE controls the maximum number of event lines that can be
processed per device in one pulse.
|
private LinuxEventBuffer.EventStruct |
eventStruct |
private int |
mark |
private int |
positionOfLastSync |
Constructor and Description |
---|
LinuxEventBuffer(int osArchBits) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
compact() |
(package private) short |
getEventCode()
Returns the code of the current event line.
|
(package private) java.lang.String |
getEventDescription()
Returns a string describing the current event.
|
private java.lang.String |
getEventDescription(int position) |
(package private) int |
getEventSize() |
(package private) short |
getEventType()
Returns the type of the current event line.
|
(package private) int |
getEventValue()
Returns the value of the current event line.
|
(package private) boolean |
hasData()
Returns true iff another event line is available.
|
(package private) boolean |
hasNextEvent()
Returns true iff another event line is available AND it is part of a
complete event.
|
(package private) void |
mark()
Sets a mark on the buffer.
|
(package private) void |
nextEvent()
Advances to the next event line.
|
(package private) boolean |
put(java.nio.ByteBuffer event)
Adds a raw Linux event to the buffer.
|
(package private) void |
reset()
Returns iteration to the event set previously in a call to mark(), or to
the beginning of the buffer if no call to mark() was made.
|
(package private) void |
startIteration() |
private static final int EVENT_BUFFER_SIZE
private final java.nio.ByteBuffer bb
private final LinuxEventBuffer.EventStruct eventStruct
private int positionOfLastSync
private int currentPosition
private int mark
int getEventSize()
boolean put(java.nio.ByteBuffer event) throws java.lang.InterruptedException
event
- A ByteBuffer containing the event to be added.java.lang.InterruptedException
- if our thread was interrupted while waiting
for the buffer to empty.void startIteration()
void compact()
short getEventType()
short getEventCode()
int getEventValue()
java.lang.String getEventDescription()
private java.lang.String getEventDescription(int position)
void nextEvent()
void mark()
void reset()
boolean hasNextEvent()
boolean hasData()