Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions
mrpt::utils::CArray< T, N > Class Template Reference

Detailed Description

template<typename T, std::size_t N>
class mrpt::utils::CArray< T, N >

A STL container (as wrapper) for arrays of constant size defined at compile time.

This code is an adapted version from Boost, modifed for its integration within MRPT (JLBC, Dec/2009) (Renamed array -> CArray to avoid possible potential conflicts).

See http://www.josuttis.com/cppcode for details and the latest version. See http://www.boost.org/libs/array for Documentation. for documentation.

(C) Copyright Nicolai M. Josuttis 2001. Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.

29 Jan 2004 - minor fixes (Nico Josuttis) 04 Dec 2003 - update to synch with library TR1 (Alisdair Meredith) 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries. 05 Aug 2001 - minor update (Nico Josuttis) 20 Jan 2001 - STLport fix (Beman Dawes) 29 Sep 2000 - Initial Revision (Nico Josuttis)

Jan 30, 2004

Note
This class DOES NOT support mathematical operations on its elements: it's a generic container, it doesn't assume they are numerical.
For a summary and classification of all MRPT vector, array and matrix classes see: http://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes
See Also
mrpt::math::CArrayNumeric (for another, non-related base template class that DOES support maths)

Definition at line 53 of file CArray.h.

#include <mrpt/utils/CArray.h>

Inheritance diagram for mrpt::utils::CArray< T, N >:
Inheritance graph

Public Types

enum  { static_size = N }
 
typedef T value_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T & reference
 
typedef const T & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void resize (const size_t nElements)
 This method has no effects in this class, but raises an exception if the expected size does not match. More...
 
void swap (CArray< T, N > &y)
 
const T * data () const
 
T * data ()
 
template<typename T2 >
CArray< T, N > & operator= (const CArray< T2, N > &rhs)
 
void assign (const T &value)
 
void assign (const size_t n, const T &value)
 
template<typename I >
void assign (I b, const I &e)
 

Static Public Member Functions

static size_type size ()
 
static bool empty ()
 
static size_type max_size ()
 

Public Attributes

elems [N]
 

Static Private Member Functions

static void rangecheck (size_type i)
 

Member Typedef Documentation

template<typename T, std::size_t N>
typedef const T* mrpt::utils::CArray< T, N >::const_iterator

Definition at line 61 of file CArray.h.

template<typename T, std::size_t N>
typedef const T& mrpt::utils::CArray< T, N >::const_reference

Definition at line 63 of file CArray.h.

template<typename T, std::size_t N>
typedef std::reverse_iterator<const_iterator> mrpt::utils::CArray< T, N >::const_reverse_iterator

Definition at line 76 of file CArray.h.

template<typename T, std::size_t N>
typedef std::ptrdiff_t mrpt::utils::CArray< T, N >::difference_type

Definition at line 65 of file CArray.h.

template<typename T, std::size_t N>
typedef T* mrpt::utils::CArray< T, N >::iterator

Definition at line 60 of file CArray.h.

template<typename T, std::size_t N>
typedef T& mrpt::utils::CArray< T, N >::reference

Definition at line 62 of file CArray.h.

template<typename T, std::size_t N>
typedef std::reverse_iterator<iterator> mrpt::utils::CArray< T, N >::reverse_iterator

Definition at line 75 of file CArray.h.

template<typename T, std::size_t N>
typedef std::size_t mrpt::utils::CArray< T, N >::size_type

Definition at line 64 of file CArray.h.

template<typename T, std::size_t N>
typedef T mrpt::utils::CArray< T, N >::value_type

Definition at line 59 of file CArray.h.

Member Enumeration Documentation

template<typename T, std::size_t N>
anonymous enum
Enumerator
static_size 

Definition at line 116 of file CArray.h.

Member Function Documentation

template<typename T, std::size_t N>
void mrpt::utils::CArray< T, N >::assign ( const T &  value)
inline

Definition at line 143 of file CArray.h.

template<typename T, std::size_t N>
void mrpt::utils::CArray< T, N >::assign ( const size_t  n,
const T &  value 
)
inline

Definition at line 148 of file CArray.h.

template<typename T, std::size_t N>
template<typename I >
void mrpt::utils::CArray< T, N >::assign ( b,
const I &  e 
)
inline

Definition at line 157 of file CArray.h.

template<typename T, std::size_t N>
reference mrpt::utils::CArray< T, N >::at ( size_type  i)
inline

Definition at line 103 of file CArray.h.

template<typename T, std::size_t N>
const_reference mrpt::utils::CArray< T, N >::at ( size_type  i) const
inline

Definition at line 104 of file CArray.h.

template<typename T, std::size_t N>
reference mrpt::utils::CArray< T, N >::back ( )
inline

Definition at line 109 of file CArray.h.

template<typename T, std::size_t N>
const_reference mrpt::utils::CArray< T, N >::back ( ) const
inline

Definition at line 110 of file CArray.h.

template<typename T, std::size_t N>
iterator mrpt::utils::CArray< T, N >::begin ( )
inline
template<typename T, std::size_t N>
const_iterator mrpt::utils::CArray< T, N >::begin ( ) const
inline

Definition at line 69 of file CArray.h.

template<typename T, std::size_t N>
const T* mrpt::utils::CArray< T, N >::data ( ) const
inline

Definition at line 130 of file CArray.h.

template<typename T, std::size_t N>
T* mrpt::utils::CArray< T, N >::data ( )
inline

Definition at line 133 of file CArray.h.

template<typename T, std::size_t N>
static bool mrpt::utils::CArray< T, N >::empty ( )
inlinestatic

Definition at line 114 of file CArray.h.

template<typename T, std::size_t N>
iterator mrpt::utils::CArray< T, N >::end ( )
inline
template<typename T, std::size_t N>
const_iterator mrpt::utils::CArray< T, N >::end ( ) const
inline

Definition at line 71 of file CArray.h.

template<typename T, std::size_t N>
reference mrpt::utils::CArray< T, N >::front ( )
inline

Definition at line 107 of file CArray.h.

template<typename T, std::size_t N>
const_reference mrpt::utils::CArray< T, N >::front ( ) const
inline

Definition at line 108 of file CArray.h.

template<typename T, std::size_t N>
static size_type mrpt::utils::CArray< T, N >::max_size ( )
inlinestatic

Definition at line 115 of file CArray.h.

template<typename T, std::size_t N>
template<typename T2 >
CArray<T,N>& mrpt::utils::CArray< T, N >::operator= ( const CArray< T2, N > &  rhs)
inline

Definition at line 137 of file CArray.h.

template<typename T, std::size_t N>
reference mrpt::utils::CArray< T, N >::operator[] ( size_type  i)
inline

Definition at line 99 of file CArray.h.

template<typename T, std::size_t N>
const_reference mrpt::utils::CArray< T, N >::operator[] ( size_type  i) const
inline

Definition at line 100 of file CArray.h.

template<typename T, std::size_t N>
static void mrpt::utils::CArray< T, N >::rangecheck ( size_type  i)
inlinestaticprivate

Definition at line 166 of file CArray.h.

Referenced by mrpt::utils::CArray< size_t, 2 >::at().

template<typename T, std::size_t N>
reverse_iterator mrpt::utils::CArray< T, N >::rbegin ( )
inline

Definition at line 89 of file CArray.h.

template<typename T, std::size_t N>
const_reverse_iterator mrpt::utils::CArray< T, N >::rbegin ( ) const
inline

Definition at line 90 of file CArray.h.

template<typename T, std::size_t N>
reverse_iterator mrpt::utils::CArray< T, N >::rend ( )
inline

Definition at line 93 of file CArray.h.

template<typename T, std::size_t N>
const_reverse_iterator mrpt::utils::CArray< T, N >::rend ( ) const
inline

Definition at line 94 of file CArray.h.

template<typename T, std::size_t N>
void mrpt::utils::CArray< T, N >::resize ( const size_t  nElements)
inline

This method has no effects in this class, but raises an exception if the expected size does not match.

Definition at line 119 of file CArray.h.

template<typename T, std::size_t N>
static size_type mrpt::utils::CArray< T, N >::size ( )
inlinestatic

Definition at line 113 of file CArray.h.

Referenced by mrpt::utils::CArray< size_t, 2 >::rangecheck().

template<typename T, std::size_t N>
void mrpt::utils::CArray< T, N >::swap ( CArray< T, N > &  y)
inline

Definition at line 125 of file CArray.h.

Member Data Documentation

template<typename T, std::size_t N>
T mrpt::utils::CArray< T, N >::elems[N]



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018