#include <FIFO.hpp>
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 FIFO & | operator= (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. | |
| Stack::PlainOldData::FIFO< T >::FIFO | ( | ) | [inline] |
Default Constructor.
| Stack::PlainOldData::FIFO< T >::FIFO | ( | const FIFO< T > & | other | ) | [inline] |
Copy constructor.
| Stack::PlainOldData::FIFO< T >::~FIFO | ( | ) | [inline] |
Destructor.
| 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.
| size_t Stack::PlainOldData::FIFO< T >::getSize | ( | ) | const [inline] |
Access size member.
| const FIFO& Stack::PlainOldData::FIFO< T >::operator= | ( | const FIFO< T > & | fifo | ) | [inline] |
Classic copy operator.
| T& Stack::PlainOldData::FIFO< T >::Pop | ( | ) | [inline] |
Pop an element from the list.
| void Stack::PlainOldData::FIFO< T >::Push | ( | const T & | ref | ) | [inline] |
Push an element to the list.
| void Stack::PlainOldData::FIFO< T >::Reset | ( | ) | [inline] |
Reset the FIFO.
