3 #include <filems/facade/FMSWriteFacade.h>
70 inline void push(T
const &elem){
81 virtual void digest(vector<T> ©) = 0;
Abstract class representing a yielder. It is, an object which can be used to accumulate inputs until ...
Definition: Yielder.h:18
virtual void digest(vector< T > ©)=0
Abstract method that must be overridden by any concrete Yielder implementation to specify how a yield...
std::size_t bufferSize
The number of elements that can be buffered before forcing the yield operation.
Definition: Yielder.h:31
std::vector< T > buffer
Where the elements are stored.
Definition: Yielder.h:35
void push(T const &elem)
Push the element into the yielder. The element could be simply accumulated or either it could be dire...
Definition: Yielder.h:70
std::mutex mtx
The mutex to handle concurrent push backs to the buffer vector and the yielding operation itself.
Definition: Yielder.h:26
size_t getBufferSize() const
Obtain the current buffer size of the yielder.
Definition: Yielder.h:102
virtual vector< T > copyBuffer() const
Make a copy of the buffer with its current state.
Definition: Yielder.h:86
Yielder(std::size_t bufferSize=256)
Default constructor for the abstract yielder.
Definition: Yielder.h:44
void setBufferSize(size_t const bufferSize)
Set the buffer size of the yielder, effectively.
Definition: Yielder.h:95
void yield()
Make the yielder flush its elements so the output is performed.
Definition: Yielder.h:55