$extrastylesheet
#include <mln/core/site_set/p_priority.hh>
Public Member Functions | |
p_priority () | |
void | clear () |
bool | exists_priority (const P &priority) const |
const Q::element & | front () const |
bool | has (const psite &) const |
const P | highest_priority () const |
void | insert (const i_element &p_e) |
void | insert (const p_priority< P, Q > &other) |
bool | is_empty () const |
bool | is_valid () const |
const P | lowest_priority () const |
std::size_t | memory_size () const |
unsigned | nsites () const |
const Q & | operator() (const P &priority) const |
void | pop () |
Q::element | pop_front () |
const util::set< P > & | priorities () const |
void | push (const P &priority, const element &e) |
Protected Member Functions | |
bool | run_ () const |
Protected Attributes | |
unsigned | n_ |
util::set< P > | p_ |
q_type_ | q_ |
Public Types | |
typedef p_double_piter< self_, mln_fwd_eiter(util::set< P > ), typename Q::bkd_piter > | bkd_piter |
typedef Site_Set< void > | category |
typedef Q::element | element |
typedef p_priority< P, Q > | exact_t |
typedef p_double_piter< self_, mln_bkd_eiter(util::set< P > ), typename Q::fwd_piter > | fwd_piter |
typedef std::pair< P, element > | i_element |
typedef fwd_piter | piter |
typedef p_double_psite< self_, Q > | psite |
typedef subject< Q::site >::ret | site |
Protected Types | |
typedef std::map< P, Q, util::ord< P > > | q_type_ |
Related Functions | |
(Note that these are not member functions.) | |
template<typename P , typename Q > | |
std::ostream & | operator<< (std::ostream &ostr, const p_priority< P, Q > &pq) |
Priority queue.
The parameter P
is the type of the priorities (for instance unsigned).
The parameter Q
is a type of queue (for instance p_queue<point2d>).
Definition at line 77 of file p_priority.hh.
mln::p_priority< P, Q >::p_priority | ( | ) |
Constructor.
void mln::p_priority< P, Q >::clear | ( | ) |
Clear the queue.
bool mln::p_priority< P, Q >::exists_priority | ( | const P & | priority | ) | const |
Test if the priority
exists.
const Q ::element& mln::p_priority< P, Q >::front | ( | ) | const |
Give an element with highest priority.
If several elements have this priority, the least recently inserted is chosen.
bool mln::p_priority< P, Q >::has | ( | const psite & | ) | const |
Test is the psite p
belongs to this site set.
const P mln::p_priority< P, Q >::highest_priority | ( | ) | const |
Give the highest priority.
void mln::p_priority< P, Q >::insert | ( | const i_element & | p_e | ) |
Insert a pair p_e
(priority p, element e).
void mln::p_priority< P, Q >::insert | ( | const p_priority< P, Q > & | other | ) |
Insert elements from another priority queue.
|
inherited |
Test if the site set is empty.
This final method dispatches to is_empty_ whose default implementation relies on the 'nsites' method.
bool mln::p_priority< P, Q >::is_valid | ( | ) | const |
Test this set validity so returns always true.
const P mln::p_priority< P, Q >::lowest_priority | ( | ) | const |
Give the lowest priority.
std::size_t mln::p_priority< P, Q >::memory_size | ( | ) | const |
Return the size of this site set in memory.
unsigned mln::p_priority< P, Q >::nsites | ( | ) | const |
Give the number of sites.
const Q& mln::p_priority< P, Q >::operator() | ( | const P & | priority | ) | const |
Give the queue with the priority priority
.
This method always works: if the priority is not in this set, an empty queue is returned.
void mln::p_priority< P, Q >::pop | ( | ) |
Pop (remove) from the queue an element with highest priority.
If several elements have this priority, the least recently inserted is chosen.
Q ::element mln::p_priority< P, Q >::pop_front | ( | ) |
Return an element with highest priority and remove it from the set.
If several elements have this priority, the least recently inserted is chosen.
const util::set<P>& mln::p_priority< P, Q >::priorities | ( | ) | const |
Give the set of priorities.
void mln::p_priority< P, Q >::push | ( | const P & | priority, |
const element & | e | ||
) |
Push in the queue with priority
the element e
.
|
protected |
|
related |
|
protected |
Definition at line 187 of file p_priority.hh.
|
protected |
Definition at line 185 of file p_priority.hh.
|
protected |
Definition at line 186 of file p_priority.hh.
typedef p_double_piter< self_, mln_fwd_eiter(util::set<P>), typename Q ::bkd_piter > mln::p_priority< P, Q >::bkd_piter |
Backward Site_Iterator associated type.
Definition at line 99 of file p_priority.hh.
|
inherited |
Definition at line 74 of file core/concept/site_set.hh.
typedef Q ::element mln::p_priority< P, Q >::element |
Element associated type.
Definition at line 85 of file p_priority.hh.
|
inherited |
typedef p_double_piter< self_, mln_bkd_eiter(util::set<P>), typename Q ::fwd_piter > mln::p_priority< P, Q >::fwd_piter |
Forward Site_Iterator associated type.
Definition at line 94 of file p_priority.hh.
typedef std::pair<P, element> mln::p_priority< P, Q >::i_element |
Insertion element associated type.
Definition at line 122 of file p_priority.hh.
typedef fwd_piter mln::p_priority< P, Q >::piter |
Site_Iterator associated type.
Definition at line 102 of file p_priority.hh.
typedef p_double_psite<self_, Q> mln::p_priority< P, Q >::psite |
Psite associated type.
Definition at line 89 of file p_priority.hh.
|
protected |
Definition at line 183 of file p_priority.hh.
|
inherited |
Site associated type.
Definition at line 58 of file site_set_base.hh.