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

Generic dynamic sorted array. More...

#include <SortedArray.h>

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

Public Types

using allocator = typename array_implementation::allocator
 
using array_implementation = Array< T, A >
 
using block_allocator = typename array_implementation::block_allocator
 
using const_iterator = typename array_implementation::const_iterator
 
using const_reverse_iterator = typename array_implementation::const_reverse_iterator
 
using iterator = typename array_implementation::iterator
 
using reverse_iterator = typename array_implementation::reverse_iterator
 

Public Member Functions

 SortedArray ()=default
 
 SortedArray (const SortedArray &)=default
 
template<class FI >
 SortedArray (FI i, FI j)
 
 SortedArray (size_type n)
 
 SortedArray (size_type n, const T &v)
 
 SortedArray (SortedArray &&)=default
 
template<typename T1 >
 SortedArray (std::initializer_list< T1 > l)
 
 ~SortedArray ()
 
void Add (const Array< T, A > &x)
 
void Add (const SortedArray &x)
 
const_iterator Add (const T &v, size_type n=1)
 
template<class FI >
void Add (FI i, FI j)
 
const allocatorAllocator () const
 
template<class F >
void Apply (F f) const
 
void Assign (const array_implementation &x)
 
void Assign (const SortedArray &x)
 
void Assign (const T &v, size_type n=1)
 
template<class FI >
void Assign (FI i, FI j)
 
const_iterator At (size_type i) const
 
size_type Available () const
 
const_iterator Begin () const
 
const_iterator begin () const
 
size_type Capacity () const
 
void Clear ()
 
bool Contains (const T &v) const
 
template<class BP >
bool Contains (const T &v, 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
 
const_iterator End () const
 
const_iterator end () const
 
void EnsureUnique ()
 
void Fill (const T &v)
 
template<class F >
const_iterator FirstThat (F f) const
 
uint64 Hash (uint64 seed=0) const
 
uint32 Hash32 (uint32 seed=0) const
 
uint64 Hash64 (uint64 seed=0) const
 
void Import (iterator i, iterator j)
 
bool IsAliasOf (const SortedArray &x) const
 
bool IsEmpty () const
 
bool IsUnique () const
 
bool IsValid () const
 
template<class F >
const_iterator LastThat (F f) const
 
size_type Length () const
 
size_type LowerBound () const
 
const_iterator MaxItem () const
 
template<class BP >
const_iterator MaxItem (BP p) const
 
const_iterator MinItem () const
 
template<class BP >
const_iterator MinItem (BP p) const
 
iterator MutableAt (size_type i)
 
iterator MutableBegin ()
 
iterator MutableEnd ()
 
iterator MutableIterator (const_iterator i)
 
reverse_iterator MutableReverseBegin ()
 
reverse_iterator MutableReverseEnd ()
 
const T & operator* () const
 
SortedArrayoperator= (array_implementation &&x)
 
SortedArrayoperator= (const array_implementation &x)
 
SortedArrayoperator= (const SortedArray &x)
 
SortedArrayoperator= (SortedArray &&x)
 
const T & operator[] (size_type i) const
 
iterator Release ()
 
void Remove (const T &v)
 
void Remove (const_iterator i, const_iterator j)
 
void Remove (const_iterator i, size_type n=1)
 
void RemoveFirst (size_type n=1)
 
void RemoveLast (size_type n=1)
 
void Reserve (size_type n)
 
const_reverse_iterator ReverseBegin () const
 
const_reverse_iterator ReverseEnd () const
 
const_iterator Search (const T &v) const
 
template<class BP >
const_iterator Search (const T &v, BP p) const
 
const_iterator SearchLast (const T &v) const
 
template<class BP >
const_iterator SearchLast (const T &v, BP p) const
 
void SetAllocator (const allocator &a)
 
void Shrink (size_type n=1)
 
size_type Size () const
 
void Sort ()
 
void Squeeze ()
 
template<class S >
S & ToCommaSeparated (S &s) const
 
template<class S >
S & ToNewLineSeparated (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_implementation &&x)
 
void Transfer (array_implementation &x)
 
void Transfer (SortedArray &&x)
 
void Transfer (SortedArray &x)
 
void Truncate (const_iterator i)
 
void UniquifyIterator (iterator &i)
 
void UniquifyIterators (iterator &i, iterator &j)
 
size_type UpperBound () const
 

Friends

bool operator< (const array_implementation &x1, const SortedArray &x2)
 
bool operator< (const SortedArray &x1, const array_implementation &x2)
 
bool operator< (const SortedArray &x1, const SortedArray &x2)
 
bool operator== (const array_implementation &x1, const SortedArray &x2)
 
bool operator== (const SortedArray &x1, const array_implementation &x2)
 
bool operator== (const SortedArray &x1, const SortedArray &x2)
 
void Swap (SortedArray &x1, SortedArray &x2)
 

Detailed Description

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

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

See also
Array, ReferenceArray, ReferenceSortedArray, IndirectArray, IndirectSortedArray

Definition at line 82 of file SortedArray.h.

Member Typedef Documentation

◆ allocator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::allocator = typename array_implementation::allocator

#

Definition at line 96 of file SortedArray.h.

◆ array_implementation

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

#

Definition at line 88 of file SortedArray.h.

◆ block_allocator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::block_allocator = typename array_implementation::block_allocator

#

Definition at line 92 of file SortedArray.h.

◆ const_iterator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::const_iterator = typename array_implementation::const_iterator

#

Definition at line 104 of file SortedArray.h.

◆ const_reverse_iterator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::const_reverse_iterator = typename array_implementation::const_reverse_iterator

#

Definition at line 112 of file SortedArray.h.

◆ iterator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::iterator = typename array_implementation::iterator

#

Definition at line 100 of file SortedArray.h.

◆ reverse_iterator

template<class T , class A = StandardAllocator>
using pcl::SortedArray< T, A >::reverse_iterator = typename array_implementation::reverse_iterator

#

Definition at line 108 of file SortedArray.h.

Constructor & Destructor Documentation

◆ SortedArray() [1/7]

template<class T , class A = StandardAllocator>
pcl::SortedArray< T, A >::SortedArray ( )
default

Constructs an empty sorted array.

◆ SortedArray() [2/7]

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

Constructs a sorted array of n default-constructed objects.

Definition at line 125 of file SortedArray.h.

◆ SortedArray() [3/7]

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

Constructs a sorted array of n copies of an object v.

Definition at line 133 of file SortedArray.h.

◆ SortedArray() [4/7]

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

Constructs a sorted array that stores a sorted copy of the sequence of objects defined by the range [i,j) of forward iterators.

Definition at line 143 of file SortedArray.h.

References pcl::Sort().

◆ SortedArray() [5/7]

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

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

This constructor is equivalent to:

SortedArray( l.begin(), l.end() )
SortedArray()=default

Definition at line 158 of file SortedArray.h.

◆ SortedArray() [6/7]

template<class T , class A = StandardAllocator>
pcl::SortedArray< T, A >::SortedArray ( const SortedArray< T, A > &  )
default

Copy constructor.

◆ SortedArray() [7/7]

template<class T , class A = StandardAllocator>
pcl::SortedArray< T, A >::SortedArray ( SortedArray< T, A > &&  )
default

Move constructor.

◆ ~SortedArray()

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

Destroys a SortedArray object. Destroys and deallocates all contained objects.

Definition at line 177 of file SortedArray.h.

Member Function Documentation

◆ Add() [1/4]

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

#

Definition at line 547 of file SortedArray.h.

◆ Add() [2/4]

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

◆ Add() [3/4]

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

#

Definition at line 554 of file SortedArray.h.

◆ Add() [4/4]

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

#

Definition at line 562 of file SortedArray.h.

References pcl::InsertionPoint().

◆ Allocator()

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

#

Definition at line 272 of file SortedArray.h.

◆ Apply()

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

#

Definition at line 696 of file SortedArray.h.

◆ Assign() [1/4]

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

#

Definition at line 472 of file SortedArray.h.

References pcl::Sort().

◆ Assign() [2/4]

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

#

Definition at line 434 of file SortedArray.h.

◆ Assign() [3/4]

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

#

Definition at line 504 of file SortedArray.h.

◆ Assign() [4/4]

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

#

Definition at line 512 of file SortedArray.h.

References pcl::Sort().

◆ At()

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

#

Definition at line 286 of file SortedArray.h.

◆ Available()

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

#

Definition at line 237 of file SortedArray.h.

◆ Begin()

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

#

Definition at line 321 of file SortedArray.h.

Referenced by pcl::SortedArray< T, A >::Add().

◆ begin()

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

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

Definition at line 406 of file SortedArray.h.

◆ Capacity()

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

#

Definition at line 230 of file SortedArray.h.

◆ Clear()

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

#

Definition at line 666 of file SortedArray.h.

◆ Contains() [1/2]

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

#

Definition at line 803 of file SortedArray.h.

◆ Contains() [2/2]

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

#

Definition at line 811 of file SortedArray.h.

◆ Count() [1/2]

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

#

Definition at line 719 of file SortedArray.h.

◆ Count() [2/2]

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

#

Definition at line 728 of file SortedArray.h.

◆ CountIf()

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

#

Definition at line 736 of file SortedArray.h.

◆ End()

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

#

Definition at line 335 of file SortedArray.h.

Referenced by pcl::SortedArray< T, A >::Add().

◆ end()

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

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

Definition at line 414 of file SortedArray.h.

◆ EnsureUnique()

template<class T , class A = StandardAllocator>
void pcl::SortedArray< 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 206 of file SortedArray.h.

◆ Fill()

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

Sets all objects contained by this array equal to v.

Definition at line 688 of file SortedArray.h.

◆ FirstThat()

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

#

Definition at line 704 of file SortedArray.h.

◆ Hash()

template<class T , class A = StandardAllocator>
uint64 pcl::SortedArray< 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 1022 of file SortedArray.h.

References pcl::Hash64().

◆ Hash32()

template<class T , class A = StandardAllocator>
uint32 pcl::SortedArray< 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 1013 of file SortedArray.h.

◆ Hash64()

template<class T , class A = StandardAllocator>
uint64 pcl::SortedArray< 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 1000 of file SortedArray.h.

◆ Import()

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

#

Definition at line 520 of file SortedArray.h.

References pcl::Sort().

◆ IsAliasOf()

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

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

Two objects are aliases if both of them share the same data.

Definition at line 194 of file SortedArray.h.

◆ IsEmpty()

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

#

Definition at line 251 of file SortedArray.h.

◆ IsUnique()

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

Returns true iff this array uniquely references its contained data.

Definition at line 184 of file SortedArray.h.

◆ IsValid()

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

#

Definition at line 244 of file SortedArray.h.

◆ LastThat()

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

#

Definition at line 712 of file SortedArray.h.

◆ Length()

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

Returns the length of this sorted array.

Definition at line 223 of file SortedArray.h.

◆ LowerBound()

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

#

Definition at line 258 of file SortedArray.h.

◆ MaxItem() [1/2]

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

#

Definition at line 758 of file SortedArray.h.

◆ MaxItem() [2/2]

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

#

Definition at line 766 of file SortedArray.h.

References pcl::MaxItem().

◆ MinItem() [1/2]

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

#

Definition at line 743 of file SortedArray.h.

◆ MinItem() [2/2]

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

#

Definition at line 751 of file SortedArray.h.

References pcl::MinItem().

◆ MutableAt()

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

#

Definition at line 293 of file SortedArray.h.

◆ MutableBegin()

template<class T , class A = StandardAllocator>
iterator pcl::SortedArray< T, A >::MutableBegin ( )
inline

#

Definition at line 328 of file SortedArray.h.

◆ MutableEnd()

template<class T , class A = StandardAllocator>
iterator pcl::SortedArray< T, A >::MutableEnd ( )
inline

#

Definition at line 342 of file SortedArray.h.

◆ MutableIterator()

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

#

Definition at line 300 of file SortedArray.h.

◆ MutableReverseBegin()

template<class T , class A = StandardAllocator>
reverse_iterator pcl::SortedArray< T, A >::MutableReverseBegin ( )
inline

#

Definition at line 356 of file SortedArray.h.

◆ MutableReverseEnd()

template<class T , class A = StandardAllocator>
reverse_iterator pcl::SortedArray< T, A >::MutableReverseEnd ( )
inline

#

Definition at line 370 of file SortedArray.h.

◆ operator*()

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

#

Definition at line 314 of file SortedArray.h.

◆ operator=() [1/4]

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

#

Definition at line 480 of file SortedArray.h.

◆ operator=() [2/4]

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

#

Definition at line 464 of file SortedArray.h.

◆ operator=() [3/4]

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

Copy assignment operator.

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

Definition at line 426 of file SortedArray.h.

◆ operator=() [4/4]

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

Move assignment operator. Returns a reference to this object.

Definition at line 442 of file SortedArray.h.

◆ operator[]()

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

#

Definition at line 307 of file SortedArray.h.

◆ Release()

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

#

Definition at line 528 of file SortedArray.h.

◆ Remove() [1/3]

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

#

Definition at line 657 of file SortedArray.h.

◆ Remove() [2/3]

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

#

Definition at line 598 of file SortedArray.h.

◆ Remove() [3/3]

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

#

Definition at line 591 of file SortedArray.h.

◆ RemoveFirst()

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

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

Remove( Begin(), At( n ) );
const_iterator At(size_type i) const
Definition: SortedArray.h:286
void Remove(const_iterator i, size_type n=1)
Definition: SortedArray.h:591
const_iterator Begin() const
Definition: SortedArray.h:321

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 612 of file SortedArray.h.

◆ RemoveLast()

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

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

Truncate( End() - n );
const_iterator End() const
Definition: SortedArray.h:335
void Truncate(const_iterator i)
Definition: SortedArray.h:641

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 626 of file SortedArray.h.

◆ Reserve()

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

#

Definition at line 673 of file SortedArray.h.

◆ ReverseBegin()

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

#

Definition at line 349 of file SortedArray.h.

◆ ReverseEnd()

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

#

Definition at line 363 of file SortedArray.h.

◆ Search() [1/2]

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

#

Definition at line 773 of file SortedArray.h.

◆ Search() [2/2]

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

#

Definition at line 781 of file SortedArray.h.

◆ SearchLast() [1/2]

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

#

Definition at line 788 of file SortedArray.h.

◆ SearchLast() [2/2]

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

#

Definition at line 796 of file SortedArray.h.

◆ SetAllocator()

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

#

Definition at line 279 of file SortedArray.h.

◆ Shrink()

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

Removes a contiguous trailing sequence of n existing objects from this sorted array. This function is a synonym for RemoveLast().

Definition at line 650 of file SortedArray.h.

◆ Size()

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

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

Definition at line 215 of file SortedArray.h.

◆ Sort()

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

#

Definition at line 818 of file SortedArray.h.

◆ Squeeze()

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

#

Definition at line 680 of file SortedArray.h.

◆ ToCommaSeparated()

template<class T , class A = StandardAllocator>
template<class S >
S& pcl::SortedArray< 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, ',' );
S & ToSeparated(S &s, SP separator) const
Definition: SortedArray.h:903

Definition at line 945 of file SortedArray.h.

◆ ToNewLineSeparated()

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

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

This function is equivalent to:

ToSeparated( s, '\n' );

Definition at line 987 of file SortedArray.h.

◆ ToSeparated() [1/2]

template<class T , class A = StandardAllocator>
template<class S , typename SP >
S& pcl::SortedArray< 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 903 of file SortedArray.h.

◆ ToSeparated() [2/2]

template<class T , class A = StandardAllocator>
template<class S , typename SP , class AF >
S& pcl::SortedArray< 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 931 of file SortedArray.h.

◆ ToSpaceSeparated()

template<class T , class A = StandardAllocator>
template<class S >
S& pcl::SortedArray< 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 959 of file SortedArray.h.

◆ ToTabSeparated()

template<class T , class A = StandardAllocator>
template<class S >
S& pcl::SortedArray< 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 973 of file SortedArray.h.

◆ Transfer() [1/4]

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

#

Definition at line 496 of file SortedArray.h.

References pcl::Sort().

◆ Transfer() [2/4]

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

#

Definition at line 488 of file SortedArray.h.

References pcl::Sort().

◆ Transfer() [3/4]

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

#

Definition at line 457 of file SortedArray.h.

◆ Transfer() [4/4]

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

#

Definition at line 450 of file SortedArray.h.

◆ Truncate()

template<class T , class A = StandardAllocator>
void pcl::SortedArray< T, A >::Truncate ( const_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 i 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 641 of file SortedArray.h.

◆ UniquifyIterator()

template<class T , class A = StandardAllocator>
void pcl::SortedArray< 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 383 of file SortedArray.h.

◆ UniquifyIterators()

template<class T , class A = StandardAllocator>
void pcl::SortedArray< 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 397 of file SortedArray.h.

◆ UpperBound()

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

#

Definition at line 265 of file SortedArray.h.

Friends And Related Function Documentation

◆ Swap

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

Exchanges two sorted arrays x1 and x2.

Definition at line 826 of file SortedArray.h.


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