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

Detailed Description

template<typename KeyType, typename PriorityType, class Cmp = std::less<PriorityType>>
class foxxll::addressable_priority_queue< KeyType, PriorityType, Cmp >

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

Template Parameters
KeyTypeType of contained elements.
PriorityTypeType of Priority.

Definition at line 113 of file addressable_queues.hpp.

+ Inheritance diagram for addressable_priority_queue< KeyType, PriorityType, Cmp >:

#include <addressable_queues.hpp>


struct  cmp

Public Types

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

Public Member Functions

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

Private Types

using container_iterator = typename container_type::iterator
using container_type = std::set< std::pair< PriorityType, KeyType >, cmp >
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

Definition at line 127 of file addressable_queues.hpp.

using container_type = std::set<std::pair<PriorityType, KeyType>, cmp>

Definition at line 126 of file addressable_queues.hpp.

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

Definition at line 136 of file addressable_queues.hpp.

using meta_iterator = typename meta_type::iterator

Definition at line 129 of file addressable_queues.hpp.

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

Definition at line 128 of file addressable_queues.hpp.

Constructor & Destructor Documentation

Create an empty queue.

Definition at line 139 of file addressable_queues.hpp.

Definition at line 140 of file addressable_queues.hpp.

Member Function Documentation

bool empty ( ) const
bool erase ( const KeyType &  e)

Erase element from the queue.

eElement to remove.
If element was in.

Definition at line 167 of file addressable_queues.hpp.

void erase ( handle  i)

Erase element from the queue.

iIterator to element to remove.

Definition at line 179 of file addressable_queues.hpp.

std::pair<handle, bool> insert ( const KeyType &  e,
const PriorityType  o 

Insert new element. If the element is already in, it's priority is updated.

eElement to insert.
oPriority of element.
pair<handle, bool> Iterator to element; if element was newly inserted.

Definition at line 151 of file addressable_queues.hpp.

KeyType pop ( )

Remove top (= min) element from the queue.

Top element.

Definition at line 192 of file addressable_queues.hpp.

const KeyType& top ( ) const

Access top (= min) element in the queue.

Const reference to top element.

Definition at line 187 of file addressable_queues.hpp.

Referenced by addressable_priority_queue< swappable_block_identifier_type, foxxll::block_scheduler_algorithm_offline_lfd::priority >::pop().

Member Data Documentation

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