Package org.epics.pvdata.monitor
Interface MonitorQueue
-
public interface MonitorQueueA queue for monitors. None of the methods are synchronized. The caller must perform synchronization.- Author:
- mrk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcapacity()Get the queue capacity.voidclear()Set all elements free.MonitorElementgetFree()Get the next free element.intgetNumberFree()Get the number of free queue elements.MonitorElementgetUsed()Get the oldest used element.voidreleaseUsed(MonitorElement monitorElement)Release the getUsed structure.voidsetUsed(MonitorElement monitorElement)Set the getFree element to used.
-
-
-
Method Detail
-
clear
void clear()
Set all elements free.
-
getNumberFree
int getNumberFree()
Get the number of free queue elements.- Returns:
- the number of free queue elements
-
capacity
int capacity()
Get the queue capacity.- Returns:
- the queue capacity
-
getFree
MonitorElement getFree()
Get the next free element.- Returns:
- the next free element or null if no free elements
-
setUsed
void setUsed(MonitorElement monitorElement)
Set the getFree element to used.- Parameters:
monitorElement- the monitorElement, which must be the element returned by the oldest call to getFree that was not setUsed- Throws:
IllegalStateException- if monitorElement is not the element returned by the oldest call to getFree that was not setUsed
-
getUsed
MonitorElement getUsed()
Get the oldest used element.- Returns:
- the next used element or null if no used elements
-
releaseUsed
void releaseUsed(MonitorElement monitorElement)
Release the getUsed structure.- Parameters:
monitorElement- the monitorElement, which must be the element returned by the most recent call to getUsed- Throws:
IllegalStateException- if monitorElement is not the element returned by the most recent call to getUsed
-
-