Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions
mrpt::math::CArray Class Reference

Detailed Description

A STL container (as wrapper) for arrays of constant size defined at compile time - Users will most likely prefer to use CArrayPOD and its derived classes instead.

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:
CArrayNumeric (for another, non-related base template class that DOES support maths)

#include <mrpt/math/CArray.h>

List of all members.

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.
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

Definition at line 83 of file CArray.h.

Definition at line 85 of file CArray.h.

Definition at line 98 of file CArray.h.

typedef std::ptrdiff_t mrpt::math::CArray::difference_type

Definition at line 87 of file CArray.h.

Definition at line 82 of file CArray.h.

Definition at line 84 of file CArray.h.

typedef std::reverse_iterator<iterator> mrpt::math::CArray::reverse_iterator

Definition at line 97 of file CArray.h.

typedef std::size_t mrpt::math::CArray::size_type

Definition at line 86 of file CArray.h.

Definition at line 81 of file CArray.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
static_size 

Definition at line 138 of file CArray.h.


Member Function Documentation

void mrpt::math::CArray::assign ( const T &  value) [inline]

Definition at line 165 of file CArray.h.

References elems.

void mrpt::math::CArray::assign ( const size_t  n,
const T &  value 
) [inline]

Definition at line 170 of file CArray.h.

References ASSERTDEB_, and elems.

template<typename I >
void mrpt::math::CArray::assign ( b,
const I &  e 
) [inline]

Definition at line 177 of file CArray.h.

References ASSERTDEB_, mrpt::math::distance(), begin(), and end().

reference mrpt::math::CArray::at ( size_type  i) [inline]

Definition at line 125 of file CArray.h.

References rangecheck(), and elems.

const_reference mrpt::math::CArray::at ( size_type  i) const [inline]

Definition at line 126 of file CArray.h.

References rangecheck(), and elems.

reference mrpt::math::CArray::back ( ) [inline]

Definition at line 131 of file CArray.h.

References elems.

const_reference mrpt::math::CArray::back ( ) const [inline]

Definition at line 132 of file CArray.h.

References elems.

iterator mrpt::math::CArray::begin ( ) [inline]

Definition at line 90 of file CArray.h.

References elems.

Referenced by rend(), swap(), operator=(), assign(), and mrpt::math::CArray< T, 0 >::rend().

const_iterator mrpt::math::CArray::begin ( ) const [inline]

Definition at line 91 of file CArray.h.

References elems.

const T* mrpt::math::CArray::data ( ) const [inline]

Definition at line 152 of file CArray.h.

References elems.

T* mrpt::math::CArray::data ( ) [inline]

Definition at line 155 of file CArray.h.

References elems.

static bool mrpt::math::CArray::empty ( ) [inline, static]

Definition at line 136 of file CArray.h.

iterator mrpt::math::CArray::end ( ) [inline]

Definition at line 92 of file CArray.h.

References elems.

Referenced by rbegin(), swap(), operator=(), assign(), and mrpt::math::CArray< T, 0 >::rbegin().

const_iterator mrpt::math::CArray::end ( ) const [inline]

Definition at line 93 of file CArray.h.

References elems.

reference mrpt::math::CArray::front ( ) [inline]

Definition at line 129 of file CArray.h.

References elems.

const_reference mrpt::math::CArray::front ( ) const [inline]

Definition at line 130 of file CArray.h.

References elems.

static size_type mrpt::math::CArray::max_size ( ) [inline, static]

Definition at line 137 of file CArray.h.

template<typename T2 >
CArray<T,N>& mrpt::math::CArray::operator= ( const CArray< T2, N > &  rhs) [inline]

Definition at line 159 of file CArray.h.

References begin(), and end().

reference mrpt::math::CArray::operator[] ( size_type  i) [inline]

Definition at line 121 of file CArray.h.

References elems.

const_reference mrpt::math::CArray::operator[] ( size_type  i) const [inline]

Definition at line 122 of file CArray.h.

References elems.

static void mrpt::math::CArray::rangecheck ( size_type  i) [inline, static, private]

Definition at line 184 of file CArray.h.

References size().

Referenced by at().

reverse_iterator mrpt::math::CArray::rbegin ( ) [inline]

Definition at line 111 of file CArray.h.

References end().

const_reverse_iterator mrpt::math::CArray::rbegin ( ) const [inline]

Definition at line 112 of file CArray.h.

References end().

reverse_iterator mrpt::math::CArray::rend ( ) [inline]

Definition at line 115 of file CArray.h.

References begin().

const_reverse_iterator mrpt::math::CArray::rend ( ) const [inline]

Definition at line 116 of file CArray.h.

References begin().

void mrpt::math::CArray::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 141 of file CArray.h.

References mrpt::format().

static size_type mrpt::math::CArray::size ( ) [inline, static]

Definition at line 135 of file CArray.h.

Referenced by rangecheck().

void mrpt::math::CArray::swap ( CArray< T, N > &  y) [inline]

Definition at line 147 of file CArray.h.

References begin(), and end().


Member Data Documentation

Definition at line 77 of file CArray.h.

Referenced by begin(), end(), operator[](), at(), front(), back(), data(), and assign().




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011