Marsyas
0.6.0-alpha
|
Interface to read data from realvec_queue. More...
#include <realvec_queue.h>
Public Member Functions | |
mrs_natural | capacity () |
[THREAD-SAFE] Amount of samples reserved for reading. | |
mrs_real & | operator() (mrs_natural observation, mrs_natural sample) |
[THREAD-SAFE] Access data reserved for reading. | |
realvec_queue_consumer (realvec_queue &source, mrs_natural capacity) | |
[THREAD-SAFE] Construct consumer and reserve queue space for reading. | |
bool | reserve (mrs_natural capacity) |
[THREAD-SAFE] Reserve more queue space for reading. | |
~realvec_queue_consumer () | |
[THREAD-SAFE] Destroy consumer and make the reserved space available to the realvec_queue_producer to reuse for writing. |
Interface to read data from realvec_queue.
This class allows a consumer of data to pop off of a realvec_queue.
Definition at line 298 of file realvec_queue.h.
realvec_queue_consumer | ( | realvec_queue & | source, |
mrs_natural | capacity | ||
) | [inline] |
[THREAD-SAFE] Construct consumer and reserve queue space for reading.
source | The queue to read from. |
capacity | The requested amount of samples. |
If the amount of available samples in the queue is smaller than requested, no space is reserved, and capacity() will return 0.
Definition at line 313 of file realvec_queue.h.
~realvec_queue_consumer | ( | ) | [inline] |
[THREAD-SAFE] Destroy consumer and make the reserved space available to the realvec_queue_producer to reuse for writing.
Definition at line 328 of file realvec_queue.h.
mrs_natural capacity | ( | ) | [inline] |
[THREAD-SAFE] Amount of samples reserved for reading.
Definition at line 339 of file realvec_queue.h.
mrs_real& operator() | ( | mrs_natural | observation, |
mrs_natural | sample | ||
) | [inline] |
[THREAD-SAFE] Access data reserved for reading.
observation | Channel index in range of 0 to `queue.observations()` |
sample | Sample index, among reserved samples; in the range of 0 to `capacity()`, where 0 denotes the first reserved sample, and so on... |
Definition at line 371 of file realvec_queue.h.
bool reserve | ( | mrs_natural | capacity | ) | [inline] |
[THREAD-SAFE] Reserve more queue space for reading.
capacity | The requested amount of samples. |
It is only possible to reserve more samples than already reserved. If less or equal amount is requested, this method will return true, but the reserved amount will not change.
If the amount of available samples in the queue is smaller than requested, This method will return false, and the amount of reserved space will not change.
Definition at line 353 of file realvec_queue.h.