PCL
pcl::Array< T, A > Class Template Reference

Generic dynamic array. More...

#include <Array.h>

+ Inheritance diagram for pcl::Array< T, A >:

Public Types

typedef pcl::Allocator< T, A > allocator
 
typedef A block_allocator
 
typedef const T * const_iterator
 
typedef ReverseRandomAccessIterator< const_iterator, const T > const_reverse_iterator
 
typedef T * iterator
 
typedef ReverseRandomAccessIterator< iterator, T > reverse_iterator
 

Public Member Functions

 Array ()
 
 Array (size_type n)
 
 Array (size_type n, const T &v)
 
template<class FI >
 Array (FI i, FI j)
 
template<typename T1 >
 Array (std::initializer_list< T1 > l)
 
 Array (const Array &x)
 
 Array (Array &&x)
 
 ~Array ()
 
void Add (const Array &x)
 
void Add (const T &v, size_type n=1)
 
template<class FI >
void Add (FI p, FI q)
 
void Append (const Array &x)
 
void Append (const T &v, size_type n=1)
 
template<class FI >
void Append (FI p, FI q)
 
template<class F >
void Apply (F f)
 
template<class F >
void Apply (F f) const
 
void Assign (const Array &x)
 
void Assign (const T &v, size_type n=1)
 
template<class FI >
void Assign (FI i, FI j)
 
iterator At (size_type i)
 
const_iterator At (size_type i) const
 
size_type Available () const
 
iterator Begin ()
 
const_iterator Begin () const
 
iterator begin ()
 
const_iterator begin () const
 
size_type Capacity () const
 
void Clear ()
 
const_iterator ConstBegin () const
 
const_iterator ConstEnd () const
 
const_reverse_iterator ConstReverseBegin () const
 
const_reverse_iterator ConstReverseEnd () const
 
bool Contains (const T &v) const
 
template<class BP >
bool Contains (const T &v, BP p) const
 
template<class FI >
iterator ContainsSubset (FI i, FI j) const
 
template<class FI , class BP >
iterator ContainsSubset (FI i, FI j, BP p) const
 
template<class C >
iterator ContainsSubset (const C &c) const
 
template<class C , class BP >
iterator ContainsSubset (const C &c, BP p) const
 
size_type Count (const T &v) const
 
template<class BP >
size_type Count (const T &v, BP p) const
 
template<class UP >
size_type CountIf (UP p) const
 
iterator End ()
 
const_iterator End () const
 
iterator end ()
 
const_iterator end () const
 
void EnsureUnique ()
 
iterator Expand (size_type n=1)
 
void Fill (const T &v)
 
template<class F >
iterator FirstThat (F f) const
 
const allocatorGetAllocator () const
 
iterator Grow (iterator i, size_type n=1)
 
uint64 Hash (uint64 seed=0) const
 
uint32 Hash32 (uint32 seed=0) const
 
uint64 Hash64 (uint64 seed=0) const
 
void Import (iterator i, iterator j)
 
iterator Insert (iterator i, const Array &x)
 
iterator Insert (iterator i, const T &v, size_type n=1)
 
template<class FI >
iterator Insert (iterator i, FI p, FI q)
 
bool IsAliasOf (const Array &x) const
 
bool IsEmpty () const
 
bool IsUnique () const
 
bool IsValid () const
 
template<class F >
iterator LastThat (F f) const
 
size_type Length () const
 
size_type LowerBound () const
 
iterator MaxItem () const
 
template<class BP >
iterator MaxItem (BP p) const
 
iterator MinItem () const
 
template<class BP >
iterator MinItem (BP p) const
 
iterator MutableIterator (const_iterator i)
 
T & operator* ()
 
const T & operator* () const
 
Arrayoperator= (const Array &x)
 
Arrayoperator= (Array &&x)
 
T & operator[] (size_type i)
 
const T & operator[] (size_type i) const
 
void Prepend (const Array &x)
 
void Prepend (const T &v, size_type n=1)
 
template<class FI >
void Prepend (FI p, FI q)
 
iterator Release ()
 
void Remove (iterator i, size_type n=1)
 
void Remove (iterator i, iterator j)
 
void Remove (const T &v)
 
template<class BP >
void Remove (const T &v, BP p)
 
iterator Replace (iterator i, iterator j, const Array &x)
 
iterator Replace (iterator i, iterator j, const T &v, size_type n=1)
 
template<class FI >
iterator Replace (iterator i, iterator j, FI p, FI q)
 
void Reserve (size_type n)
 
void Resize (size_type n)
 
void Reverse ()
 
reverse_iterator ReverseBegin ()
 
const_reverse_iterator ReverseBegin () const
 
reverse_iterator ReverseEnd ()
 
const_reverse_iterator ReverseEnd () const
 
void Rotate (distance_type n)
 
iterator Search (const T &v) const
 
template<class BP >
iterator Search (const T &v, BP p) const
 
iterator SearchLast (const T &v) const
 
template<class BP >
iterator SearchLast (const T &v, BP p) const
 
template<class BI >
iterator SearchLastSubset (BI i, BI j) const
 
template<class BI , class BP >
iterator SearchLastSubset (BI i, BI j, BP p) const
 
template<class C >
iterator SearchLastSubset (const C &x) const
 
template<class C , class BP >
iterator SearchLastSubset (const C &x, BP p) const
 
template<class FI >
iterator SearchSubset (FI i, FI j) const
 
template<class FI , class BP >
iterator SearchSubset (FI i, FI j, BP p) const
 
template<class C >
iterator SearchSubset (const C &x) const
 
template<class C , class BP >
iterator SearchSubset (const C &x, BP p) const
 
void SecureFill (const T &v)
 
void SetAllocator (const allocator &a)
 
void ShiftLeft (const T &v, size_type n=1)
 
void ShiftRight (const T &v, size_type n=1)
 
void Shrink (size_type n=1)
 
size_type Size () const
 
void Sort ()
 
template<class BP >
void Sort (BP p)
 
void Squeeze ()
 
template<class S >
S & ToCommaSeparated (S &s) const
 
template<class S , typename SP >
S & ToSeparated (S &s, SP separator) const
 
template<class S , typename SP , class AF >
S & ToSeparated (S &s, SP separator, AF append) const
 
template<class S >
S & ToSpaceSeparated (S &s) const
 
template<class S >
S & ToTabSeparated (S &s) const
 
void Transfer (Array &x)
 
void Transfer (Array &&x)
 
void Truncate (iterator i)
 
void UniquifyIterator (iterator &i)
 
void UniquifyIterators (iterator &i, iterator &j)
 
size_type UpperBound () const
 

Friends

void Swap (Array &x1, Array &x2)
 

Detailed Description

template<class T, class A = StandardAllocator>
class pcl::Array< T, A >

Array is a generic, finite ordered sequence of objects, implemented as a reference-counted, dynamic array of T instances. The type A provides dynamic allocation for contiguous sequences of elements of type T (StandardAllocator is used by default).

See also
SortedArray, ReferenceArray, ReferenceSortedArray, IndirectArray, IndirectSortedArray

Definition at line 99 of file Array.h.

Member Typedef Documentation

◆ allocator

template<class T, class A = StandardAllocator>
typedef pcl::Allocator<T,A> pcl::Array< T, A >::allocator

#

Definition at line 109 of file Array.h.

◆ block_allocator

template<class T, class A = StandardAllocator>
typedef A pcl::Array< T, A >::block_allocator

#

Definition at line 105 of file Array.h.

◆ const_iterator

template<class T, class A = StandardAllocator>
typedef const T* pcl::Array< T, A >::const_iterator

#

Definition at line 117 of file Array.h.

◆ const_reverse_iterator

template<class T, class A = StandardAllocator>
typedef ReverseRandomAccessIterator<const_iterator, const T> pcl::Array< T, A >::const_reverse_iterator

#

Definition at line 127 of file Array.h.

◆ iterator

template<class T, class A = StandardAllocator>
typedef T* pcl::Array< T, A >::iterator

#

Definition at line 113 of file Array.h.

◆ reverse_iterator

template<class T, class A = StandardAllocator>
typedef ReverseRandomAccessIterator<iterator, T> pcl::Array< T, A >::reverse_iterator

#

Definition at line 122 of file Array.h.

Constructor & Destructor Documentation

◆ Array() [1/7]

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::Array ( )
inline

Constructs an empty array.

Definition at line 134 of file Array.h.

◆ Array() [2/7]

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::Array ( size_type  n)
inlineexplicit

Constructs an array of n default-constructed objects.

Definition at line 143 of file Array.h.

◆ Array() [3/7]

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::Array ( size_type  n,
const T &  v 
)
inline

Constructs an array with n copies of an object v.

Definition at line 153 of file Array.h.

◆ Array() [4/7]

template<class T, class A = StandardAllocator>
template<class FI >
pcl::Array< T, A >::Array ( FI  i,
FI  j 
)
inline

Constructs an array that stores a copy of the objects in the range [i,j) of forward iterators.

Definition at line 165 of file Array.h.

◆ Array() [5/7]

template<class T, class A = StandardAllocator>
template<typename T1 >
pcl::Array< T, A >::Array ( std::initializer_list< T1 >  l)
inline

Constructs an array that stores a copy of the objects in the specified initializer list l.

This constructor is equivalent to:

Array( l.begin(), l.end() )

Definition at line 182 of file Array.h.

◆ Array() [6/7]

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::Array ( const Array< T, A > &  x)
inline

Copy constructor.

Definition at line 189 of file Array.h.

◆ Array() [7/7]

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::Array ( Array< T, A > &&  x)
inline

Move constructor.

Definition at line 198 of file Array.h.

◆ ~Array()

template<class T, class A = StandardAllocator>
pcl::Array< T, A >::~Array ( )
inline

Destroys an Array object. Destroys and deallocates all contained objects.

Definition at line 207 of file Array.h.

Member Function Documentation

◆ Add() [1/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Add ( const Array< T, A > &  x)
inline

A synonym for Append( const Array<>& ).

Definition at line 1006 of file Array.h.

◆ Add() [2/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Add ( const T &  v,
size_type  n = 1 
)
inline

A synonym for Append( const T&, size_type )

Definition at line 1014 of file Array.h.

◆ Add() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
void pcl::Array< T, A >::Add ( FI  p,
FI  q 
)
inline

A synonym for Append( FI, FI )

Definition at line 1023 of file Array.h.

◆ Append() [1/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Append ( const Array< T, A > &  x)
inline

Appends a copy of the objects stored in the array x to this array.

Definition at line 947 of file Array.h.

Referenced by pcl::operator<<().

◆ Append() [2/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Append ( const T &  v,
size_type  n = 1 
)
inline

Appends a contiguous sequence of n copies of the object v to this array.

Definition at line 956 of file Array.h.

◆ Append() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
void pcl::Array< T, A >::Append ( FI  p,
FI  q 
)
inline

Appends a copy of the sequence of objects defined by the range [p,q) of forward iterators to this array.

Note
p and q must not be iterators into this array.

Definition at line 968 of file Array.h.

◆ Apply() [1/2]

template<class T, class A = StandardAllocator>
template<class F >
void pcl::Array< T, A >::Apply ( f)
inline

Calls f( T& x ) for every object x contained by this array, successively from the first contained object to the last one.

Definition at line 1369 of file Array.h.

◆ Apply() [2/2]

template<class T, class A = StandardAllocator>
template<class F >
void pcl::Array< T, A >::Apply ( f) const
inline

Calls f( const T& x ) for every object x contained by this array, successively from the first contained object to the last one.

Definition at line 1380 of file Array.h.

◆ Assign() [1/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Assign ( const Array< T, A > &  x)
inline

Assigns an array x to this array.

Decrements the reference counter of the current array data, and destroys it if it becomes unreferenced.

Increments the reference counter of the source array's data and references it in this array.

Definition at line 645 of file Array.h.

◆ Assign() [2/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Assign ( const T &  v,
size_type  n = 1 
)
inline

Replaces the contents of this array with a sequence of n copies of an object v.

Definition at line 697 of file Array.h.

◆ Assign() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
void pcl::Array< T, A >::Assign ( FI  i,
FI  j 
)
inline

Replaces the contents of this array with a copy of the sequence defined by the range [i,j) of forward iterators.

Note
i and j must not be iterators into this array.

Definition at line 732 of file Array.h.

◆ At() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::At ( size_type  i)
inline

Returns an array iterator located at the specified array index i.

Definition at line 354 of file Array.h.

Referenced by pcl::GenericChebyshevFit< Tx, Ty >::Evaluate().

◆ At() [2/2]

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::At ( size_type  i) const
inline

Returns an immutable array iterator located at the specified index i.

Definition at line 364 of file Array.h.

◆ Available()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::Available ( ) const
inline

Returns the length of the space available in this array, or zero if this array cannot contain more objects. The available space is the number of objects that can be added to this array without requiring a reallocation. It is equal to Capacity() - Length() by definition.

Definition at line 285 of file Array.h.

◆ Begin() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Begin ( )
inline

Returns a mutable iterator located at the beginning of this array.

Definition at line 425 of file Array.h.

Referenced by pcl::operator==(), and pcl::Array< GenericVector< T > >::Replace().

◆ Begin() [2/2]

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::Begin ( ) const
inline

Returns an immutable iterator located at the beginning of this array.

Definition at line 434 of file Array.h.

◆ begin() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::begin ( )
inline

STL-compatible iteration. Equivalent to Begin().

Definition at line 594 of file Array.h.

◆ begin() [2/2]

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::begin ( ) const
inline

STL-compatible iteration. Equivalent to Begin() const.

Definition at line 602 of file Array.h.

◆ Capacity()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::Capacity ( ) const
inline

Returns the capacity of this array. The capacity is the maximum number of objects that this array can contain without requiring a reallocation.

Definition at line 274 of file Array.h.

◆ Clear()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Clear ( )
inline

Removes and possibly destroys all objects contained, yielding an empty array.

If this array is empty, then calling this member function has no effect.

If this array uniquely references its internal array data structure, all objects contained are destroyed and deallocated; otherwise its reference counter is decremented and a new, empty array data structure is created and uniquely referenced.

Definition at line 1152 of file Array.h.

◆ ConstBegin()

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::ConstBegin ( ) const
inline

Returns an immutable iterator located at the beginning of this array.

Definition at line 442 of file Array.h.

◆ ConstEnd()

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::ConstEnd ( ) const
inline

Returns an immutable iterator located at the end of this array.

Definition at line 467 of file Array.h.

◆ ConstReverseBegin()

template<class T, class A = StandardAllocator>
const_reverse_iterator pcl::Array< T, A >::ConstReverseBegin ( ) const
inline

Returns an immutable reverse iterator located at the reverse beginning of this array.

The reverse beginning corresponds to the last element in the array.

Definition at line 503 of file Array.h.

◆ ConstReverseEnd()

template<class T, class A = StandardAllocator>
const_reverse_iterator pcl::Array< T, A >::ConstReverseEnd ( ) const
inline

Returns an immutable reverse iterator located at the reverse end of this array.

The reverse end corresponds to an (nonexistent) element immediately before the first element in the array.

Definition at line 543 of file Array.h.

◆ Contains() [1/2]

template<class T, class A = StandardAllocator>
bool pcl::Array< T, A >::Contains ( const T &  v) const
inline

#

Definition at line 1609 of file Array.h.

◆ Contains() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
bool pcl::Array< T, A >::Contains ( const T &  v,
BP  p 
) const
inline

#

Definition at line 1617 of file Array.h.

◆ ContainsSubset() [1/4]

template<class T, class A = StandardAllocator>
template<class FI >
iterator pcl::Array< T, A >::ContainsSubset ( FI  i,
FI  j 
) const
inline

#

Definition at line 1625 of file Array.h.

◆ ContainsSubset() [2/4]

template<class T, class A = StandardAllocator>
template<class FI , class BP >
iterator pcl::Array< T, A >::ContainsSubset ( FI  i,
FI  j,
BP  p 
) const
inline

#

Definition at line 1633 of file Array.h.

◆ ContainsSubset() [3/4]

template<class T, class A = StandardAllocator>
template<class C >
iterator pcl::Array< T, A >::ContainsSubset ( const C &  c) const
inline

#

Definition at line 1641 of file Array.h.

◆ ContainsSubset() [4/4]

template<class T, class A = StandardAllocator>
template<class C , class BP >
iterator pcl::Array< T, A >::ContainsSubset ( const C &  c,
BP  p 
) const
inline

#

Definition at line 1649 of file Array.h.

◆ Count() [1/2]

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::Count ( const T &  v) const
inline

#

Definition at line 1409 of file Array.h.

◆ Count() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
size_type pcl::Array< T, A >::Count ( const T &  v,
BP  p 
) const
inline

#

Definition at line 1417 of file Array.h.

◆ CountIf()

template<class T, class A = StandardAllocator>
template<class UP >
size_type pcl::Array< T, A >::CountIf ( UP  p) const
inline

#

Definition at line 1425 of file Array.h.

◆ End() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::End ( )
inline

Returns a mutable iterator located at the end of this array.

Definition at line 450 of file Array.h.

Referenced by pcl::operator==(), and pcl::Array< GenericVector< T > >::Replace().

◆ End() [2/2]

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::End ( ) const
inline

Returns an immutable iterator located at the end of this array.

Definition at line 459 of file Array.h.

◆ end() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::end ( )
inline

STL-compatible iteration. Equivalent to End().

Definition at line 610 of file Array.h.

◆ end() [2/2]

template<class T, class A = StandardAllocator>
const_iterator pcl::Array< T, A >::end ( ) const
inline

STL-compatible iteration. Equivalent to End() const.

Definition at line 618 of file Array.h.

◆ EnsureUnique()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::EnsureUnique ( )
inline

Ensures that this array uniquely references its contained data.

If necessary, this member function generates a duplicate of the array data, references it, and then decrements the reference counter of the original array data.

Definition at line 241 of file Array.h.

Referenced by pcl::RedundantMultiscaleTransform::operator=().

◆ Expand()

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Expand ( size_type  n = 1)
inline

Appends a contiguous sequence of n default-constructed objects to this array. This operation is equivalent to:

Grow( End(), n )

Returns an iterator pointing to the first newly created array element, or End() if n is zero.

Definition at line 835 of file Array.h.

◆ Fill()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Fill ( const T &  v)
inline

Sets all objects contained by this array equal to v.

Definition at line 1341 of file Array.h.

◆ FirstThat()

template<class T, class A = StandardAllocator>
template<class F >
iterator pcl::Array< T, A >::FirstThat ( f) const
inline

Returns an iterator pointing to the first object x in this array such that f( const T& x ) is true. Returns End() if such object does not exist.

Definition at line 1391 of file Array.h.

◆ GetAllocator()

template<class T, class A = StandardAllocator>
const allocator& pcl::Array< T, A >::GetAllocator ( ) const
inline

Returns a reference to the allocator object used by this array.

Definition at line 337 of file Array.h.

◆ Grow()

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Grow ( iterator  i,
size_type  n = 1 
)
inline

Inserts a contiguous sequence of n default-constructed objects at the specified location i in this array.

The insertion point i is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first newly created array element, or i if n is zero.

Definition at line 815 of file Array.h.

◆ Hash()

template<class T, class A = StandardAllocator>
uint64 pcl::Array< T, A >::Hash ( uint64  seed = 0) const
inline

Returns a non-cryptographic hash value computed for this array. This function is a synonym for Hash64().

Definition at line 1828 of file Array.h.

◆ Hash32()

template<class T, class A = StandardAllocator>
uint32 pcl::Array< T, A >::Hash32 ( uint32  seed = 0) const
inline

Returns a 32-bit non-cryptographic hash value computed for this array.

This function calls pcl::Hash32() for the internal array buffer.

The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.

Definition at line 1819 of file Array.h.

◆ Hash64()

template<class T, class A = StandardAllocator>
uint64 pcl::Array< T, A >::Hash64 ( uint64  seed = 0) const
inline

Returns a 64-bit non-cryptographic hash value computed for this array.

This function calls pcl::Hash64() for the internal array buffer.

The seed parameter can be used to generate repeatable hash values. It can also be set to a random value in compromised environments.

Definition at line 1806 of file Array.h.

◆ Import()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Import ( iterator  i,
iterator  j 
)
inline

Causes this array to contain the sequence of objects defined by the range [i,j) of array iterators. The previously referenced data structure is dereferenced and destroyed/deallocated if it becomes unreferenced.

After calling this function, this array, or a subsequently created alias, will own and eventually destroy and deallocate the specified sequence of contiguous objects.

Definition at line 770 of file Array.h.

◆ Insert() [1/3]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Insert ( iterator  i,
const Array< T, A > &  x 
)
inline

Inserts a copy of the objects in a direct container x at the specified location i in this array.

The insertion point i is constrained to stay in the range [Begin(),End()) of existing array elements. The source array x can safely be a reference to this array.

Returns an iterator pointing to the first newly created array element, or i if x is empty.

Definition at line 889 of file Array.h.

◆ Insert() [2/3]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Insert ( iterator  i,
const T &  v,
size_type  n = 1 
)
inline

Inserts a contiguous sequence of n copies of the object v at the specified location i in this array.

The insertion point i is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first inserted array element, or i if n is zero.

Definition at line 908 of file Array.h.

◆ Insert() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
iterator pcl::Array< T, A >::Insert ( iterator  i,
FI  p,
FI  q 
)
inline

Inserts a copy of the sequence of objects defined by the range [p,q) of forward iterators at the specified location i in this array.

The insertion point i is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first inserted array element, or i if q <= p.

Note
p and q must not be iterators into this array.

Definition at line 932 of file Array.h.

◆ IsAliasOf()

template<class T, class A = StandardAllocator>
bool pcl::Array< T, A >::IsAliasOf ( const Array< T, A > &  x) const
inline

Returns true iff this array is an alias of an array x.

Two objects are aliases if both share the same data.

Definition at line 229 of file Array.h.

◆ IsEmpty()

template<class T, class A = StandardAllocator>
bool pcl::Array< T, A >::IsEmpty ( ) const
inline

Returns true iff this array is empty.

Definition at line 311 of file Array.h.

Referenced by pcl::QuadTree< vector_type >::Build(), pcl::GenericChebyshevFit< Tx, Ty >::IsValid(), and pcl::QuadTree< T >::LeafNode::LeafNode().

◆ IsUnique()

template<class T, class A = StandardAllocator>
bool pcl::Array< T, A >::IsUnique ( ) const
inline

Returns true iff this array uniquely references its contained data.

Definition at line 219 of file Array.h.

◆ IsValid()

template<class T, class A = StandardAllocator>
bool pcl::Array< T, A >::IsValid ( ) const
inline

Returns true only if this array is valid. An array is valid if it references an internal array structure, even if it is an empty array.

In general, all Array objects are valid with only two exceptions:

  • Objects that have been move-copied or move-assigned to other arrays.
  • Objects that have been invalidated explicitly by calling Transfer().

An invalid array object cannot be used and should be destroyed immediately. Invalid arrays are always destroyed automatically during move construction and move assignment operations.

Definition at line 303 of file Array.h.

◆ LastThat()

template<class T, class A = StandardAllocator>
template<class F >
iterator pcl::Array< T, A >::LastThat ( f) const
inline

Returns an iterator pointing to the last object x in this array such that f( const T& x ) is true. Returns End() if such object does not exist.

Definition at line 1402 of file Array.h.

◆ Length()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::Length ( ) const
inline

◆ LowerBound()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::LowerBound ( ) const
inline

Returns the minimum legal index in this array (always zero). For empty arrays, this function returns a meaningless value.

Definition at line 320 of file Array.h.

◆ MaxItem() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::MaxItem ( ) const
inline

#

Definition at line 1447 of file Array.h.

◆ MaxItem() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
iterator pcl::Array< T, A >::MaxItem ( BP  p) const
inline

#

Definition at line 1455 of file Array.h.

◆ MinItem() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::MinItem ( ) const
inline

#

Definition at line 1432 of file Array.h.

◆ MinItem() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
iterator pcl::Array< T, A >::MinItem ( BP  p) const
inline

#

Definition at line 1440 of file Array.h.

◆ MutableIterator()

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::MutableIterator ( const_iterator  i)
inline

Returns a mutable iterator pointing to the same array element as the specified immutable iterator i.

Warning
As a side-effect of calling this function, the specified immutable iterator i may become invalid. This happens when this function is called for a shared array, since in this case getting a mutable iterator involves a deep copy of the array through an implicit call to EnsureUnique().

Definition at line 380 of file Array.h.

◆ operator*() [1/2]

template<class T, class A = StandardAllocator>
T& pcl::Array< T, A >::operator* ( )
inline

Returns a reference to the first element of this array.

Definition at line 406 of file Array.h.

◆ operator*() [2/2]

template<class T, class A = StandardAllocator>
const T& pcl::Array< T, A >::operator* ( ) const
inline

Returns a reference to the unmodifiable first element of this array.

Definition at line 416 of file Array.h.

◆ operator=() [1/2]

template<class T, class A = StandardAllocator>
Array& pcl::Array< T, A >::operator= ( const Array< T, A > &  x)
inline

Copy assignment operator.

Causes this array to reference the same data as another array x. Returns a reference to this object.

Definition at line 630 of file Array.h.

◆ operator=() [2/2]

template<class T, class A = StandardAllocator>
Array& pcl::Array< T, A >::operator= ( Array< T, A > &&  x)
inline

Move assignment operator. Returns a reference to this object.

Definition at line 655 of file Array.h.

◆ operator[]() [1/2]

template<class T, class A = StandardAllocator>
T& pcl::Array< T, A >::operator[] ( size_type  i)
inline

Returns a reference to the element at the specified index i. No bounds checking is performed.

Definition at line 389 of file Array.h.

◆ operator[]() [2/2]

template<class T, class A = StandardAllocator>
const T& pcl::Array< T, A >::operator[] ( size_type  i) const
inline

Returns a reference to the unmodifiable element at the specified index i in this array. No bounds checking is performed.

Definition at line 398 of file Array.h.

◆ Prepend() [1/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Prepend ( const Array< T, A > &  x)
inline

Inserts a copy of the objects stored in the array x at the beginning of this array.

Definition at line 977 of file Array.h.

◆ Prepend() [2/3]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Prepend ( const T &  v,
size_type  n = 1 
)
inline

Inserts a contiguous sequence of n copies of the object v at the beginning of this array.

Definition at line 986 of file Array.h.

◆ Prepend() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
void pcl::Array< T, A >::Prepend ( FI  p,
FI  q 
)
inline

Inserts a copy of the sequence of objects defined by the range [p,q) of forward iterators at the beginning of this array.

Note
p and q must not be iterators into this array.

Definition at line 998 of file Array.h.

◆ Release()

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Release ( )
inline

Releases the data contained by this array.

This member function returns a pointer to the internal data block referenced by this object, after ensuring that it is uniquely referenced. If the array is empty, this function may return the null pointer.

Before returning, this member function empties this array without deallocating its contained data. The caller is then responsible for destructing and/or deallocating the returned block when it is no longer required.

Definition at line 797 of file Array.h.

◆ Remove() [1/4]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Remove ( iterator  i,
size_type  n = 1 
)
inline

Destroys and removes a sequence of n contiguous objects starting at the specified location i in this array.

If the starting iterator i is located at or after the end of this array, or if n is zero, this function does nothing. Otherwise i is constrained to stay in the range [Begin(),End()) of existing array elements.

Definition at line 1037 of file Array.h.

◆ Remove() [2/4]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Remove ( iterator  i,
iterator  j 
)
inline

Destroys and removes a sequence of contiguous objects in the range [i,j) of this array.

If the starting iterator i is located at or after the end of this array, or if j precedes i, this function does nothing. Otherwise the range [i,j) is constrained to stay in the range [Begin(),End()) of existing array elements.

Definition at line 1051 of file Array.h.

◆ Remove() [3/4]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Remove ( const T &  v)
inline

Destroys and removes all existing objects equal to the specified value v in this array.

Definition at line 1088 of file Array.h.

◆ Remove() [4/4]

template<class T, class A = StandardAllocator>
template<class BP >
void pcl::Array< T, A >::Remove ( const T &  v,
BP  p 
)
inline

Destroys and removes every object x in this array such that the binary predicate p( x, v ) is true.

Definition at line 1117 of file Array.h.

◆ Replace() [1/3]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Replace ( iterator  i,
iterator  j,
const Array< T, A > &  x 
)
inline

Replaces a sequence of contiguous objects defined by the range [i,j) of iterators in this array by the objects stored in an array x.

If the starting iterator i is located at or after the end of this array, or if j precedes i, this function does nothing. Otherwise the range [i,j) is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first replaced array element, i if no elements are replaced, or nullptr if the resulting array is empty.

Definition at line 1178 of file Array.h.

◆ Replace() [2/3]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Replace ( iterator  i,
iterator  j,
const T &  v,
size_type  n = 1 
)
inline

Replaces a sequence of contiguous objects defined by the range [i,j) of iterators in this array by n copies of the specified object v.

If the starting iterator i is located at or after the end of this array, or if j precedes i, this function does nothing. Otherwise the range [i,j) is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first replaced array element, i if no elements are replaced, or nullptr if the resulting array is empty.

Definition at line 1200 of file Array.h.

◆ Replace() [3/3]

template<class T, class A = StandardAllocator>
template<class FI >
iterator pcl::Array< T, A >::Replace ( iterator  i,
iterator  j,
FI  p,
FI  q 
)
inline

Replaces a sequence of contiguous objects defined by the range [i,j) of iterators in this array by the sequence of objects in the range [p,q) of forward iterators.

If the starting iterator i is located at or after the end of this array, or if j precedes i, this function does nothing. Otherwise the range [i,j) is constrained to stay in the range [Begin(),End()) of existing array elements.

Returns an iterator pointing to the first replaced array element, i if no elements are replaced, or nullptr if the resulting array is empty.

Note
p and q must not be iterators into this array.

Definition at line 1243 of file Array.h.

◆ Reserve()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Reserve ( size_type  n)
inline

Ensures that this array has enough capacity to store n objects.

After calling this member function with n > 0, this object is guaranteed to uniquely reference its array data.

Definition at line 1274 of file Array.h.

◆ Resize()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Resize ( size_type  n)
inline

Resizes this array to the specified length n, either by appending new default-constructed objects, or by removing existing trailing objects. This operation is equivalent to:

if ( n > Length() )
Expand( n - Length() );
else
Shrink( Length() - n );

Definition at line 869 of file Array.h.

◆ Reverse()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Reverse ( )
inline

#

Definition at line 1462 of file Array.h.

◆ ReverseBegin() [1/2]

template<class T, class A = StandardAllocator>
reverse_iterator pcl::Array< T, A >::ReverseBegin ( )
inline

Returns a mutable reverse iterator located at the reverse beginning of this array.

The reverse beginning corresponds to the last element in the array.

Definition at line 478 of file Array.h.

◆ ReverseBegin() [2/2]

template<class T, class A = StandardAllocator>
const_reverse_iterator pcl::Array< T, A >::ReverseBegin ( ) const
inline

Returns an immutable reverse iterator located at the reverse beginning of this array.

The reverse beginning corresponds to the last element in the array.

Definition at line 491 of file Array.h.

◆ ReverseEnd() [1/2]

template<class T, class A = StandardAllocator>
reverse_iterator pcl::Array< T, A >::ReverseEnd ( )
inline

Returns a mutable reverse iterator located at the reverse end of this array.

The reverse end corresponds to an (nonexistent) element immediately before the first element in the array.

Definition at line 516 of file Array.h.

◆ ReverseEnd() [2/2]

template<class T, class A = StandardAllocator>
const_reverse_iterator pcl::Array< T, A >::ReverseEnd ( ) const
inline

Returns an immutable reverse iterator located at the reverse end of this array.

The reverse end corresponds to an (nonexistent) element immediately before the first element in the array.

Definition at line 530 of file Array.h.

◆ Rotate()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Rotate ( distance_type  n)
inline

#

Definition at line 1470 of file Array.h.

◆ Search() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::Search ( const T &  v) const
inline

#

Definition at line 1511 of file Array.h.

◆ Search() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
iterator pcl::Array< T, A >::Search ( const T &  v,
BP  p 
) const
inline

#

Definition at line 1519 of file Array.h.

◆ SearchLast() [1/2]

template<class T, class A = StandardAllocator>
iterator pcl::Array< T, A >::SearchLast ( const T &  v) const
inline

#

Definition at line 1526 of file Array.h.

◆ SearchLast() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
iterator pcl::Array< T, A >::SearchLast ( const T &  v,
BP  p 
) const
inline

#

Definition at line 1534 of file Array.h.

◆ SearchLastSubset() [1/4]

template<class T, class A = StandardAllocator>
template<class BI >
iterator pcl::Array< T, A >::SearchLastSubset ( BI  i,
BI  j 
) const
inline

#

Definition at line 1576 of file Array.h.

◆ SearchLastSubset() [2/4]

template<class T, class A = StandardAllocator>
template<class BI , class BP >
iterator pcl::Array< T, A >::SearchLastSubset ( BI  i,
BI  j,
BP  p 
) const
inline

#

Definition at line 1584 of file Array.h.

◆ SearchLastSubset() [3/4]

template<class T, class A = StandardAllocator>
template<class C >
iterator pcl::Array< T, A >::SearchLastSubset ( const C &  x) const
inline

#

Definition at line 1592 of file Array.h.

◆ SearchLastSubset() [4/4]

template<class T, class A = StandardAllocator>
template<class C , class BP >
iterator pcl::Array< T, A >::SearchLastSubset ( const C &  x,
BP  p 
) const
inline

#

Definition at line 1601 of file Array.h.

◆ SearchSubset() [1/4]

template<class T, class A = StandardAllocator>
template<class FI >
iterator pcl::Array< T, A >::SearchSubset ( FI  i,
FI  j 
) const
inline

#

Definition at line 1542 of file Array.h.

◆ SearchSubset() [2/4]

template<class T, class A = StandardAllocator>
template<class FI , class BP >
iterator pcl::Array< T, A >::SearchSubset ( FI  i,
FI  j,
BP  p 
) const
inline

#

Definition at line 1550 of file Array.h.

◆ SearchSubset() [3/4]

template<class T, class A = StandardAllocator>
template<class C >
iterator pcl::Array< T, A >::SearchSubset ( const C &  x) const
inline

#

Definition at line 1558 of file Array.h.

◆ SearchSubset() [4/4]

template<class T, class A = StandardAllocator>
template<class C , class BP >
iterator pcl::Array< T, A >::SearchSubset ( const C &  x,
BP  p 
) const
inline

#

Definition at line 1567 of file Array.h.

◆ SecureFill()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::SecureFill ( const T &  v)
inline

Securely fills this array and all instances sharing its data with the specified value v.

The normal data sharing mechanism is ignored on purpose by this member function, so if there are other objects sharing the same array data, all of them will be affected unconditionally.

This function is useful to ensure that sensitive data, such as user passwords and user names, are destroyed without the risk of surviving duplicates as a result of implicit data sharing.

Definition at line 1359 of file Array.h.

◆ SetAllocator()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::SetAllocator ( const allocator a)
inline

Sets a new allocator object for this array.

Definition at line 345 of file Array.h.

◆ ShiftLeft()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::ShiftLeft ( const T &  v,
size_type  n = 1 
)
inline

#

Definition at line 1483 of file Array.h.

◆ ShiftRight()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::ShiftRight ( const T &  v,
size_type  n = 1 
)
inline

#

Definition at line 1497 of file Array.h.

◆ Shrink()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Shrink ( size_type  n = 1)
inline

Removes a contiguous trailing sequence of n existing objects from this array. This operation is equivalent to:

Truncate( End() - n )

If the specified count n is greater than or equal to the length of this array, this function calls Clear() to yield an empty array.

Definition at line 849 of file Array.h.

◆ Size()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::Size ( ) const
inline

Returns the total number of bytes required to store the objects contained by this dynamic array.

Definition at line 257 of file Array.h.

◆ Sort() [1/2]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Sort ( )
inline

#

Definition at line 1656 of file Array.h.

◆ Sort() [2/2]

template<class T, class A = StandardAllocator>
template<class BP >
void pcl::Array< T, A >::Sort ( BP  p)
inline

#

Definition at line 1665 of file Array.h.

◆ Squeeze()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Squeeze ( )
inline

Causes this array to allocate the exact required memory space to store its contained objects.

If the array has excess capacity, a new copy of its contained objects is generated and stored in a newly allocated memory block that fits them exactly, then the previous memory block is deallocated.

If the array is empty, calling this function is equivalent to Clear(). Note that in this case a previously allocated memory block (by a call to Reserve()) may also be deallocated.

Definition at line 1312 of file Array.h.

◆ ToCommaSeparated()

template<class T, class A = StandardAllocator>
template<class S >
S& pcl::Array< T, A >::ToCommaSeparated ( S &  s) const
inline

Generates a comma-separated sequence of string tokens. Returns a reference to the target string s.

This function is equivalent to:

ToSeparated( s, ',' );

Definition at line 1765 of file Array.h.

◆ ToSeparated() [1/2]

template<class T, class A = StandardAllocator>
template<class S , typename SP >
S& pcl::Array< T, A >::ToSeparated ( S &  s,
SP  separator 
) const
inline

Generates a sequence of string tokens separated with the specified separator string. Returns a reference to the target string s.

For each element in this array, this function appends a string representation (known as a token) to the target string s. If the array contains more than one element, successive tokens are separated with the specified separator.

The string type S must have a meaningful Append() member function and type conversion semantics to transform an array element to a string. The standard String and IsoString PCL classes provide the required functionality for most scalar types, although it is probably better to use String::ToSeparated() and IsoString::ToSeparated() instead of calling these functions directly.

Definition at line 1696 of file Array.h.

◆ ToSeparated() [2/2]

template<class T, class A = StandardAllocator>
template<class S , typename SP , class AF >
S& pcl::Array< T, A >::ToSeparated ( S &  s,
SP  separator,
AF  append 
) const
inline

Generates a sequence of string tokens separated with the specified separator string by calling an append function. Returns a reference to the target string s.

For each element x in this array, this function appends a string representation (known as a token) to the target string s by calling the append function:

append( s, S( x ) );

If the array contains more than one element, successive tokens are separated by calling:

append( s, S( separator ) );

The string type S must have type conversion semantics to transform an array element to a string. The standard String and IsoString PCL classes provide the required functionality for most scalar types, although it is probably easier to use String::ToSeparated() and IsoString::ToSeparated() instead of calling these functions directly.

Definition at line 1736 of file Array.h.

◆ ToSpaceSeparated()

template<class T, class A = StandardAllocator>
template<class S >
S& pcl::Array< T, A >::ToSpaceSeparated ( S &  s) const
inline

Generates a space-separated sequence of string tokens. Returns a reference to the target string s.

This function is equivalent to:

ToSeparated( s, ' ' );

Definition at line 1779 of file Array.h.

◆ ToTabSeparated()

template<class T, class A = StandardAllocator>
template<class S >
S& pcl::Array< T, A >::ToTabSeparated ( S &  s) const
inline

Generates a tabulator-separated sequence of string tokens. Returns a reference to the target string s.

This function is equivalent to:

ToSeparated( s, '\t' );

Definition at line 1793 of file Array.h.

◆ Transfer() [1/2]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Transfer ( Array< T, A > &  x)
inline

Transfers data from another array x to this object.

Decrements the reference counter of the current array data, and destroys it if it becomes unreferenced.

Transfers source array data to this object, leaving empty and invalid the source object x.

Definition at line 670 of file Array.h.

◆ Transfer() [2/2]

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Transfer ( Array< T, A > &&  x)
inline

Transfers data from another array x to this object.

Decrements the reference counter of the current array data, and destroys it if it becomes unreferenced.

Transfers source array data to this object, leaving empty and invalid the source object x.

Definition at line 686 of file Array.h.

◆ Truncate()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::Truncate ( iterator  i)
inline

Destroys and removes a trailing sequence of contiguous objects from the specified iterator of this array. This operation is equivalent to:

Remove( i, End() )

If the specified iterator is located at or after the end of this array, this function does nothing. Otherwise the iterator is constrained to stay in the range [Begin(),End()) of existing array elements.

Definition at line 1079 of file Array.h.

◆ UniquifyIterator()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::UniquifyIterator ( iterator i)
inline

Ensures that the specified iterator points to a uniquely referenced object. If necessary, this function builds a new, uniquely referenced copy of this array by calling EnsureUnique().

If the iterator i is changed, it is guaranteed to point to the object at the same array index it was pointing to before calling this function.

Definition at line 557 of file Array.h.

◆ UniquifyIterators()

template<class T, class A = StandardAllocator>
void pcl::Array< T, A >::UniquifyIterators ( iterator i,
iterator j 
)
inline

Ensures that the specified iterators point to uniquely referenced objects. If necessary, this function builds a new, uniquely referenced copy of this array by calling EnsureUnique().

If the iterators i and j are changed, they are guaranteed to point to the objects at the same array indices they were pointing to before calling this function.

Definition at line 577 of file Array.h.

◆ UpperBound()

template<class T, class A = StandardAllocator>
size_type pcl::Array< T, A >::UpperBound ( ) const
inline

Returns the maximum legal index in this array. It is equal to Length()-1. For empty arrays, this function returns a meaningless value.

Definition at line 329 of file Array.h.

Friends And Related Function Documentation

◆ Swap

template<class T, class A = StandardAllocator>
void Swap ( Array< T, A > &  x1,
Array< T, A > &  x2 
)
friend

Exchanges two dynamic arrays x1 and x2.

Definition at line 1674 of file Array.h.


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