OpenDaVINCI  4.16.0
odcore::base::BufferedFIFOQueue Class Reference

#include <BufferedFIFOQueue.h>

Inheritance diagram for odcore::base::BufferedFIFOQueue:
Inheritance graph

Public Member Functions

 BufferedFIFOQueue (const uint32_t &bufferSize)
 
virtual ~BufferedFIFOQueue ()
 
virtual void enter (const data::Container &container)
 
int32_t getIndexOfLastElement () const
 
const data::Container getElementAt (const uint32_t &index) const throw (exceptions::ArrayIndexOutOfBoundsException)
 
virtual bool isFull () const
 
virtual void clear ()
 
const data::Container leave ()
 
virtual void add (odcore::data::Container &container)
 
virtual uint32_t getSize () const
 
virtual bool isEmpty () const
 
virtual void waitForData ()
 
virtual void wakeAll ()
 

Protected Member Functions

const data::Container get (const uint32_t &index) const
 
virtual void wait ()
 

Detailed Description

This interface encapsulates all methods necessary for a buffered FIFO. A buffered FIFO allows indexed access to the elements without removing them.

Constructor & Destructor Documentation

odcore::base::BufferedFIFOQueue::BufferedFIFOQueue ( const uint32_t &  bufferSize)

Constructor.

Parameters
bufferSizeMaximum size for this buffer fifo.
odcore::base::BufferedFIFOQueue::~BufferedFIFOQueue ( )
virtual

Member Function Documentation

void odcore::base::FIFOQueue::add ( odcore::data::Container container)
virtualinherited

This method adds a new container to this data store depending on the entering strategy (i.e. front or end).

Parameters
containerContainer to be added.

Implements odcore::base::AbstractDataStore.

References odcore::base::FIFOQueue::enter().

Referenced by odcontext::base::SystemContextComponent::nextContainer().

void odcore::base::BufferedFIFOQueue::enter ( const data::Container container)
virtual
const Container odcore::base::FIFOQueue::get ( const uint32_t &  index) const
protectedinherited

This method returns the element at the given index or an empty container.

Parameters
indexIndex of the element to be retrieved.
Returns
Element at the given index.

References odcore::base::FIFOQueue::getSize(), and odcore::base::FIFOQueue::isEmpty().

const Container odcore::base::BufferedFIFOQueue::getElementAt ( const uint32_t &  index) const
throw (exceptions::ArrayIndexOutOfBoundsException
)

This method returns the elements at the current index.

Parameters
indexIndex of the element to be retrieved.
Returns
Element at the given index.
Exceptions
ArrayIndexOutOfBoundsExceptionif the index is invalid.

References OPENDAVINCI_CORE_THROW_EXCEPTION.

int32_t odcore::base::BufferedFIFOQueue::getIndexOfLastElement ( ) const

This method returns the index of the last element.

Returns
Index of the last element or -1 if the FIFO is empty.

References odcore::base::FIFOQueue::getSize().

uint32_t odcore::base::FIFOQueue::getSize ( ) const
virtualinherited
bool odcore::base::FIFOQueue::isEmpty ( ) const
virtualinherited
bool odcore::base::BufferedFIFOQueue::isFull ( ) const
virtual

This method returns whether the queue is full or not.

Returns
true if the queue-size reached it's maximum.

References odcore::base::FIFOQueue::getSize().

void odcore::base::AbstractDataStore::wait ( )
protectedvirtualinherited

This method can be called to fall asleep.

References odcore::base::Condition::waitOnSignal().

void odcore::base::AbstractDataStore::waitForData ( )
virtualinherited