$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mln::p_key< K, P > Class Template Reference

#include <mln/core/site_set/p_key.hh>

Public Member Functions

 p_key ()
void change_key (const K &k, const K &new_k)
template<typename F >
void change_keys (const Function_v2v< F > &f)
void clear ()
bool exists_key (const K &key) const
bool has (const psite &) const
bool has (const P &p) const
void insert (const i_element &k_p)
void insert (const K &k, const P &p)
bool is_empty () const
bool is_valid () const
const K & key (const P &p) const
const util::set< K > & keys () const
std::size_t memory_size () const
unsigned nsites () const
const p_set< P > & operator() (const K &key) const
void remove (const P &p)
void remove_key (const K &k)

Protected Member Functions

bool run_ () const

Protected Attributes

util::set< K > b_
k_t k_
unsigned n_
s_t s_

Public Types

typedef p_double_piter< self_,
mln_bkd_eiter(util::set< K >
), typename p_set< P >
::bkd_piter
bkd_piter
typedef Site_Set< void > category
typedef P element
typedef p_key< K, P > exact_t
typedef p_double_piter< self_,
mln_fwd_eiter(util::set< K >
), typename p_set< P >
::fwd_piter
fwd_piter
typedef std::pair< K, P > i_element
typedef fwd_piter piter
typedef p_double_psite< self_,
p_set< P > > 
psite
typedef P r_element
typedef subject< P >::ret site

Protected Types

typedef std::map< P, K,
util::ord< P > > 
k_t
typedef std::map< K, p_set< P >
, util::ord< K > > 
s_t

Related Functions

(Note that these are not member functions.)

template<typename K , typename P >
std::ostream & operator<< (std::ostream &ostr, const p_key< K, P > &pk)

Detailed Description

template<typename K, typename P>
class mln::p_key< K, P >

Priority queue class.

Definition at line 73 of file p_key.hh.

Constructor & Destructor Documentation

template<typename K , typename P >
mln::p_key< K, P >::p_key ( )

Constructor.

Member Function Documentation

template<typename K , typename P >
void mln::p_key< K, P >::change_key ( const K &  k,
const K &  new_k 
)

Change the key k into a new value new_k.

template<typename K , typename P >
template<typename F >
void mln::p_key< K, P >::change_keys ( const Function_v2v< F > &  f)

Change the keys by applying the function f.

template<typename K , typename P >
void mln::p_key< K, P >::clear ( )

Clear this site set.

template<typename K , typename P >
bool mln::p_key< K, P >::exists_key ( const K &  key) const

Test if the priority exists.

template<typename K , typename P >
bool mln::p_key< K, P >::has ( const psite ) const

Test is the psite p belongs to this site set.

template<typename K , typename P >
bool mln::p_key< K, P >::has ( const P &  p) const

Test is the psite p belongs to this site set.

template<typename K , typename P >
void mln::p_key< K, P >::insert ( const i_element k_p)

Insert a pair k_p (key k, site p).

template<typename K , typename P >
void mln::p_key< K, P >::insert ( const K &  k,
const P &  p 
)

Insert a pair (key k, site p).

bool mln::internal::site_set_base_< P, p_key< K, P > >::is_empty ( ) const
inherited

Test if the site set is empty.

This final method dispatches to is_empty_ whose default implementation relies on the 'nsites' method.

template<typename K , typename P >
bool mln::p_key< K, P >::is_valid ( ) const

Test this set validity so returns always true.

template<typename K , typename P >
const K& mln::p_key< K, P >::key ( const P &  p) const

Give the key associated with site p.

template<typename K , typename P >
const util::set<K>& mln::p_key< K, P >::keys ( ) const

Give the set of keys.

template<typename K , typename P >
std::size_t mln::p_key< K, P >::memory_size ( ) const

Return the size of this site set in memory.

template<typename K , typename P >
unsigned mln::p_key< K, P >::nsites ( ) const

Give the number of sites.

template<typename K , typename P >
const p_set<P>& mln::p_key< K, P >::operator() ( const K &  key) 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.

template<typename K , typename P >
void mln::p_key< K, P >::remove ( const P &  p)

Remove a site p.

template<typename K , typename P >
void mln::p_key< K, P >::remove_key ( const K &  k)

Remove all sites with key k.

template<typename K , typename P >
bool mln::p_key< K, P >::run_ ( ) const
protected

Friends And Related Function Documentation

template<typename K , typename P >
std::ostream & operator<< ( std::ostream &  ostr,
const p_key< K, P > &  pk 
)
related

Member Data Documentation

template<typename K , typename P >
util::set<K> mln::p_key< K, P >::b_
protected

Definition at line 184 of file p_key.hh.

template<typename K , typename P >
k_t mln::p_key< K, P >::k_
protected

Definition at line 192 of file p_key.hh.

template<typename K , typename P >
unsigned mln::p_key< K, P >::n_
protected

Definition at line 195 of file p_key.hh.

template<typename K , typename P >
s_t mln::p_key< K, P >::s_
protected

Definition at line 188 of file p_key.hh.

Member Typedef Documentation

template<typename K , typename P >
typedef p_double_piter<self_, mln_bkd_eiter(util::set<K>), typename p_set<P>::bkd_piter> mln::p_key< K, P >::bkd_piter

Backward Site_Iterator associated type.

Definition at line 94 of file p_key.hh.

typedef Site_Set<void> mln::Site_Set< p_key< K, P > >::category
inherited

Definition at line 74 of file core/concept/site_set.hh.

template<typename K , typename P >
typedef P mln::p_key< K, P >::element

Element associated type.

Definition at line 80 of file p_key.hh.

typedef p_key< K, P > mln::Object< p_key< K, P > >::exact_t
inherited

Definition at line 105 of file object.hh.

template<typename K , typename P >
typedef p_double_piter<self_, mln_fwd_eiter(util::set<K>), typename p_set<P>::fwd_piter> mln::p_key< K, P >::fwd_piter

Forward Site_Iterator associated type.

Definition at line 89 of file p_key.hh.

template<typename K , typename P >
typedef std::pair<K,P> mln::p_key< K, P >::i_element

Insertion element associated type.

Definition at line 119 of file p_key.hh.

template<typename K , typename P >
typedef std::map<P, K, util::ord<P> > mln::p_key< K, P >::k_t
protected

Definition at line 191 of file p_key.hh.

template<typename K , typename P >
typedef fwd_piter mln::p_key< K, P >::piter

Site_Iterator associated type.

Definition at line 97 of file p_key.hh.

template<typename K , typename P >
typedef p_double_psite< self_, p_set<P> > mln::p_key< K, P >::psite

Psite associated type.

Definition at line 84 of file p_key.hh.

template<typename K , typename P >
typedef P mln::p_key< K, P >::r_element

Removal element associated type.

Definition at line 135 of file p_key.hh.

template<typename K , typename P >
typedef std::map<K, p_set<P>, util::ord<K> > mln::p_key< K, P >::s_t
protected

Definition at line 187 of file p_key.hh.

typedef subject<P>::ret mln::internal::site_set_base_< P, p_key< K, P > >::site
inherited

Site associated type.

Definition at line 58 of file site_set_base.hh.