org.epics.pvmanager
Class Collector<T>
java.lang.Object
org.epics.pvmanager.Function<java.util.List<T>>
org.epics.pvmanager.Collector<T>
- Type Parameters:
T
- type being collected
public abstract class Collector<T>
- extends Function<java.util.List<T>>
Collects the data at the CA rate and allows a client to get all values
since last check. The class needs to be thread safe, and it function
as a queue where the CA threads post data, and a timer based thread
collects the data.
There are two locks used: one (the object itself) must be used whenever
one is either calculating the function or preparing the inputs for the function.
The other (the buffer) is used whenever the buffer is modified. The idea
is that the new calculation may not block the scanning and reading of the
values in the buffer.
- Author:
- carcassi
Method Summary |
abstract void |
collect()
Calculates the next value and puts it in the queue. |
abstract java.util.List<T> |
getValue()
Returns all values since last check and removes values from the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Collector
public Collector()
collect
public abstract void collect()
- Calculates the next value and puts it in the queue.
getValue
public abstract java.util.List<T> getValue()
- Returns all values since last check and removes values from the queue.
- Specified by:
getValue
in class Function<java.util.List<T>>
- Returns:
- a new array with the value; never null