An implementation of an external-memory stack. More...
#include <tpie/stack.h>
Public Member Functions | |
| stack (double blockFactor=1.0) | |
| Initialize anonymous stack. More... | |
| stack (const std::string &path, double blockFactor=1.0) | |
| Initialize named, nontemporary stack. More... | |
| stack (temp_file &tempFile, double blockFactor=1.0) | |
| Initialize temporary stack. More... | |
| ~stack () | |
| Closes the underlying stream and truncates it to the logical end of the stack. More... | |
| void | push (const T &t) |
| Pushes one item onto the stack. More... | |
| const T & | pop () |
| Pops one item from the stack. More... | |
| const T & | top () |
| Peeks at the topmost item on the stack. More... | |
| stream_size_type | size () const |
| Returns the number of items currently on the stack. More... | |
| bool | empty () const |
| Returns whether the stack is empty or not. More... | |
Static Public Member Functions | |
| static memory_size_type | memory_usage (float blockFactor=1.0) |
| Compute the memory used by a stack. More... | |
Protected Attributes | |
| file_stream< T > | m_stream |
| The stream used to store the items. More... | |
An implementation of an external-memory stack.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns whether the stack is empty or not.
m_file_stream.can_read_back();
Definition at line 139 of file stack.h.
Referenced by tpie::pipelining::bits::reverser_pull_output_t< T >::can_pull(), and tpie::pipelining::bits::reverser_output_t< dest_t >::go().
|
inlinestatic |
Compute the memory used by a stack.
Definition at line 146 of file stack.h.
Referenced by tpie::ami::stack< item_type >::main_memory_usage().
|
inline |
Pops one item from the stack.
Definition at line 113 of file stack.h.
Referenced by tpie::pipelining::bits::ami_input_stack_t< dest_t >::go(), tpie::pipelining::bits::reverser_output_t< dest_t >::go(), and tpie::pipelining::bits::reverser_pull_output_t< T >::pull().
|
inline |
|
inline |
Returns the number of items currently on the stack.
Definition at line 132 of file stack.h.
Referenced by tpie::stack< item_type >::empty(), tpie::pipelining::bits::ami_input_stack_t< dest_t >::propagate(), and tpie::pipelining::bits::ami_pull_input_stack_t< T >::propagate().
|
inline |
|
protected |
The stream used to store the items.
Definition at line 155 of file stack.h.
Referenced by tpie::stack< item_type >::pop(), tpie::stack< item_type >::size(), tpie::stack< item_type >::stack(), tpie::stack< item_type >::top(), and tpie::stack< item_type >::~stack().