Thrill  0.1
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

◆ container_iterator

using container_iterator = typename container_type::iterator
private

Definition at line 32 of file addressable_queues.hpp.

◆ container_type

using container_type = std::list<KeyType>
private

Definition at line 31 of file addressable_queues.hpp.

◆ handle

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

Definition at line 41 of file addressable_queues.hpp.

◆ meta_iterator

using meta_iterator = typename meta_type::iterator
private

Definition at line 34 of file addressable_queues.hpp.

◆ meta_type

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

Definition at line 33 of file addressable_queues.hpp.

Constructor & Destructor Documentation

◆ addressable_fifo_queue()

Create an empty queue.

Definition at line 44 of file addressable_queues.hpp.

◆ ~addressable_fifo_queue()

Definition at line 45 of file addressable_queues.hpp.

Member Function Documentation

◆ empty()

◆ erase() [1/2]

bool erase ( const KeyType &  e)
inline

◆ erase() [2/2]

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.

◆ insert()

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

◆ pop()

◆ top()

const KeyType& top ( ) const
inline

Member Data Documentation

◆ meta

meta_type meta
private

Definition at line 37 of file addressable_queues.hpp.

◆ vals

container_type vals
private

Definition at line 36 of file addressable_queues.hpp.


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