FreeFOAM The Cross-Platform CFD Toolkit
LIFOStack< T > Class Template Reference

A LIFO stack based on a singly-linked list. Operations are push(), pop(), top(), bottom() and empty(). More...

#include <OpenFOAM/LIFOStack.H>


Detailed Description

template<class T>
class Foam::LIFOStack< T >

A LIFO stack based on a singly-linked list. Operations are push(), pop(), top(), bottom() and empty().

Source files

Definition at line 51 of file LIFOStack.H.

+ Inheritance diagram for LIFOStack< T >:
+ Collaboration diagram for LIFOStack< T >:

List of all members.

Public Member Functions

 LIFOStack ()
 Construct null.
 LIFOStack (T a)
 Construct given initial T.
 LIFOStack (Istream &is)
 Construct from Istream.
T top () const
 Return a copy of the top element.
T bottom () const
 Return a copy of the bottom element.
void push (const T &a)
 Push an element onto the stack.
T pop ()
 Pop the top element off the stack.
- Public Member Functions inherited from SLList< T >
 SLList ()
 Null construct.
 SLList (T a)
 Construct given initial T.
 SLList (Istream &is)
 Construct from Istream.
- Public Member Functions inherited from LList< SLListBase, T >
 LList ()
 Null construct.
 LList (T a)
 Construct given initial T.
 LList (Istream &)
 Construct from Istream.
 LList (const LList< SLListBase, T > &)
 Construct as copy.
 ~LList ()
T & first ()
 Return the first entry added.
const T & first () const
 Return const access to the first entry added.
T & last ()
 Return the last entry added.
const T & last () const
 Return const access to the last entry added.
void insert (const T &a)
 Add at head of list.
void append (const T &a)
 Add at tail of list.
T removeHead ()
 Remove and return head.
T remove (link *l)
 Remove and return element.
T remove (iterator &it)
 Remove and return element specified by iterator.
void clear ()
 Delete contents of list.
void transfer (LList< SLListBase, T > &)
 Transfer the contents of the argument into this List.
void operator= (const LList< SLListBase, T > &)
- Public Member Functions inherited from SLListBase
 SLListBase ()
 Null construct.
 SLListBase (link *)
 Construct given initial entry.
 ~SLListBase ()
label size () const
 Return number of elements in list.
bool empty () const
 Return true if the list is empty.
void insert (link *)
 Add at head of list.
void append (link *)
 Add at tail of list.
void transfer (SLListBase &)
 Transfer the contents of the argument into this List.
iterator begin ()
const iterator & end ()
const_iterator cbegin () const
const const_iterator & cend () const
const_iterator begin () const
const const_iterator & end () const

Constructor & Destructor Documentation

LIFOStack ( )
inline

Construct null.

Definition at line 61 of file LIFOStack.H.

LIFOStack ( T  a)
inline

Construct given initial T.

Definition at line 65 of file LIFOStack.H.

LIFOStack ( Istream &  is)
inline

Construct from Istream.

Definition at line 71 of file LIFOStack.H.


Member Function Documentation

T top ( ) const
inline

Return a copy of the top element.

Definition at line 82 of file LIFOStack.H.

References LList< SLListBase, T >::first().

T bottom ( ) const
inline

Return a copy of the bottom element.

Definition at line 88 of file LIFOStack.H.

References LList< SLListBase, T >::last().

void push ( const T &  a)
inline

Push an element onto the stack.

Definition at line 97 of file LIFOStack.H.

References LList< SLListBase, T >::insert().

T pop ( )
inline

Pop the top element off the stack.

Definition at line 103 of file LIFOStack.H.

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


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