Loading...
Searching...
No Matches
FIFOStack< T > Class Template Reference

A FIFO stack based on a singly-linked list. More...

#include <FIFOStack.H>

Inheritance diagram for FIFOStack< T >:
Collaboration diagram for FIFOStack< T >:

Public Member Functions

const Ttop () const
 Const reference to the top element.
const Tbottom () const
 Const reference to the bottom element.
void push (const T &elem)
 Push an element onto the back of the stack.
void push (T &&elem)
 Move an element onto the back of the stack.
T pop ()
 Pop the bottom element off the stack.
Public Member Functions inherited from LList< SLListBase, T >
 LList ()=default
 Default construct.
 LList (const T &elem)
 Construct and copy add initial item.
 LList (T &&elem)
 Construct and move add initial item.
 LList (Istream &is)
 Construct from Istream.
 LList (const LList< SLListBase, T > &lst)
 Copy construct.
 LList (LList< SLListBase, T > &&lst)
 Move construct.
 LList (std::initializer_list< T > lst)
 Copy construct from an initializer list.
 ~LList ()
 Destructor. Calls clear().
reference front ()
 The first entry in the list.
const_reference front () const
 The first entry in the list (const access).
reference back ()
 The last entry in the list.
const_reference back () const
 The last entry in the list (const access).
void push_front (const T &elem)
 Add copy at front of list.
void push_front (T &&elem)
 Move construct at front of list.
void push_back (const T &elem)
 Add copy at back of list.
void push_back (T &&elem)
 Move construct at back of list.
void clear ()
 Delete contents of list.
void pop_front (label n=1)
 Remove first element(s) from the list (deletes pointers).
T removeHead ()
 Remove and return first entry.
T remove (link *item)
 Remove and return element.
T remove (iterator &iter)
 Remove and return element specified by iterator.
void transfer (LList< SLListBase, T > &lst)
 Transfer the contents of the argument into this List and annul the argument list.
void operator= (const LList< SLListBase, T > &lst)
 Copy assignment.
void operator= (LList< SLListBase, T > &&lst)
 Move assignment.
void operator= (std::initializer_list< T > lst)
 Copy assignment from an initializer list.
IstreamreadList (Istream &is)
 Read list from Istream.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write LList with line-breaks when length exceeds shortLen.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
reverse_iterator rbegin ()
 Iterator to last item in list with non-const access.
const_reverse_iterator crbegin () const
 Iterator to last item in list with const access.
const_iterator begin () const
 Iterator to first item in list with const access.
const_reverse_iterator rbegin () const
 Iterator to last item in list with const access.
const iterator & end ()
 End of list for forward iterators.
const const_iterator & cend () const
 End of list for forward iterators.
const reverse_iterator & rend ()
 End of list for reverse iterators.
const const_reverse_iterator & crend () const
 End of list for reverse iterators.
const const_iterator & end () const
 End of list for forward iterators.
const const_reverse_iterator & rend () const
 End of list for reverse iterators.
reference first ()
 The first entry in the list.
const_reference first () const
 The first entry in the list (const access).
reference last ()
 The last entry in the list.
const_reference last () const
 The last entry in the list (const access).
void prepend (const T &elem)
 Add copy at front of list.
void prepend (T &&elem)
 Move construct at front of list.
void append (const T &elem)
 Add copy at back of list.
void append (T &&elem)
 Move construct at back of list.
void insert (const T &elem)
 Add copy at front of list. Same as push_front().
void insert (T &&elem)
 Move construct at front of list. Same as push_front().
Public Member Functions inherited from SLListBase
 SLListBase ()=default
 Default construct.
 SLListBase (const SLListBase &)=delete
 No copy construct.
void operator= (const SLListBase &)=delete
 No copy assignment.
 ~SLListBase ()=default
 Destructor.
bool empty () const noexcept
 True if the list is empty.
label size () const noexcept
 The number of elements in list.
linkfront ()
 Return first entry.
const linkfront () const
 Return const access to first entry.
linkback ()
 Return last entry.
const linkback () const
 Return const access to last entry.
void push_front (link *item)
 Add at front of list.
void push_back (link *item)
 Add at back of list.
linkremoveHead ()
 Remove and return first entry.
linkremove (link *item)
linkremove (iterator &iter)
void clear ()
 Clear the list.
void swap (SLListBase &lst)
 Swap the contents of list.
void transfer (SLListBase &lst)
 Transfer the contents of the argument into this list and annul the argument list.
iterator begin ()
 Iterator to first item in list with non-const access.
const_iterator cbegin () const
 Iterator to first item in list with const access.
const_iterator crbegin () const =delete
 No reverse iteration.
const iteratorend ()
 End of list for iterators.
const const_iteratorcend () const
 End of list for iterators.
const const_iteratorcrend () const =delete
 No reverse iteration.
linkfirst ()
 Return first entry.
const linkfirst () const
 Return const access to first entry.
linklast ()
 Return last entry.
const linklast () const
 Return const access to last entry.
void prepend (link *item)
 Add at front of list.
void append (link *item)
 Add at back of list.

Additional Inherited Members

Public Types inherited from LList< SLListBase, T >
typedef T value_type
 Type of values stored.
typedef Tpointer
 Pointer for value_type.
typedef const Tconst_pointer
 Const pointer for value_type.
typedef Treference
 Reference for value_type.
typedef const Tconst_reference
 Const reference for value_type.
typedef label size_type
 The type that can represent the container size.
typedef label difference_type
 The difference between iterators.
using base_iterator
using const_base_iterator
Protected Member Functions inherited from SLListBase
template<class IteratorType>
IteratorType iterator_first () const
 Return iterator to first item or end-iterator if list is empty.
template<class IteratorType>
IteratorType iterator_last () const
 Return iterator to last item or end-iterator if list is empty.
Static Protected Member Functions inherited from SLListBase
template<class IteratorType>
static const IteratorType & iterator_end ()
 Factory method to return an iterator end.
template<class IteratorType>
static const IteratorType & iterator_rend ()=delete
 Factory method to return an iterator rend.

Detailed Description

template<class T>
class Foam::FIFOStack< T >

A FIFO stack based on a singly-linked list.

Stack operations are push(), pop(), top(), bottom().

Definition at line 45 of file FIFOStack.H.

Member Function Documentation

◆ top()

template<class T>
const T & top ( ) const
inline

Const reference to the top element.

Definition at line 64 of file FIFOStack.H.

References LList< SLListBase, T >::back(), and Foam::T().

Here is the call graph for this function:

◆ bottom()

template<class T>
const T & bottom ( ) const
inline

Const reference to the bottom element.

Definition at line 72 of file FIFOStack.H.

References LList< SLListBase, T >::front(), and Foam::T().

Here is the call graph for this function:

◆ push() [1/2]

template<class T>
void push ( const T & elem)
inline

Push an element onto the back of the stack.

Definition at line 80 of file FIFOStack.H.

References LList< SLListBase, T >::push_back(), and Foam::T().

Referenced by valueAverageBase::calc(), DAC< CompType, ThermoType >::reduceMechanism(), DRG< CompType, ThermoType >::reduceMechanism(), DRGEP< CompType, ThermoType >::reduceMechanism(), and PFA< CompType, ThermoType >::reduceMechanism().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push() [2/2]

template<class T>
void push ( T && elem)
inline

Move an element onto the back of the stack.

Definition at line 88 of file FIFOStack.H.

References LList< SLListBase, T >::push_back(), and Foam::T().

Here is the call graph for this function:

◆ pop()

template<class T>
T pop ( )
inline

Pop the bottom element off the stack.

Definition at line 96 of file FIFOStack.H.

References LList< SLListBase, T >::removeHead(), and Foam::T().

Referenced by valueAverageBase::calc(), DAC< CompType, ThermoType >::reduceMechanism(), DRG< CompType, ThermoType >::reduceMechanism(), DRGEP< CompType, ThermoType >::reduceMechanism(), and PFA< CompType, ThermoType >::reduceMechanism().

Here is the call graph for this function:
Here is the caller graph for this function:

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