A bounded priority queue. More...
#include <mbl_priority_bounded_queue.h>
Public Types | |
typedef C::value_type | value_type |
typedef C::size_type | size_type |
typedef C::allocator_type | allocator_type |
typedef const value_type * | ITER |
Public Member Functions | |
mbl_priority_bounded_queue (unsigned bound_size=10, const O &comp=O()) | |
mbl_priority_bounded_queue (size_type bound_size, ITER first, ITER last, const O &comp=O(), const allocator_type &alloc=allocator_type()) | |
Construct a bounded priority queue from a controlled sequence. | |
size_type | bound_size () const |
The largest size the queue can be before it starts throwing out data. | |
void | set_bound_size (size_type bound_size) |
Set the largest size the queue can be before it starts throwing out data. | |
bool | empty () const |
size_type | size () const |
value_type & | top () |
const value_type & | top () const |
void | push (const value_type &x) |
void | pop () |
Protected Attributes | |
size_type | b_size_ |
C | c_ |
O | comp_ |
A bounded priority queue.
This is identical to a vcl_priority_queue, but as more elements are added past the queue's bound size the largest values are thrown out. So this queue keeps the n smallest values that are passed to it.
To store the largest values, use vcl_more as the comparator O.
top() returns the value that is closest to being thrown out, which is the largest value in the case of the default predicate.
Definition at line 29 of file mbl_priority_bounded_queue.h.
typedef C::allocator_type mbl_priority_bounded_queue< T, C, O >::allocator_type |
Definition at line 37 of file mbl_priority_bounded_queue.h.
typedef const value_type* mbl_priority_bounded_queue< T, C, O >::ITER |
Definition at line 47 of file mbl_priority_bounded_queue.h.
typedef C::size_type mbl_priority_bounded_queue< T, C, O >::size_type |
Definition at line 33 of file mbl_priority_bounded_queue.h.
typedef C::value_type mbl_priority_bounded_queue< T, C, O >::value_type |
Definition at line 32 of file mbl_priority_bounded_queue.h.
mbl_priority_bounded_queue< T, C, O >::mbl_priority_bounded_queue | ( | unsigned | bound_size = 10 , |
const O & | comp = O() |
||
) | [inline, explicit] |
Definition at line 41 of file mbl_priority_bounded_queue.h.
mbl_priority_bounded_queue< T, C, O >::mbl_priority_bounded_queue | ( | size_type | bound_size, |
ITER | first, | ||
ITER | last, | ||
const O & | comp = O() , |
||
const allocator_type & | alloc = allocator_type() |
||
) | [inline] |
Construct a bounded priority queue from a controlled sequence.
The bounded size will be the length of the sequence.
Definition at line 51 of file mbl_priority_bounded_queue.h.
size_type mbl_priority_bounded_queue< T, C, O >::bound_size | ( | ) | const [inline] |
The largest size the queue can be before it starts throwing out data.
Definition at line 58 of file mbl_priority_bounded_queue.h.
bool mbl_priority_bounded_queue< T, C, O >::empty | ( | ) | const [inline] |
Definition at line 66 of file mbl_priority_bounded_queue.h.
void mbl_priority_bounded_queue< T, C, O >::pop | ( | ) | [inline] |
Definition at line 87 of file mbl_priority_bounded_queue.h.
void mbl_priority_bounded_queue< T, C, O >::push | ( | const value_type & | x | ) | [inline] |
Definition at line 74 of file mbl_priority_bounded_queue.h.
void mbl_priority_bounded_queue< T, C, O >::set_bound_size | ( | size_type | bound_size | ) | [inline] |
Set the largest size the queue can be before it starts throwing out data.
If the bound_size is smaller that the current size, then data will be thrown out.
Definition at line 62 of file mbl_priority_bounded_queue.h.
size_type mbl_priority_bounded_queue< T, C, O >::size | ( | ) | const [inline] |
Definition at line 68 of file mbl_priority_bounded_queue.h.
value_type& mbl_priority_bounded_queue< T, C, O >::top | ( | ) | [inline] |
Definition at line 70 of file mbl_priority_bounded_queue.h.
const value_type& mbl_priority_bounded_queue< T, C, O >::top | ( | ) | const [inline] |
Definition at line 72 of file mbl_priority_bounded_queue.h.
size_type mbl_priority_bounded_queue< T, C, O >::b_size_ [protected] |
Definition at line 90 of file mbl_priority_bounded_queue.h.
C mbl_priority_bounded_queue< T, C, O >::c_ [protected] |
Definition at line 91 of file mbl_priority_bounded_queue.h.
O mbl_priority_bounded_queue< T, C, O >::comp_ [protected] |
Definition at line 92 of file mbl_priority_bounded_queue.h.