52 #ifndef __PCL_IndirectSortedArray_h
53 #define __PCL_IndirectSortedArray_h
58 #include <pcl/Diagnostics.h>
90 template <
class T,
class A = StandardAllocator>
196 return m_array.IsUnique();
208 return m_array.IsAliasOf( x.m_array );
221 m_array.EnsureUnique();
230 return m_array.Size();
237 return m_array.Length();
244 return m_array.Capacity();
251 return m_array.Available();
258 return m_array.IsValid();
265 return m_array.IsEmpty();
272 return m_array.LowerBound();
279 return m_array.UpperBound();
286 return m_array.Allocator();
293 m_array.SetAllocator( a );
300 return m_array.At( i );
307 return m_array.At( i );
314 return m_array.MutableIterator( i );
335 return m_array.ConstBegin();
342 return m_array.Begin();
349 return m_array.ConstEnd();
356 return m_array.End();
363 return m_array.ConstReverseBegin();
370 return m_array.ReverseBegin();
377 return m_array.ConstReverseEnd();
384 return m_array.ReverseEnd();
389 const T* First()
const
391 return m_array.First();
398 return IsEmpty() ? nullptr : *MutableBegin();
403 const T* Last()
const
405 return m_array.Last();
412 return IsEmpty() ? nullptr : *MutableReverseBegin();
425 m_array.UniquifyIterator( i );
439 m_array.UniquifyIterators( i, j );
442 #ifndef __PCL_NO_STL_COMPATIBLE_ITERATORS
476 m_array.Assign( x.m_array );
492 m_array.Transfer( x.m_array );
499 m_array.Transfer( x.m_array );
530 m_array.Transfer( x );
538 m_array.Transfer( x );
546 m_array.Assign( p, n );
554 m_array.Assign( i, j );
563 m_array.CloneAssign( x );
571 m_array.CloneAssign( x );
578 m_array.CloneAssign( x );
585 m_array.Import( i, j );
593 return m_array.Release();
602 for (
iterator i = m_array.Begin(); i < m_array.End() && p < q; ++i )
604 i = m_array.Insert( i, *p++ );
606 m_array.Append( p, q );
630 m_array.EnsureUnique();
639 if (
less()( *i, *h ) )
657 m_array.Remove( i, n );
664 m_array.Remove( i, j );
681 m_array.RemoveFirst( n );
698 m_array.RemoveLast( n );
716 m_array.Truncate( i );
742 m_array.Remove( v, p );
775 m_array.Delete( i, j );
777 pcl::Fill( pcl::Copy( i, j,
const_cast<iterator>( End() ) ),
779 static_cast<T*
>(
nullptr ) );
800 m_array.Delete( v, p );
815 m_array.Destroy( i, n );
822 m_array.Destroy( i, j );
840 m_array.Destroy( v, p );
862 m_array.Reserve( n );
893 return m_array.FirstThat( f );
901 return m_array.LastThat( f );
916 return m_array.Count( p );
924 return m_array.Count( v, p );
932 return m_array.CountIf( p );
947 return m_array.MinItem( p );
954 return IsEmpty() ? End() : End()-1;
962 return m_array.MaxItem( p );
976 return m_array.Search( p );
984 return m_array.Search( v, p );
998 return m_array.SearchLast( p );
1006 return m_array.SearchLast( v, p );
1013 return Search( v ) != End();
1020 return m_array.Contains( p );
1028 return Search( v, p ) != End();
1053 return x1.m_array == x2.m_array;
1063 return x1.m_array == x2;
1073 return x1 == x2.m_array;
1083 return x1.m_array < x2.m_array;
1093 return x1.m_array < x2;
1103 return x1 < x2.m_array;
1122 template <
class S,
typename SP>
1123 S& ToSeparated( S& s, SP separator )
const
1125 return m_array.ToSeparated( s, separator );
1150 template <
class S,
typename SP,
class AF>
1151 S& ToSeparated( S& s, SP separator, AF append )
const
1153 return m_array.ToSeparated( s, separator, append );
1165 S& ToCommaSeparated( S& s )
const
1167 return m_array.ToCommaSeparated( s );
1179 S& ToSpaceSeparated( S& s )
const
1181 return m_array.ToSpaceSeparated( s );
1193 S& ToTabSeparated( S& s )
const
1195 return m_array.ToTabSeparated( s );
1210 return m_array.Hash64( seed );
1225 return m_array.Hash32( seed );
1241 array_implementation m_array;
1253 template <
class T,
class A,
class V>
inline
1254 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>& x,
const V* p )
1256 x.Add(
static_cast<const T*
>( p ) );
1267 template <
class T,
class A,
class V>
inline
1268 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>&& x,
const V* p )
1270 x.Add(
static_cast<const T*
>( p ) );
1279 template <
class T,
class A>
inline
1280 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>& x1,
const IndirectSortedArray<T,A>& x2 )
1291 template <
class T,
class A>
inline
1292 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>&& x1,
const IndirectSortedArray<T,A>& x2 )
1303 template <
class T,
class A>
inline
1304 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>& x1,
const IndirectArray<T,A>& x2 )
1315 template <
class T,
class A>
inline
1316 IndirectSortedArray<T,A>&
operator <<( IndirectSortedArray<T,A>&& x1,
const IndirectArray<T,A>& x2 )
Provides memory allocation for PCL containers.
Generic dynamic array of pointers to objects.
T *const * const_iterator
Generic dynamic sorted array of pointers to objects.
bool Contains(const T *p) const
const_iterator Search(const T &v, BP p) const
void Import(iterator i, iterator j)
size_type UpperBound() const
reverse_iterator MutableReverseEnd()
IndirectSortedArray(const IndirectSortedArray &)=default
iterator MutableAt(size_type i)
const_iterator Add(const T *p, size_type n=1)
iterator MutableIterator(const_iterator i)
reverse_iterator MutableReverseBegin()
typename array_implementation::const_reverse_iterator const_reverse_iterator
typename array_implementation::reverse_iterator reverse_iterator
const_iterator MinItem(BP p) const
size_type Count(const T &v, BP p) const
void CloneAssign(const C &x)
void UniquifyIterators(iterator &i, iterator &j)
void Add(const IndirectSortedArray &x)
const_iterator At(size_type i) const
void Delete(iterator i, iterator j)
const_iterator Begin() const
IndirectSortedArray(size_type n, const T *p)
uint32 Hash32(uint32 seed=0) const
void Remove(const_iterator i, size_type n=1)
size_type LowerBound() const
const_iterator Search(const T *p) const
const_reverse_iterator ReverseEnd() const
const_iterator SearchLast(const T *p) const
void RemoveFirst(size_type n=1)
IndirectSortedArray(IndirectSortedArray &&)=default
bool Contains(const T &v, BP p) const
const_iterator SearchLast(const T &v, BP p) const
void Destroy(iterator i, iterator j)
void Add(const IndirectArray< T, A > &x)
typename array_implementation::equal equal
void Delete(iterator i, size_type n=1)
const_iterator MaxItem() const
void RemoveLast(size_type n=1)
void Delete(const T &v, BP p)
typename array_implementation::less less
size_type Count(const T &v) const
const_iterator begin() const
void Remove(const T &v, BP p)
size_type Count(const T *p) const
IndirectSortedArray()=default
typename array_implementation::block_allocator block_allocator
friend void Swap(IndirectSortedArray &x1, IndirectSortedArray &x2)
typename array_implementation::iterator iterator
size_type Available() const
void Destroy(const T &v, BP p)
void Reserve(size_type n)
const_iterator LastThat(F f) const
const_reverse_iterator ReverseBegin() const
const allocator & Allocator() const
const_iterator MinItem() const
void Assign(const array_implementation &x)
void Truncate(const_iterator i)
void Transfer(IndirectSortedArray &x)
void Transfer(IndirectSortedArray &&x)
typename array_implementation::const_iterator const_iterator
const_iterator end() const
IndirectSortedArray(FI i, FI j)
void CloneAssign(SortedArray< T, A > &x)
uint64 Hash(uint64 seed=0) const
const_iterator MaxItem(BP p) const
void Destroy(iterator i, size_type n=1)
const_iterator End() const
bool IsAliasOf(const IndirectSortedArray &x) const
void Remove(const_iterator i, const_iterator j)
void Transfer(array_implementation &x)
void UniquifyIterator(iterator &i)
uint64 Hash64(uint64 seed=0) const
void CloneAssign(IndirectSortedArray &x)
size_type CountIf(UP p) const
const_iterator FirstThat(F f) const
bool Contains(const T &v) const
const_iterator Search(const T &v) const
typename array_implementation::allocator allocator
void Assign(const T *p, size_type n=1)
void Shrink(size_type n=1)
const_iterator SearchLast(const T &v) const
size_type Capacity() const
void SetAllocator(const allocator &a)
IndirectSortedArray(size_type n)
void Assign(const IndirectSortedArray &x)
void Transfer(array_implementation &&x)
Root base class of all PCL sorted containers of pointers to objects.
Reverse random access iterator.
Generic dynamic sorted array.
Array< T, A > & operator<<(Array< T, A > &x, const V &v)
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
Complex< T1 > operator*(const Complex< T1 > &c1, const Complex< T2 > &c2) noexcept
uint64 Hash64(const void *data, size_type size, uint64 seed=0) noexcept
void Swap(GenericPoint< T > &p1, GenericPoint< T > &p2) noexcept
unsigned long long uint64
FI BinarySearch(FI i, FI j, const T &v) noexcept
FI BinarySearchLast(FI i, FI j, const T &v) noexcept
FI1 Search(FI1 i1, FI1 j1, FI2 i2, FI2 j2) noexcept
FI InsertionPoint(FI i, FI j, const T &v) noexcept
void QuickSort(RI i, RI j)
constexpr const T & Min(const T &a, const T &b) noexcept
constexpr const T & Max(const T &a, const T &b) noexcept
A functional class that tests two pointers for equality of the pointed objects.
A functional class that applies the less than relational operator to the objects pointed to by two po...