Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
addressable_fifo_queue< KeyType > Class Template Reference

Detailed Description

template<typename KeyType>
class foxxll::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 29 of file addressable_queues.hpp.

+ Inheritance diagram for addressable_fifo_queue< KeyType >:

#include <addressable_queues.hpp>

Public Types

using handle = meta_iterator
 Type of handle to an entry. For use with insert and remove. More...
 

Public Member Functions

 addressable_fifo_queue ()
 Create an empty queue. More...
 
 ~addressable_fifo_queue ()
 
bool empty () const
 
bool erase (const KeyType &e)
 
void erase (handle i)
 
std::pair< handle, bool > insert (const KeyType &e)
 
KeyType pop ()
 
const KeyType & top () const
 

Private Types

using container_iterator = typename container_type::iterator
 
using container_type = std::list< KeyType >
 
using meta_iterator = typename meta_type::iterator
 
using meta_type = std::map< KeyType, container_iterator >
 

Private Attributes

meta_type meta
 
container_type vals
 

Member Typedef Documentation

using container_iterator = typename container_type::iterator
private

Definition at line 32 of file addressable_queues.hpp.

using container_type = std::list<KeyType>
private

Definition at line 31 of file addressable_queues.hpp.

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

Definition at line 41 of file addressable_queues.hpp.

using meta_iterator = typename meta_type::iterator
private

Definition at line 34 of file addressable_queues.hpp.

using meta_type = std::map<KeyType, container_iterator>
private

Definition at line 33 of file addressable_queues.hpp.

Constructor & Destructor Documentation

Create an empty queue.

Definition at line 44 of file addressable_queues.hpp.

Definition at line 45 of file addressable_queues.hpp.

Member Function Documentation

bool erase ( const KeyType &  e)
inline
void erase ( handle  i)
inline

Erase element from the queue.

Parameters
iIterator to element to remove.

Definition at line 85 of file addressable_queues.hpp.

std::pair<handle, bool> 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 57 of file addressable_queues.hpp.

Referenced by block_scheduler_algorithm_online_lru< SwappableBlockType >::init(), and block_scheduler_algorithm_online_lru< SwappableBlockType >::release().

const KeyType& top ( ) const
inline

Access top element in the queue.

Returns
Const reference to top element.

Definition at line 93 of file addressable_queues.hpp.

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

Member Data Documentation


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