A dynamic array class. More...
#include <array.hh>

Public Types | |
| typedef T | element | 
| Element associated type.   | |
| typedef T | result | 
| Returned value types.   | |
| typedef array_fwd_iter< T > | fwd_eiter | 
| Iterator typesForward iterator associated type.   | |
| typedef array_bkd_iter< T > | bkd_eiter | 
| Backward iterator associated type.   | |
| typedef fwd_eiter | eiter | 
| Iterator associated type.   | |
Public Member Functions | |
| array< T > & | append (const T &elt) | 
Add the element elt at the end of this array.   | |
| template<typename U > | |
| array< T > & | append (const array< U > &other) | 
Add the elements of other at the end of this array.   | |
| void | clear () | 
| Empty the array.   | |
| void | fill (const T &value) | 
Fill the whole array with value value.   | |
| bool | is_empty () const | 
| Test if the array is empty.   | |
| ro_result | last () const | 
| Return the last element.   | |
| mutable_result | last () | 
| Return the last element.   | |
| std::size_t | memory_size () const | 
| Return the size of this array in memory.   | |
| unsigned | nelements () const | 
| Return the number of elements of the array.   | |
| ro_result | operator() (unsigned i) const | 
Return the i-th element of the array.   | |
| mutable_result | operator() (unsigned i) | 
Return the i-th element of the array.   | |
| ro_result | operator[] (unsigned i) const | 
Return the i-th element of the array.   | |
| mutable_result | operator[] (unsigned i) | 
Return the i-th element of the array.   | |
| void | reserve (unsigned n) | 
Reserve memory for n elements.   | |
| void | resize (unsigned n) | 
Resize this array to n elements.   | |
| void | resize (unsigned n, const T &value) | 
Resize this array to n elements with value as value.   | |
| unsigned | size () const | 
| Return the number of elements of the array.   | |
| const std::vector< T > & | std_vector () const | 
| Return the corresponding std::vector of elements.   | |
| array () | |
| ConstructorsConstructor without arguments.   | |
| array (unsigned n) | |
| Construct a new array and resize it to  elements.  | |
| array (unsigned n, const T &value) | |
| Construct a new array, resize it to  elements and fill it with default_value.   | |
A dynamic array class.
Elements are stored by copy. Implementation is lazy.
The parameter T is the element type, which shall not be const-qualified. 
Definition at line 99 of file util/array.hh.
| typedef array_bkd_iter<T> mln::util::array< T >::bkd_eiter | 
Backward iterator associated type.
Definition at line 124 of file util/array.hh.
| typedef fwd_eiter mln::util::array< T >::eiter | 
Iterator associated type.
Definition at line 127 of file util/array.hh.
| typedef T mln::util::array< T >::element | 
Element associated type.
Definition at line 107 of file util/array.hh.
| typedef array_fwd_iter<T> mln::util::array< T >::fwd_eiter | 
Iterator typesForward iterator associated type.
Definition at line 121 of file util/array.hh.
| typedef T mln::util::array< T >::result | 
Returned value types.
Related to the Function_v2v concept.
Definition at line 112 of file util/array.hh.
| mln::util::array< T >::array | ( | ) |  [inline] | 
        
ConstructorsConstructor without arguments.
Definition at line 427 of file util/array.hh.
| mln::util::array< T >::array | ( | unsigned | n | ) |  [inline] | 
        
Construct a new array and resize it to 
 elements. 
Definition at line 433 of file util/array.hh.
| mln::util::array< T >::array | ( | unsigned | n, | |
| const T & | value | |||
| ) |  [inline] | 
        
Construct a new array, resize it to 
 elements and fill it with default_value. 
Definition at line 440 of file util/array.hh.
| array< T > & mln::util::array< T >::append | ( | const T & | elt | ) |  [inline] | 
        
Add the element elt at the end of this array. 
Definition at line 472 of file util/array.hh.
Referenced by mln::io::dicom::get_header(), and mln::io::plot::load().
| array< T > & mln::util::array< T >::append | ( | const array< U > & | other | ) |  [inline] | 
        
Add the elements of other at the end of this array. 
Definition at line 482 of file util/array.hh.
References mln::util::array< T >::is_empty(), and mln::util::array< T >::std_vector().
| void mln::util::array< T >::clear | ( | ) |  [inline] | 
        
Empty the array.
All elements contained in the array are destroyed.
Definition at line 495 of file util/array.hh.
References mln::util::array< T >::is_empty().
Referenced by mln::io::plot::load().
| void mln::util::array< T >::fill | ( | const T & | value | ) |  [inline] | 
        
Fill the whole array with value value. 
Definition at line 504 of file util/array.hh.
| bool mln::util::array< T >::is_empty | ( | ) |  const [inline] | 
        
Test if the array is empty.
Definition at line 578 of file util/array.hh.
References mln::util::array< T >::nelements().
Referenced by mln::util::array< T >::append(), mln::util::array< T >::clear(), mln::make::image3d(), and mln::io::pnms::load().
| array< T >::ro_result mln::util::array< T >::last | ( | ) |  const [inline] | 
        
Return the last element.
Definition at line 562 of file util/array.hh.
References mln::util::array< T >::nelements().
| array< T >::mutable_result mln::util::array< T >::last | ( | ) |  [inline] | 
        
Return the last element.
Definition at line 570 of file util/array.hh.
References mln::util::array< T >::nelements().
| std::size_t mln::util::array< T >::memory_size | ( | ) |  const [inline] | 
        
Return the size of this array in memory.
Definition at line 602 of file util/array.hh.
References mln::util::array< T >::nelements().
| unsigned mln::util::array< T >::nelements | ( | ) |  const [inline] | 
        
Return the number of elements of the array.
Definition at line 520 of file util/array.hh.
Referenced by mln::labeling::fill_holes(), mln::make::image3d(), mln::util::array< T >::is_empty(), mln::util::array< T >::last(), mln::io::pnms::load(), mln::util::array< T >::memory_size(), mln::util::operator<<(), mln::util::array< T >::operator[](), mln::io::plot::save(), and mln::util::array< T >::size().
| array< T >::ro_result mln::util::array< T >::operator() | ( | unsigned | i | ) |  const [inline] | 
        
Return the i-th element of the array. 
Definition at line 528 of file util/array.hh.
| array< T >::mutable_result mln::util::array< T >::operator() | ( | unsigned | i | ) |  [inline] | 
        
Return the i-th element of the array. 
Definition at line 536 of file util/array.hh.
| array< T >::ro_result mln::util::array< T >::operator[] | ( | unsigned | i | ) |  const [inline] | 
        
Return the i-th element of the array. 
Definition at line 544 of file util/array.hh.
References mln::util::array< T >::nelements().
| array< T >::mutable_result mln::util::array< T >::operator[] | ( | unsigned | i | ) |  [inline] | 
        
Return the i-th element of the array. 
Definition at line 553 of file util/array.hh.
References mln::util::array< T >::nelements().
| void mln::util::array< T >::reserve | ( | unsigned | n | ) |  [inline] | 
        
Reserve memory for n elements. 
Definition at line 448 of file util/array.hh.
| void mln::util::array< T >::resize | ( | unsigned | n | ) |  [inline] | 
        
Resize this array to n elements. 
Definition at line 456 of file util/array.hh.
Referenced by mln::labeling::impl::generic::compute(), mln::labeling::impl::compute_fastest(), mln::io::raw::get_header(), and mln::io::dump::get_header().
| void mln::util::array< T >::resize | ( | unsigned | n, | |
| const T & | value | |||
| ) |  [inline] | 
        
Resize this array to n elements with value as value. 
Definition at line 464 of file util/array.hh.
| unsigned mln::util::array< T >::size | ( | ) |  const [inline] | 
        
Return the number of elements of the array.
Added for compatibility with fun::i2v::array.
Definition at line 512 of file util/array.hh.
References mln::util::array< T >::nelements().
Referenced by mln::labeling::impl::generic::compute(), mln::labeling::impl::compute_fastest(), mln::value::lut_vec< S, T >::lut_vec(), and mln::labeled_image_base< I, E >::update_data().
| const std::vector< T > & mln::util::array< T >::std_vector | ( | ) |  const [inline] | 
        
Return the corresponding std::vector of elements.
Definition at line 586 of file util/array.hh.
Referenced by mln::util::array< T >::append(), mln::value::lut_vec< S, T >::lut_vec(), and mln::util::operator==().
 1.7.1