Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Types | Private Attributes
stxxl::addressable_fifo_queue< KeyType > Class Template Reference

An internal fifo queue that allows removing elements addressed with (a copy of) themselves. More...

#include <addressable_queues.h>

Inheritance diagram for stxxl::addressable_fifo_queue< KeyType >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef meta_iter_t handle
 Type of handle to an entry. For use with insert and remove.

Public Member Functions

 addressable_fifo_queue ()
 Create an empty queue.
 ~addressable_fifo_queue ()
bool empty () const
 Check if queue is empty.
std::pair< handle, bool > insert (const KeyType &e)
 Insert new element. If the element is already in, it is moved to the back.
bool erase (const KeyType &e)
 Erase element from the queue.
void erase (handle i)
 Erase element from the queue.
const KeyType & top () const
 Access top element in the queue.
KeyType pop ()
 Remove top element from the queue.

Private Types

typedef std::list< KeyType > container_t
typedef container_t::iterator container_iter_t
typedef std::map< KeyType,
container_iter_t
meta_t
typedef meta_t::iterator meta_iter_t

Private Attributes

container_t vals
meta_t meta

Detailed Description

template<typename KeyType>
class stxxl::addressable_fifo_queue< KeyType >

An internal fifo queue that allows removing elements addressed with (a copy of) themselves.

Template Parameters:
KeyTypeType of contained elements.

Definition at line 27 of file addressable_queues.h.


Member Typedef Documentation

template<typename KeyType>
typedef container_t::iterator stxxl::addressable_fifo_queue< KeyType >::container_iter_t [private]

Definition at line 30 of file addressable_queues.h.

template<typename KeyType>
typedef std::list<KeyType> stxxl::addressable_fifo_queue< KeyType >::container_t [private]

Definition at line 29 of file addressable_queues.h.

template<typename KeyType>
typedef meta_iter_t stxxl::addressable_fifo_queue< KeyType >::handle

Type of handle to an entry. For use with insert and remove.

Definition at line 39 of file addressable_queues.h.

template<typename KeyType>
typedef meta_t::iterator stxxl::addressable_fifo_queue< KeyType >::meta_iter_t [private]

Definition at line 32 of file addressable_queues.h.

template<typename KeyType>
typedef std::map<KeyType, container_iter_t> stxxl::addressable_fifo_queue< KeyType >::meta_t [private]

Definition at line 31 of file addressable_queues.h.


Constructor & Destructor Documentation

template<typename KeyType>
stxxl::addressable_fifo_queue< KeyType >::addressable_fifo_queue ( ) [inline]

Create an empty queue.

Definition at line 42 of file addressable_queues.h.

template<typename KeyType>
stxxl::addressable_fifo_queue< KeyType >::~addressable_fifo_queue ( ) [inline]

Definition at line 43 of file addressable_queues.h.


Member Function Documentation

template<typename KeyType>
bool stxxl::addressable_fifo_queue< KeyType >::empty ( ) const [inline]

Check if queue is empty.

Returns:
If queue is empty.

Definition at line 47 of file addressable_queues.h.

template<typename KeyType>
bool stxxl::addressable_fifo_queue< KeyType >::erase ( const KeyType &  e) [inline]

Erase element from the queue.

Parameters:
eElement to remove.
Returns:
If element was in.

Definition at line 69 of file addressable_queues.h.

template<typename KeyType>
void stxxl::addressable_fifo_queue< KeyType >::erase ( handle  i) [inline]

Erase element from the queue.

Parameters:
iIterator to element to remove.

Definition at line 81 of file addressable_queues.h.

template<typename KeyType>
std::pair<handle, bool> stxxl::addressable_fifo_queue< KeyType >::insert ( const KeyType &  e) [inline]

Insert new element. If the element is already in, it is moved to the back.

Parameters:
eElement to insert.
Returns:
pair<handle, bool> Iterator to element; if element was newly inserted.

Definition at line 53 of file addressable_queues.h.

template<typename KeyType>
KeyType stxxl::addressable_fifo_queue< KeyType >::pop ( ) [inline]

Remove top element from the queue.

Returns:
Top element.

Definition at line 94 of file addressable_queues.h.

template<typename KeyType>
const KeyType& stxxl::addressable_fifo_queue< KeyType >::top ( ) const [inline]

Access top element in the queue.

Returns:
Const reference to top element.

Definition at line 89 of file addressable_queues.h.


Member Data Documentation

template<typename KeyType>
meta_t stxxl::addressable_fifo_queue< KeyType >::meta [private]

Definition at line 35 of file addressable_queues.h.

template<typename KeyType>
container_t stxxl::addressable_fifo_queue< KeyType >::vals [private]

Definition at line 34 of file addressable_queues.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines