F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Fw::ExternalFifoQueue< T > Class Template Referencefinal

#include <Fw/DataStructures/ExternalFifoQueue.hpp>

Inheritance diagram for Fw::ExternalFifoQueue< T >:
Fw::FifoQueueBase< T > Fw::SizedContainer

Public Member Functions

 ExternalFifoQueue ()=default
 Zero-argument constructor. More...
 
 ExternalFifoQueue (T *items, FwSizeType capacity)
 Constructor providing typed backing storage. More...
 
 ExternalFifoQueue (ByteArray data, FwSizeType capacity)
 Constructor providing untyped backing storage. More...
 
 ExternalFifoQueue (const ExternalFifoQueue< T > &queue)
 Copy constructor. More...
 
 ~ExternalFifoQueue () override=default
 Destructor. More...
 
ExternalFifoQueue< T > & operator= (const ExternalFifoQueue< T > &queue)
 operator= More...
 
void clear () override
 Clear the queue. More...
 
void setStorage (T *items, FwSizeType capacity)
 Set the storage (typed data) More...
 
void setStorage (ByteArray data, FwSizeType capacity)
 Set the storage (untyped data) More...
 
Success enqueue (const T &e) override
 
const T & at (FwSizeType index) const override
 
Success dequeue (T &e) override
 
FwSizeType getSize () const override
 
FwSizeType getCapacity () const override
 
- Public Member Functions inherited from Fw::FifoQueueBase< T >
void copyDataFrom (const FifoQueueBase< T > &queue)
 Copy data from another queue. More...
 
Success peek (T &e, FwSizeType index=0) const
 
- Public Member Functions inherited from Fw::SizedContainer
bool isEmpty () const
 
bool isFull () const
 

Static Public Member Functions

static constexpr U8 getByteArrayAlignment ()
 
static constexpr FwSizeType getByteArraySize (FwSizeType capacity)
 

Friends

template<typename TT >
class ExternalFifoQueueTester
 

Additional Inherited Members

- Protected Member Functions inherited from Fw::FifoQueueBase< T >
 FifoQueueBase ()
 Zero-argument constructor. More...
 
virtual ~FifoQueueBase ()=default
 Destructor. More...
 
- Protected Member Functions inherited from Fw::SizedContainer
 SizedContainer ()
 Zero-argument constructor. More...
 
virtual ~SizedContainer ()=default
 Destructor. More...
 

Detailed Description

template<typename T>
class Fw::ExternalFifoQueue< T >

Definition at line 18 of file ExternalFifoQueue.hpp.

Constructor & Destructor Documentation

◆ ExternalFifoQueue() [1/4]

template<typename T>
Fw::ExternalFifoQueue< T >::ExternalFifoQueue ( )
default

Zero-argument constructor.

◆ ExternalFifoQueue() [2/4]

template<typename T>
Fw::ExternalFifoQueue< T >::ExternalFifoQueue ( T *  items,
FwSizeType  capacity 
)
inline

Constructor providing typed backing storage.

Parameters
itemsThe items
capacityThe capacity

Definition at line 35 of file ExternalFifoQueue.hpp.

◆ ExternalFifoQueue() [3/4]

template<typename T>
Fw::ExternalFifoQueue< T >::ExternalFifoQueue ( ByteArray  data,
FwSizeType  capacity 
)
inline

Constructor providing untyped backing storage.

Parameters
dataThe data
capacityThe capacity

Definition at line 43 of file ExternalFifoQueue.hpp.

◆ ExternalFifoQueue() [4/4]

template<typename T>
Fw::ExternalFifoQueue< T >::ExternalFifoQueue ( const ExternalFifoQueue< T > &  queue)
inline

Copy constructor.

Definition at line 51 of file ExternalFifoQueue.hpp.

◆ ~ExternalFifoQueue()

template<typename T>
Fw::ExternalFifoQueue< T >::~ExternalFifoQueue ( )
overridedefault

Destructor.

Member Function Documentation

◆ at()

template<typename T>
const T& Fw::ExternalFifoQueue< T >::at ( FwSizeType  index) const
inlineoverridevirtual

Get an item at an index. Indices go from left to right in the queue. Fails an assertion if the index is out of range.

Returns
The item
Parameters
indexThe index

Implements Fw::FifoQueueBase< T >.

Definition at line 122 of file ExternalFifoQueue.hpp.

◆ clear()

template<typename T>
void Fw::ExternalFifoQueue< T >::clear ( )
inlineoverridevirtual

Clear the queue.

Implements Fw::SizedContainer.

Definition at line 73 of file ExternalFifoQueue.hpp.

◆ dequeue()

template<typename T>
Success Fw::ExternalFifoQueue< T >::dequeue ( T &  e)
inlineoverridevirtual

Dequeue an element (remove from the left)

Returns
SUCCESS if element dequeued
Parameters
eThe element (output)

Implements Fw::FifoQueueBase< T >.

Definition at line 133 of file ExternalFifoQueue.hpp.

◆ enqueue()

template<typename T>
Success Fw::ExternalFifoQueue< T >::enqueue ( const T &  e)
inlineoverridevirtual

Enqueue an element (push on the right)

Returns
SUCCESS if element enqueued
Parameters
eThe element (output)

Implements Fw::FifoQueueBase< T >.

Definition at line 105 of file ExternalFifoQueue.hpp.

◆ getByteArrayAlignment()

template<typename T>
static constexpr U8 Fw::ExternalFifoQueue< T >::getByteArrayAlignment ( )
inlinestatic

Get the alignment of the storage for an ExternalFifoQueue

Returns
The alignment

Definition at line 160 of file ExternalFifoQueue.hpp.

◆ getByteArraySize()

template<typename T>
static constexpr FwSizeType Fw::ExternalFifoQueue< T >::getByteArraySize ( FwSizeType  capacity)
inlinestatic

Get the size of the storage for an ExternalFifoQueue of the specified capacity, as a byte array

Returns
The byte array size
Parameters
capacityThe capacity

Definition at line 165 of file ExternalFifoQueue.hpp.

◆ getCapacity()

template<typename T>
FwSizeType Fw::ExternalFifoQueue< T >::getCapacity ( ) const
inlineoverridevirtual

Get the capacity (maximum number of items stored in the queue)

Returns
The capacity

Implements Fw::SizedContainer.

Definition at line 151 of file ExternalFifoQueue.hpp.

◆ getSize()

template<typename T>
FwSizeType Fw::ExternalFifoQueue< T >::getSize ( ) const
inlineoverridevirtual

Get the size (number of items stored in the queue)

Returns
The size

Implements Fw::SizedContainer.

Definition at line 147 of file ExternalFifoQueue.hpp.

◆ operator=()

template<typename T>
ExternalFifoQueue<T>& Fw::ExternalFifoQueue< T >::operator= ( const ExternalFifoQueue< T > &  queue)
inline

operator=

Definition at line 62 of file ExternalFifoQueue.hpp.

◆ setStorage() [1/2]

template<typename T>
void Fw::ExternalFifoQueue< T >::setStorage ( T *  items,
FwSizeType  capacity 
)
inline

Set the storage (typed data)

Parameters
itemsThe items
capacityThe capacity

Definition at line 80 of file ExternalFifoQueue.hpp.

◆ setStorage() [2/2]

template<typename T>
void Fw::ExternalFifoQueue< T >::setStorage ( ByteArray  data,
FwSizeType  capacity 
)
inline

Set the storage (untyped data)

Parameters
dataThe data
capacityThe capacity

Definition at line 92 of file ExternalFifoQueue.hpp.

Friends And Related Function Documentation

◆ ExternalFifoQueueTester

template<typename T>
template<typename TT >
friend class ExternalFifoQueueTester
friend

Definition at line 24 of file ExternalFifoQueue.hpp.


The documentation for this class was generated from the following file: