Stack::PlainOldData::FIFO< T > Class Template Reference

#include <FIFO.hpp>

List of all members.


Detailed Description

template<typename T>
class Stack::PlainOldData::FIFO< T >

Provides FIFO like stack functionalities only for POD objects It is recommended not to push heap stored objects (like new/malloced object).

The stack takes care of memory management in its internal array when destructed or reallocated (size zeros and grow again)

            Stack::WithClone::FIFO<double> stack;
            // Push some data onto this stack
            stack.Push(3.1);
            stack.Push(4);
            // Pop them
            double a = stack.Pop();
            // Don't delete the popped pointer
            double b = stack.Pop();
            // c will be default constructed object (probably 0xCDCDCDCDCDCDCDCD)
            double c = stack.Pop(); 
            // On leaving scope, the array will be destructed


Public Member Functions

 FIFO (const FIFO &other)
 Copy constructor.
 FIFO ()
 Default Constructor.
bool Forget (const T &avoidDeleting)
 Tell the stack it is no more required to delete the given pop'd object.
size_t getSize () const
 Access size member.
const FIFOoperator= (const FIFO< T > &fifo)
 Classic copy operator.
T & Pop ()
 Pop an element from the list.
void Push (const T &ref)
 Push an element to the list.
void Reset ()
 Reset the FIFO.
 ~FIFO ()
 Destructor.


Constructor & Destructor Documentation

template<typename T>
Stack::PlainOldData::FIFO< T >::FIFO (  )  [inline]

Default Constructor.

template<typename T>
Stack::PlainOldData::FIFO< T >::FIFO ( const FIFO< T > &  other  )  [inline]

Copy constructor.

template<typename T>
Stack::PlainOldData::FIFO< T >::~FIFO (  )  [inline]

Destructor.


Member Function Documentation

template<typename T>
bool Stack::PlainOldData::FIFO< T >::Forget ( const T &  avoidDeleting  )  [inline]

Tell the stack it is no more required to delete the given pop'd object.

Returns:
false because it is not supported for POD

template<typename T>
size_t Stack::PlainOldData::FIFO< T >::getSize (  )  const [inline]

Access size member.

template<typename T>
const FIFO& Stack::PlainOldData::FIFO< T >::operator= ( const FIFO< T > &  fifo  )  [inline]

Classic copy operator.

template<typename T>
T& Stack::PlainOldData::FIFO< T >::Pop (  )  [inline]

Pop an element from the list.

template<typename T>
void Stack::PlainOldData::FIFO< T >::Push ( const T &  ref  )  [inline]

Push an element to the list.

template<typename T>
void Stack::PlainOldData::FIFO< T >::Reset (  )  [inline]

Reset the FIFO.


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

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is