OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
nanoflann::CArray< T, N > Class Template Reference

A STL container (as wrapper) for arrays of constant size defined at compile time (class imported from the MRPT project) 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). More...

#include <nanoflann.hpp>

+ Collaboration diagram for nanoflann::CArray< T, N >:

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< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_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)
 

Static Public Member Functions

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

Public Attributes

elems [N]
 

Detailed Description

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

A STL container (as wrapper) for arrays of constant size defined at compile time (class imported from the MRPT project) 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

Definition at line 674 of file nanoflann.hpp.

Member Typedef Documentation

◆ const_iterator

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

Definition at line 682 of file nanoflann.hpp.

◆ const_reference

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

Definition at line 684 of file nanoflann.hpp.

◆ const_reverse_iterator

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

Definition at line 705 of file nanoflann.hpp.

◆ difference_type

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

Definition at line 686 of file nanoflann.hpp.

◆ iterator

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

Definition at line 681 of file nanoflann.hpp.

◆ reference

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

Definition at line 683 of file nanoflann.hpp.

◆ reverse_iterator

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

Definition at line 704 of file nanoflann.hpp.

◆ size_type

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

Definition at line 685 of file nanoflann.hpp.

◆ value_type

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

Definition at line 680 of file nanoflann.hpp.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 769 of file nanoflann.hpp.

769 {
770 static_size = N
771 };

Member Function Documentation

◆ assign() [1/2]

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

Definition at line 800 of file nanoflann.hpp.

800 {
801 assert(N == n);
802 for (size_t i = 0; i < N; i++)
803 elems[i] = value;
804 }

◆ assign() [2/2]

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

Definition at line 795 of file nanoflann.hpp.

795 {
796 for (size_t i = 0; i < N; i++)
797 elems[i] = value;
798 }
+ Here is the caller graph for this function:

◆ at() [1/2]

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

Definition at line 738 of file nanoflann.hpp.

738 {
739 rangecheck(i);
740 return elems[i];
741 }

◆ at() [2/2]

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

Definition at line 742 of file nanoflann.hpp.

742 {
743 rangecheck(i);
744 return elems[i];
745 }

◆ back() [1/2]

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

Definition at line 753 of file nanoflann.hpp.

753 {
754 return elems[N - 1];
755 }

◆ back() [2/2]

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

Definition at line 756 of file nanoflann.hpp.

756 {
757 return elems[N - 1];
758 }

◆ begin() [1/2]

template<typename T , std::size_t N>
iterator nanoflann::CArray< T, N >::begin ( )
inline

Definition at line 689 of file nanoflann.hpp.

689 {
690 return elems;
691 }
+ Here is the caller graph for this function:

◆ begin() [2/2]

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

Definition at line 692 of file nanoflann.hpp.

692 {
693 return elems;
694 }

◆ data() [1/2]

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

Definition at line 786 of file nanoflann.hpp.

786 {
787 return elems;
788 }

◆ data() [2/2]

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

Definition at line 782 of file nanoflann.hpp.

782 {
783 return elems;
784 }

◆ empty()

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

Definition at line 763 of file nanoflann.hpp.

763 {
764 return false;
765 }

◆ end() [1/2]

template<typename T , std::size_t N>
iterator nanoflann::CArray< T, N >::end ( )
inline

Definition at line 695 of file nanoflann.hpp.

695 {
696 return elems + N;
697 }
+ Here is the caller graph for this function:

◆ end() [2/2]

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

Definition at line 698 of file nanoflann.hpp.

698 {
699 return elems + N;
700 }

◆ front() [1/2]

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

Definition at line 747 of file nanoflann.hpp.

747 {
748 return elems[0];
749 }

◆ front() [2/2]

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

Definition at line 750 of file nanoflann.hpp.

750 {
751 return elems[0];
752 }

◆ max_size()

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

Definition at line 766 of file nanoflann.hpp.

766 {
767 return N;
768 }

◆ operator=()

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

Definition at line 790 of file nanoflann.hpp.

790 {
791 std::copy(rhs.begin(), rhs.end(), begin());
792 return *this;
793 }

References nanoflann::CArray< T, N >::begin(), and nanoflann::CArray< T, N >::end().

+ Here is the call graph for this function:

◆ operator[]() [1/2]

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

Definition at line 731 of file nanoflann.hpp.

731 {
732 return elems[i];
733 }

◆ operator[]() [2/2]

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

Definition at line 734 of file nanoflann.hpp.

734 {
735 return elems[i];
736 }

◆ rbegin() [1/2]

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

Definition at line 718 of file nanoflann.hpp.

718 {
719 return reverse_iterator(end());
720 }
std::reverse_iterator< iterator > reverse_iterator

◆ rbegin() [2/2]

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

Definition at line 721 of file nanoflann.hpp.

721 {
722 return const_reverse_iterator(end());
723 }
std::reverse_iterator< const_iterator > const_reverse_iterator

◆ rend() [1/2]

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

Definition at line 724 of file nanoflann.hpp.

724 {
725 return reverse_iterator(begin());
726 }

◆ rend() [2/2]

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

Definition at line 727 of file nanoflann.hpp.

727 {
729 }

◆ resize()

template<typename T , std::size_t N>
void nanoflann::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 773 of file nanoflann.hpp.

773 {
774 if (nElements != N)
775 throw std::logic_error("Try to change the size of a CArray.");
776 }

◆ size()

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

Definition at line 760 of file nanoflann.hpp.

760 {
761 return N;
762 }

◆ swap()

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

Definition at line 778 of file nanoflann.hpp.

778 {
779 std::swap_ranges(begin(), end(), y.begin());
780 }

References nanoflann::CArray< T, N >::begin().

+ Here is the call graph for this function:

Member Data Documentation

◆ elems

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

Definition at line 676 of file nanoflann.hpp.


The documentation for this class was generated from the following file: