
Classes | |
| class | Postman |
Public Member Functions | |
| LinkedQueueSynchroBuffer () | |
| void | push (Object object) |
| Object | take () |
| void | push (Collection collection) |
| void | setSynchroBufferListener (SynchroBufferListener listener) |
| void | enable () |
| void | disable () |
| void | close () |
Private Attributes | |
| SynchroBufferListener | listener = null |
| LinkedQueue | buffer = new LinkedQueue() |
| Thread | postman = new Thread(new Postman()) |
Static Private Attributes | |
| static final Logger | LOGGER = Logger.getLogger(LinkedQueueSynchroBuffer.class) |
A buffer class which uses an Unbounded linked list implementation with the similar function signatures to SynchroBuffer.
| cern::laser::util::buffer::LinkedQueueSynchroBuffer::LinkedQueueSynchroBuffer | ( | ) | [inline] |
The constructor.
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::close | ( | ) | [inline] |
Close the input (head) end of the queue. It cannot be opened again. In this class, this is not implemented currently.
References LOGGER.
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::disable | ( | ) | [inline] |
Disable the listener. Pushed object are kept in the buffer and delivered when the listener is enabled. In this class, this is not implemented, if starting and stopping the listener input is required, use take() instead, as this gives full control to the consumer as to when it takes an element.
References LOGGER.
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::enable | ( | ) | [inline] |
Enable the listener. The listener is disabled by default. In this class, it should only be called once after the listener has been set to start receiving elements.
References postman.
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::push | ( | Collection | collection | ) | [inline] |
Push a collection of objects into the buffer.
| collection | the collection of objects to push |
References push().
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::push | ( | Object | object | ) | [inline] |
| void cern::laser::util::buffer::LinkedQueueSynchroBuffer::setSynchroBufferListener | ( | SynchroBufferListener | listener | ) | [inline] |
Set the buffer consumer listener.
| listener | the listener |
| Object cern::laser::util::buffer::LinkedQueueSynchroBuffer::take | ( | ) | [inline] |
Atempt to take an object from the end buffer. There is a chance this was interrupted and null is returned.
References buffer.
LinkedQueue cern::laser::util::buffer::LinkedQueueSynchroBuffer::buffer = new LinkedQueue() [private] |
Starts the processing when enabled. The buffer.
Referenced by push(), cern::laser::util::buffer::LinkedQueueSynchroBuffer::Postman::run(), and take().
SynchroBufferListener cern::laser::util::buffer::LinkedQueueSynchroBuffer::listener = null [private] |
The single listener to which elements must be delivered.
Referenced by cern::laser::util::buffer::LinkedQueueSynchroBuffer::Postman::run().
final Logger cern::laser::util::buffer::LinkedQueueSynchroBuffer::LOGGER = Logger.getLogger(LinkedQueueSynchroBuffer.class) [static, private] |
For logging.
Referenced by close(), disable(), and cern::laser::util::buffer::LinkedQueueSynchroBuffer::Postman::run().
Thread cern::laser::util::buffer::LinkedQueueSynchroBuffer::postman = new Thread(new Postman()) [private] |
The thread to run to delivery to the listener.
Referenced by enable().
1.6.2