Marsyas
0.6.0-alpha
|
Interface to write data to realvec_queue. More...
#include <realvec_queue.h>
Public Member Functions | |
mrs_natural | capacity () |
[THREAD-SAFE] Amount of samples reserved for writing. | |
mrs_real & | operator() (mrs_natural observation, mrs_natural sample) |
[THREAD-SAFE] Access data reserved for writing. | |
realvec_queue_producer (realvec_queue &destination, mrs_natural capacity) | |
[THREAD-SAFE] Construct producer and reserve queue space for writing. | |
bool | reserve (mrs_natural capacity) |
[THREAD-SAFE] Reserve more queue space for writing. | |
~realvec_queue_producer () | |
[THREAD-SAFE] Destroy producer and make the reserved space available to the realvec_queue_consumer for reading. |
Interface to write data to realvec_queue.
This class allows a producer of data to push onto a realvec_queue.
Definition at line 209 of file realvec_queue.h.
realvec_queue_producer | ( | realvec_queue & | destination, |
mrs_natural | capacity | ||
) | [inline] |
[THREAD-SAFE] Construct producer and reserve queue space for writing.
destination | The queue to write to. |
capacity | The requested amount of samples. |
If the amount of free samples in the queue is smaller than requested, no space is reserved, and capacity() will return 0.
Definition at line 224 of file realvec_queue.h.
~realvec_queue_producer | ( | ) | [inline] |
[THREAD-SAFE] Destroy producer and make the reserved space available to the realvec_queue_consumer for reading.
Definition at line 239 of file realvec_queue.h.
mrs_natural capacity | ( | ) | [inline] |
[THREAD-SAFE] Amount of samples reserved for writing.
Definition at line 250 of file realvec_queue.h.
mrs_real& operator() | ( | mrs_natural | observation, |
mrs_natural | sample | ||
) | [inline] |
[THREAD-SAFE] Access data reserved for writing.
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 282 of file realvec_queue.h.
bool reserve | ( | mrs_natural | capacity | ) | [inline] |
[THREAD-SAFE] Reserve more queue space for writing.
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 free 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 264 of file realvec_queue.h.