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

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

Public Member Functions

 p_array ()
 p_array (const std::vector< P > &vect)
p_array< P > & append (const P &p)
p_array< P > & append (const p_array< P > &other)
void change (const psite &p, const P &new_p)
void clear ()
bool has (const psite &p) const
bool has (const util::index &i) const
std::vector< P > & hook_std_vector_ ()
void insert (const P &p)
bool is_empty () const
bool is_valid () const
std::size_t memory_size () const
unsigned nsites () const
const P & operator[] (unsigned i) const
P & operator[] (unsigned i)
const P & operator[] (const util::index &i) const
void reserve (size_type n)
void resize (size_t size)
const std::vector< P > & std_vector () const

Protected Attributes

std::vector< P > vect_

Public Types

typedef p_indexed_bkd_piter
< self_ > 
bkd_piter
typedef Site_Set< void > category
typedef P element
typedef p_array< P > exact_t
typedef p_indexed_fwd_piter
< self_ > 
fwd_piter
typedef P i_element
typedef fwd_piter piter
typedef p_indexed_psite< self_ > psite
typedef subject< P >::ret site
typedef std::vector< P >::size_type size_type

Detailed Description

template<typename P>
class mln::p_array< P >

Multi-set of sites.

Site set class based on std::vector.

Definition at line 84 of file p_array.hh.

Constructor & Destructor Documentation

template<typename P>
mln::p_array< P >::p_array ( )

Constructor.

template<typename P>
mln::p_array< P >::p_array ( const std::vector< P > &  vect)

Constructor from a vector vect.

Member Function Documentation

template<typename P>
p_array<P>& mln::p_array< P >::append ( const P &  p)

Append a point p.

template<typename P>
p_array<P>& mln::p_array< P >::append ( const p_array< P > &  other)

Append an array other of points.

template<typename P>
void mln::p_array< P >::change ( const psite p,
const P &  new_p 
)

Change site p into new_p.

template<typename P>
void mln::p_array< P >::clear ( )

Clear this set.

template<typename P>
bool mln::p_array< P >::has ( const psite p) const

Test is p belongs to this site set.

template<typename P>
bool mln::p_array< P >::has ( const util::index i) const

Test is index i belongs to this site set.

template<typename P>
std::vector<P>& mln::p_array< P >::hook_std_vector_ ( )

INTERNAL_API Hook to the std::vector.

template<typename P>
void mln::p_array< P >::insert ( const P &  p)

Insert a point p (equivalent as 'append').

bool mln::internal::site_set_base_< P, p_array< 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 P>
bool mln::p_array< P >::is_valid ( ) const

Test this set validity so returns always true.

template<typename P>
std::size_t mln::p_array< P >::memory_size ( ) const

Return the size of this site set in memory.

template<typename P>
unsigned mln::p_array< P >::nsites ( ) const

Give the number of sites.

template<typename P>
const P& mln::p_array< P >::operator[] ( unsigned  i) const

Return the i-th site (constant).

template<typename P>
P& mln::p_array< P >::operator[] ( unsigned  i)

Return the i-th site (mutable).

template<typename P>
const P& mln::p_array< P >::operator[] ( const util::index i) const

Return the i-th element.

template<typename P>
void mln::p_array< P >::reserve ( size_type  n)

Reserve n cells.

template<typename P>
void mln::p_array< P >::resize ( size_t  size)

Update the size of this array.

template<typename P>
const std::vector<P>& mln::p_array< P >::std_vector ( ) const

Return the corresponding std::vector of points.

Member Data Documentation

template<typename P>
std::vector<P> mln::p_array< P >::vect_
protected

Definition at line 177 of file p_array.hh.

Member Typedef Documentation

template<typename P>
typedef p_indexed_bkd_piter<self_> mln::p_array< P >::bkd_piter

Backward Site_Iterator associated type.

Definition at line 100 of file p_array.hh.

typedef Site_Set<void> mln::Site_Set< p_array< P > >::category
inherited

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

template<typename P>
typedef P mln::p_array< P >::element

Element associated type.

Definition at line 91 of file p_array.hh.

typedef p_array< P > mln::Object< p_array< P > >::exact_t
inherited

Definition at line 105 of file object.hh.

template<typename P>
typedef p_indexed_fwd_piter<self_> mln::p_array< P >::fwd_piter

Forward Site_Iterator associated type.

Definition at line 97 of file p_array.hh.

template<typename P>
typedef P mln::p_array< P >::i_element

Insertion element associated type.

Definition at line 141 of file p_array.hh.

template<typename P>
typedef fwd_piter mln::p_array< P >::piter

Site_Iterator associated type.

Definition at line 103 of file p_array.hh.

template<typename P>
typedef p_indexed_psite<self_> mln::p_array< P >::psite

Psite associated type.

Definition at line 94 of file p_array.hh.

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

Site associated type.

Definition at line 58 of file site_set_base.hh.

template<typename P>
typedef std::vector<P>::size_type mln::p_array< P >::size_type

Definition at line 88 of file p_array.hh.