Public Types | Public Member Functions

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 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.
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.

Detailed Description

template<typename KeyType>
class addressable_fifo_queue< KeyType >

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

Template Parameters:
KeyType Type of contained elements.

Member Typedef Documentation

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

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


Constructor & Destructor Documentation

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

Create an empty queue.


Member Function Documentation

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

Check if queue is empty.

Returns:
If queue is empty.

Referenced by addressable_fifo_queue< swappable_block_identifier_type >::pop().

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

Erase element from the queue.

Parameters:
i Iterator to element to remove.
template<typename KeyType>
bool addressable_fifo_queue< KeyType >::erase ( const KeyType &  e  )  [inline]

Erase element from the queue.

Parameters:
e Element to remove.
Returns:
If element was in.
template<typename KeyType>
std::pair<handle, bool> 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:
e Element to insert.
Returns:
pair<handle, bool> Iterator to element; if element was newly inserted.
template<typename KeyType>
KeyType addressable_fifo_queue< KeyType >::pop (  )  [inline]

Remove top element from the queue.

Returns:
Top element.
template<typename KeyType>
const KeyType& addressable_fifo_queue< KeyType >::top (  )  const [inline]

Access top element in the queue.

Returns:
Const reference to top element.

Referenced by addressable_fifo_queue< swappable_block_identifier_type >::pop().


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