OpenDaVINCI  4.15.3
odcore::base::LIFOQueue Class Reference

#include <LIFOQueue.h>

Inheritance diagram for odcore::base::LIFOQueue:
Inheritance graph

Public Member Functions

 LIFOQueue ()
 
virtual ~LIFOQueue ()
 
virtual void clear ()
 
virtual void push (const data::Container &container)
 
const data::Container pop ()
 
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 LIFO (stack).

Constructor & Destructor Documentation

odcore::base::LIFOQueue::LIFOQueue ( )
odcore::base::LIFOQueue::~LIFOQueue ( )
virtual

Member Function Documentation

void odcore::base::LIFOQueue::add ( odcore::data::Container container)
virtual

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 push().

void odcore::base::LIFOQueue::clear ( )
virtual

This method clears a datastore.

Implements odcore::base::AbstractDataStore.

References odcore::base::AbstractDataStore::wakeAll().

const Container odcore::base::LIFOQueue::get ( const uint32_t &  index) const
protected

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 getSize(), and isEmpty().

uint32_t odcore::base::LIFOQueue::getSize ( ) const
virtual

This method returns the number of elements currently available in the queue.

Implements odcore::base::AbstractDataStore.

Referenced by get(), odcore::base::BufferedLIFOQueue::getIndexOfLastElement(), and odcore::base::BufferedLIFOQueue::push().

bool odcore::base::LIFOQueue::isEmpty ( ) const
virtual

This method returns true if getSize() == 0.

Returns
true if getSize() == 0.

Implements odcore::base::AbstractDataStore.

Referenced by get(), and pop().

const Container odcore::base::LIFOQueue::pop ( )
void odcore::base::LIFOQueue::push ( const data::Container container)
virtual
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

This method can be called to fall asleep.

References odcore::base::AbstractDataStore::isEmpty(), and odcore::base::Condition::waitOnSignal().

Referenced by odcore::base::FIFOQueue::leave(), and pop().

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