fast::QueuedDataChannel class

This queued data channel implements the producser-consumer task using a lightweight semaphore. It is used on the output data channelsl of streamers when streaming mode is PROCESS_ALL_FRAMES

Base classes

class DataChannel

Constructors, destructors, conversion operators

QueuedDataChannel() protected

Public functions

void addFrame(DataObject::pointer data) override
auto getSize() -> int override
void setMaximumNumberOfFrames(uint frames) override
auto getMaximumNumberOfFrames() const -> int override
void stop(std::string errorMessage) override
This will unblock if this DataChannel is currently blocking. Used to stop a pipeline.
auto hasCurrentData() -> bool override
auto getFrame() -> DataObject::pointer override

Protected functions

auto getNextDataFrame() -> DataObject::pointer override

Protected variables

std::queue<std::shared_ptr<DataObject>> m_queue
uint mMaximumNumberOfFrames
std::unique_ptr<LightweightSemaphore> m_fillCount
std::unique_ptr<LightweightSemaphore> m_emptyCount

Function documentation

void fast::QueuedDataChannel::addFrame(DataObject::pointer data) override

Add frame to the data channel. This call may block if the buffer is full.

int fast::QueuedDataChannel::getSize() override

Returns the number of frames stored in this DataChannel

void fast::QueuedDataChannel::setMaximumNumberOfFrames(uint frames) override

Set the maximum nr of frames that can be stored in this data channel

DataObject::pointer fast::QueuedDataChannel::getFrame() override

Get current frame, throws if current frame is not available.