public interface RingItem extends java.lang.Cloneable, Attached
Modifier and Type | Method and Description |
---|---|
void |
copy(RingItem ringItem)
Copy the argument's data into this RingItem object.
|
java.nio.ByteBuffer |
getBuffer()
Get the ByteBuffer object (containing evio data) referenced by this ring item if any.
|
ByteBufferItem |
getByteBufferItem()
Get the ByteBufferItem object used to wrap the referenced ByteBuffer (if any).
|
ByteBufferSupply |
getByteBufferSupply()
Get the ByteBufferSupply object used to create the referenced ByteBuffer (if any).
|
java.nio.ByteOrder |
getByteOrder()
Get the byte order of the data contained in this object.
|
ControlType |
getControlType()
If this is control event, this method returns the type of
control event, otherwise it returns null.
|
org.jlab.coda.jevio.EvioEvent |
getEvent()
Get the evio event object contained in this ring item if any.
|
int |
getEventCount()
Get the number of ROC events in this object's data.
|
EventType |
getEventType()
Get the type of event (ROC raw, physics, user, control , etc) this is.
|
long |
getFirstEventNumber()
Get the first event number in this object's data.
|
org.jlab.coda.jevio.EvioNode |
getNode()
Get the EvioNode object which selects a particular event in the ByteBuffer
referenced by this ring item, if any.
|
int |
getRecordId()
The recordId, for a physics or ROC Raw type, starts at zero and
increases by one in each successive "evio-file-format" data buffer.
|
int |
getSourceId()
If emu input channel is reading ROC raw data, then this method
gets the CODA id number of the source.
|
java.lang.String |
getSourceName()
Get the name of the data input channel (from xml config file)
which read the data into this object.
|
boolean |
getSwitchRing()
If merging contents of multiple rings, it's convenient to have a means
to tell the caller when to switch reading from one ring to the next.
|
int |
getTotalBytes()
Get the length of this structure in bytes, including the header.
|
boolean |
hasError()
Did this object already have an error when first received from transport?
|
boolean |
hasNonFatalBuildingError()
Did this object generate a non-fatal error while being built
(still allows build to continue) ?
|
boolean |
isControlEvent()
Is this object a control event?
|
boolean |
isFirstEvent()
Is this object a first event?
|
void |
isFirstEvent(boolean isFirst)
Set whether this object a first event.
|
boolean |
isSync()
Is this object is a sync event?
This condition is set by the ROC and it is only read - never set.
|
boolean |
isUser()
Is this object a USER event type?
|
boolean |
matchesId()
Does the source id match that of the input channel?
|
void |
matchesId(boolean matchId)
Set whether the source id matches that of the input channel.
|
void |
releaseByteBuffer()
Releases a ByteBuffer (if any) referenced by this object which was obtained
from a ByteBufferSupply object.
|
void |
setAll(org.jlab.coda.jevio.EvioEvent ev,
java.nio.ByteBuffer buf,
org.jlab.coda.jevio.EvioNode nd,
EventType eType,
ControlType cType,
boolean user,
boolean first,
int chanId,
int rId,
int sId,
int evCount,
java.lang.String sName,
ByteBufferItem bbItem,
ByteBufferSupply bbSupply)
For a ringItem producer, when a new item is obtained, it must have all
of its values set or reset.
|
void |
setBuffer(java.nio.ByteBuffer buffer)
Set the ByteBuffer object (containing evio data) referenced by this ring item if any.
|
void |
setControlType(ControlType type)
Set the type of control event this is.
|
void |
setError(boolean hasError)
Sets whether or not this object has an error.
|
void |
setEvent(org.jlab.coda.jevio.EvioEvent event)
Set the evio event object contained in this ring item.
|
void |
setEventCount(int eventCount)
Set the number of ROC events in this object's data.
|
void |
setEventType(EventType type)
Set the type of event (ROC raw, physics, user, control , etc) this is.
|
void |
setFirstEventNumber(long firstEventNumber)
Set the first event number in this object's data.
|
void |
setNode(org.jlab.coda.jevio.EvioNode node)
Set the EvioNode object which selects a particular event in the ByteBuffer
referenced by this ring item, if any.
|
void |
setNonFatalBuildingError(boolean nonFatalBuildingError)
Sets whether or not this object generated a non-fatal error while being built.
|
void |
setRecordId(int recordId)
This method sets the record id.
|
void |
setReusableByteBuffer(ByteBufferSupply byteBufferSupply,
ByteBufferItem byteBufferItem)
Set the objects needed to release (by calling
releaseByteBuffer() )
the referenced ByteBuffer when no longer needed. |
void |
setSourceId(int sourceId)
If emu input channel is reading Roc Raw data, then this method
sets the CODA id number of the source.
|
void |
setSourceName(java.lang.String sourceName)
Set the name of the data input channel (from xml config file)
which read the data into this object.
|
void |
setSwitchRing(boolean switchRing)
If merging contents of multiple rings, it's convenient to have a means
to tell the caller when to switch reading from one ring to the next.
|
void |
setSync(boolean sync)
Sets whether or not this object is a sync event.
|
getAttachment, setAttachment
java.nio.ByteOrder getByteOrder()
void copy(RingItem ringItem)
ringItem
- RingItem to copy fromorg.jlab.coda.jevio.EvioEvent getEvent()
void setEvent(org.jlab.coda.jevio.EvioEvent event)
event
- evio event object to be contained in this ring item.java.nio.ByteBuffer getBuffer()
getNode()
}.void setBuffer(java.nio.ByteBuffer buffer)
setNode(org.jlab.coda.jevio.EvioNode)
}.buffer
- ByteBuffer object to be referenced by this ring item.org.jlab.coda.jevio.EvioNode getNode()
getBuffer()
}.void setNode(org.jlab.coda.jevio.EvioNode node)
setBuffer(java.nio.ByteBuffer)
}.node
- EvioNode object which selects a particular event in the ByteBuffer
referenced by this ring item.int getTotalBytes()
boolean isControlEvent()
true
if control event, else false
.ControlType getControlType()
void setControlType(ControlType type)
type
- type of control event this is.boolean isUser()
true
if USEr event type, else false
.boolean isFirstEvent()
true
if first event, else false
.void isFirstEvent(boolean isFirst)
isFirst
- true
if first event, else false
.EventType getEventType()
void setEventType(EventType type)
type
- type of event this is.int getSourceId()
void setSourceId(int sourceId)
sourceId
- CODA id number of input Roc Raw data source.boolean matchesId()
true
if source id matches that of the input channel,
else false
.void matchesId(boolean matchId)
matchId
- true
if source id matches that of the input channel,
else false
.int getRecordId()
void setRecordId(int recordId)
recordId
- the record idjava.lang.String getSourceName()
void setSourceName(java.lang.String sourceName)
sourceName
- name of the data input channel from xml config file.int getEventCount()
void setEventCount(int eventCount)
eventCount
- number of ROC events in this object's data.long getFirstEventNumber()
void setFirstEventNumber(long firstEventNumber)
firstEventNumber
- first event number in this object's data.boolean getSwitchRing()
void setSwitchRing(boolean switchRing)
switchRing
- true if time to switch ring being read, else false.boolean isSync()
true
if this object is a sync event, else false
.void setSync(boolean sync)
sync
- true
if this object is a sync event, else false
.boolean hasError()
true
if this object had an error when first received,
else false
.void setError(boolean hasError)
hasError
- true
if this object has an error, else false
.boolean hasNonFatalBuildingError()
true
if this object generated a non-fatal build error, else false
.void setNonFatalBuildingError(boolean nonFatalBuildingError)
nonFatalBuildingError
- true
if this object generate a non-fatal
error while being built, else false
.void releaseByteBuffer()
void setReusableByteBuffer(ByteBufferSupply byteBufferSupply, ByteBufferItem byteBufferItem)
releaseByteBuffer()
)
the referenced ByteBuffer when no longer needed.byteBufferSupply
- object which supplied the ByteBufferbyteBufferItem
- object wrapping ByteBuffer in the supplyByteBufferSupply getByteBufferSupply()
ByteBufferItem getByteBufferItem()
void setAll(org.jlab.coda.jevio.EvioEvent ev, java.nio.ByteBuffer buf, org.jlab.coda.jevio.EvioNode nd, EventType eType, ControlType cType, boolean user, boolean first, int chanId, int rId, int sId, int evCount, java.lang.String sName, ByteBufferItem bbItem, ByteBufferSupply bbSupply)
ev
- EvioEvent object (1st way of specifying evio data)buf
- ByteBuffer object (2nd way of specifying evio data)nd
- EvioNode object (3rd way of specifying evio data)eType
- type of event: roc raw, physics, user, control, etc.cType
- type of control event: prestart, go, end, etc.user
- is this a USER event typefirst
- is this a "first" or "beginning-of-run" eventchanId
- ID of data channel this method is called forrId
- record IDsId
- CODA ID of data sourceevCount
- number of events in datasName
- name of data sourcebbItem
- ByteBufferItem object holding the ByteBuffer containing
the databbSupply
- Supply object containing the ByteBufferItem