public interface EtEvent
Modifier and Type | Method and Description |
---|---|
org.jlab.coda.et.enums.Age |
getAge()
Gets the age of the event, either
Age.NEW if a new event obtained through
calling EtSystem.newEvents(EtAttachment, org.jlab.coda.et.enums.Mode, int, int, int)
or Age.USED if obtained through calling
EtSystem.getEvents(EtAttachment, org.jlab.coda.et.enums.Mode, org.jlab.coda.et.enums.Modify, int, int) . |
java.nio.ByteOrder |
getByteOrder()
Gets the event data's byte order.
|
int[] |
getControl()
Gets a copy of the event's control array.
|
int[] |
getControlNoCopy()
Gets a reference to the event's control array without copying.
|
byte[] |
getData()
Gets the data array which is backing the event's data buffer if there is one.
|
java.nio.ByteBuffer |
getDataBuffer()
Gets the event's data buffer.
|
org.jlab.coda.et.enums.DataStatus |
getDataStatus()
Gets the status of the data (set by the system), which can be OK
DataStatus.OK ,
corrupted DataStatus.CORRUPT , or possibly corrupted
DataStatus.POSSIBLYCORRUPT . |
int |
getGroup()
Gets the group the event belongs to (1, 2, ...) if ET system events are divided into groups.
|
int |
getId()
Gets the event's id number.
|
int |
getLength()
Gets the length of the data in bytes.
|
int |
getMemSize()
Gets the size of the data buffer in bytes.
|
org.jlab.coda.et.enums.Modify |
getModify()
Gets the event's modify value when receiving it over the network.
|
int |
getOwner()
Gets the attachment id of the attachment which owns or got the event.
|
org.jlab.coda.et.enums.Priority |
getPriority()
Gets the event's priority, either high
Priority.HIGH or low Priority.LOW . |
int |
getRawByteOrder()
Gets the raw byte order data (0x04030201 or 0x01020304).
|
void |
init()
Initialize an event's fields.
|
boolean |
isTemp()
Gets whether this event is a temporary event or not.
|
boolean |
needToSwap()
Tells caller if the event data needs to be swapped in order to be the
same byte order as the local JVM.
|
void |
setByteOrder(java.nio.ByteOrder order)
Set the event data's byte order.
|
void |
setByteOrder(int endian)
Set the event data's byte order by using values consistent with C-based ET systems,
EtConstants.endianBig , EtConstants.endianLittle , EtConstants.endianLocal ,
EtConstants.endianNotLocal , or EtConstants.endianSwitch . |
void |
setControl(int[] con)
Sets the event's control array by copying it into the event.
|
void |
setLength(int len)
Sets the event's data length in bytes.
|
void |
setPriority(org.jlab.coda.et.enums.Priority pri)
Sets the event's priority, either high
Priority.HIGH or low Priority.LOW . |
void |
setRawByteOrder(int byteOrder)
Set the event data's byte order as big with 0x04030201 or
as little with 0x01020304.
|
void init()
int getId()
org.jlab.coda.et.enums.Age getAge()
Age.NEW
if a new event obtained through
calling EtSystem.newEvents(EtAttachment, org.jlab.coda.et.enums.Mode, int, int, int)
or Age.USED
if obtained through calling
EtSystem.getEvents(EtAttachment, org.jlab.coda.et.enums.Mode, org.jlab.coda.et.enums.Modify, int, int)
.int getGroup()
org.jlab.coda.et.enums.Priority getPriority()
Priority.HIGH
or low Priority.LOW
.
Low priority is normal while high priority events get placed at the front of stations'
input and output event lists.int getMemSize()
int getLength()
org.jlab.coda.et.enums.DataStatus getDataStatus()
DataStatus.OK
,
corrupted DataStatus.CORRUPT
, or possibly corrupted
DataStatus.POSSIBLYCORRUPT
. Data is OK by default, it is never labeled
as corrupt but can be labeled as possible corrupt if the process owning an
event crashes and the system recovers it.org.jlab.coda.et.enums.Modify getModify()
Modify.ANYTHING
, modifying only the header
is Modify.HEADER
, else the default assumed, Modify.NOTHING
,
is that nothing is modified resulting in this event being put back into
the ET system (by remote server) immediately upon being copied and that copy
sent to the user.int[] getControl()
int[] getControlNoCopy()
byte[] getData() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if there is no backing arrayjava.nio.ByteBuffer getDataBuffer()
int getOwner()
EtConstants.system
.EtConstants.system
if system owns itjava.nio.ByteOrder getByteOrder()
int getRawByteOrder()
boolean isTemp()
true
if this events represents a local, C-based ET system temp event,
else false
.void setPriority(org.jlab.coda.et.enums.Priority pri)
Priority.HIGH
or low Priority.LOW
.
Low priority is normal while high priority events get placed at the front of stations'
input and output event lists.pri
- event priorityvoid setLength(int len) throws org.jlab.coda.et.exception.EtException
len
- data lengthorg.jlab.coda.et.exception.EtException
- if length is less than zerovoid setControl(int[] con) throws org.jlab.coda.et.exception.EtException
con
- control arrayorg.jlab.coda.et.exception.EtException
- if control array has the wrong number of elementsvoid setByteOrder(java.nio.ByteOrder order)
order
- data's byte ordervoid setByteOrder(int endian) throws org.jlab.coda.et.exception.EtException
EtConstants.endianBig
, EtConstants.endianLittle
, EtConstants.endianLocal
,
EtConstants.endianNotLocal
, or EtConstants.endianSwitch
.endian
- endian valueorg.jlab.coda.et.exception.EtException
- if argument is a bad valuevoid setRawByteOrder(int byteOrder) throws org.jlab.coda.et.exception.EtException
byteOrder
- data's byte order as big with 0x04030201 or
as little with 0x01020304.org.jlab.coda.et.exception.EtException
- if argument is a bad valueboolean needToSwap()
true
if swapping is needed, otherwise false