PCL
|
Generic dynamic sorted array of pointers to objects. More...
#include <IndirectSortedArray.h>
Public Types | |
using | allocator = typename array_implementation::allocator |
using | array_implementation = IndirectArray< 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 | equal = typename array_implementation::equal |
using | iterator = typename array_implementation::iterator |
using | less = typename array_implementation::less |
using | reverse_iterator = typename array_implementation::reverse_iterator |
Public Member Functions | |
IndirectSortedArray ()=default | |
IndirectSortedArray (const IndirectSortedArray &)=default | |
template<class FI > | |
IndirectSortedArray (FI i, FI j) | |
IndirectSortedArray (IndirectSortedArray &&)=default | |
IndirectSortedArray (size_type n) | |
IndirectSortedArray (size_type n, const T *p) | |
~IndirectSortedArray () | |
void | Add (const IndirectArray< T, A > &x) |
void | Add (const IndirectSortedArray &x) |
const_iterator | Add (const T *p, size_type n=1) |
template<class FI > | |
void | Add (FI i, FI j) |
const allocator & | Allocator () const |
template<class F > | |
void | Apply (F f) const |
void | Assign (const array_implementation &x) |
void | Assign (const IndirectSortedArray &x) |
void | Assign (const T *p, 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 () |
template<class C > | |
void | CloneAssign (const C &x) |
void | CloneAssign (IndirectSortedArray &x) |
void | CloneAssign (SortedArray< T, A > &x) |
bool | Contains (const T &v) const |
template<class BP > | |
bool | Contains (const T &v, BP p) const |
bool | Contains (const T *p) const |
size_type | Count (const T &v) const |
template<class BP > | |
size_type | Count (const T &v, BP p) const |
size_type | Count (const T *p) const |
template<class UP > | |
size_type | CountIf (UP p) const |
void | Delete () |
void | Delete (const T &v) |
template<class BP > | |
void | Delete (const T &v, BP p) |
void | Delete (iterator i, iterator j) |
void | Delete (iterator i, size_type n=1) |
void | Destroy () |
void | Destroy (const T &v) |
template<class BP > | |
void | Destroy (const T &v, BP p) |
void | Destroy (iterator i, iterator j) |
void | Destroy (iterator i, size_type n=1) |
const_iterator | End () const |
const_iterator | end () const |
void | EnsureUnique () |
void | Fill (const T &v) |
const T * | First () const |
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 IndirectSortedArray &x) const |
bool | IsEmpty () const |
bool | IsUnique () const |
bool | IsValid () const |
const T * | Last () 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 () |
T * | MutableFirst () |
iterator | MutableIterator (const_iterator i) |
T * | MutableLast () |
reverse_iterator | MutableReverseBegin () |
reverse_iterator | MutableReverseEnd () |
const T * | operator* () const |
IndirectSortedArray & | operator= (array_implementation &&x) |
IndirectSortedArray & | operator= (const array_implementation &x) |
IndirectSortedArray & | operator= (const IndirectSortedArray &x) |
IndirectSortedArray & | operator= (IndirectSortedArray &&x) |
const T * | operator[] (size_type i) const |
void | Pack () |
iterator | Release () |
void | Remove (const T &v) |
template<class BP > | |
void | Remove (const T &v, BP p) |
void | Remove (const T *p) |
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 | Search (const T *p) const |
const_iterator | SearchLast (const T &v) const |
template<class BP > | |
const_iterator | SearchLast (const T &v, BP p) const |
const_iterator | SearchLast (const T *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 , 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 (IndirectSortedArray &&x) |
void | Transfer (IndirectSortedArray &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 IndirectSortedArray &x2) |
bool | operator< (const IndirectSortedArray &x1, const array_implementation &x2) |
bool | operator< (const IndirectSortedArray &x1, const IndirectSortedArray &x2) |
bool | operator== (const array_implementation &x1, const IndirectSortedArray &x2) |
bool | operator== (const IndirectSortedArray &x1, const array_implementation &x2) |
bool | operator== (const IndirectSortedArray &x1, const IndirectSortedArray &x2) |
void | Swap (IndirectSortedArray &x1, IndirectSortedArray &x2) |
IndirectSortedArray is a generic, finite sorted sequence of pointers to objects, implemented as a reference-counted, dynamic array of T pointers with automatic sorting of inserted array elements. The type A provides dynamic allocation for contiguous sequences of void* elements (StandardAllocator is used by default).
Ordering of array elements is implemented by indirection, that is, the pointed-to objects are compared for sorting, not the contained pointers.
Unlike ReferenceArray and ReferenceSortedArray, IndirectSortedArray can contain null pointers, which are ignored automatically in all internal operations controlling the implicit ordering of the (indirectly) contained elements.
Definition at line 91 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::allocator = typename array_implementation::allocator |
#
Definition at line 105 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::array_implementation = IndirectArray<T,A> |
#
Definition at line 97 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::block_allocator = typename array_implementation::block_allocator |
#
Definition at line 101 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::const_iterator = typename array_implementation::const_iterator |
#
Definition at line 113 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::const_reverse_iterator = typename array_implementation::const_reverse_iterator |
#
Definition at line 121 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::equal = typename array_implementation::equal |
#
Definition at line 125 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::iterator = typename array_implementation::iterator |
#
Definition at line 109 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::less = typename array_implementation::less |
#
Definition at line 129 of file IndirectSortedArray.h.
using pcl::IndirectSortedArray< T, A >::reverse_iterator = typename array_implementation::reverse_iterator |
#
Definition at line 117 of file IndirectSortedArray.h.
|
default |
Constructs an empty indirect sorted array.
|
inlineexplicit |
Constructs an indirect sorted array of length n. All contained pointers are initialized to nullptr
.
Definition at line 143 of file IndirectSortedArray.h.
|
inline |
Constructs an indirect sorted array that stores n copies of a pointer p.
Definition at line 152 of file IndirectSortedArray.h.
|
inline |
Constructs an indirect sorted array as a copy of the sequence of pointers defined by the range [i,j). The stored sequence of pointers is sorted by comparing the pointed objects.
Definition at line 163 of file IndirectSortedArray.h.
References pcl::Sort().
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Destroys an IndirectSortedArray object.
Deallocates the internal array of pointers to objects, but does not destroy the pointed objects. To destroy them, you have to call Destroy() or Delete() explicitly.
Definition at line 186 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 611 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 598 of file IndirectSortedArray.h.
References pcl::IndirectArray< T, A >::Begin(), and pcl::IndirectArray< T, A >::End().
|
inline |
#
Definition at line 618 of file IndirectSortedArray.h.
|
inline |
|
inline |
#
Definition at line 284 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 883 of file IndirectSortedArray.h.
|
inline |
|
inline |
#
Definition at line 474 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 544 of file IndirectSortedArray.h.
|
inline |
|
inline |
#
Definition at line 298 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 249 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 333 of file IndirectSortedArray.h.
|
inline |
STL-compatible iteration. Equivalent to Begin() const.
Definition at line 446 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 242 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 754 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 561 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 576 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 569 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 1011 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 1026 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 1018 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 906 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 922 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 914 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 930 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 806 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 785 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 797 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 768 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 761 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 846 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 827 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 838 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 820 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 813 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 347 of file IndirectSortedArray.h.
|
inline |
STL-compatible iteration. Equivalent to End() const.
Definition at line 454 of file IndirectSortedArray.h.
|
inline |
Ensures that this indirect array uniquely references its contained data pointers.
If necessary, this member function generates a duplicate of the array of pointers, references it, and then decrements the reference counter of the original pointers array.
Definition at line 219 of file IndirectSortedArray.h.
|
inline |
Sets all objects contained by this array equal to v.
Definition at line 875 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 389 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 891 of file IndirectSortedArray.h.
|
inline |
Returns a non-cryptographic hash value computed for this indirect array. This function is a synonym for Hash64().
Definition at line 1232 of file IndirectSortedArray.h.
References pcl::Hash64().
|
inline |
Returns a 32-bit non-cryptographic hash value computed for this indirect array.
This function calls pcl::Hash32() for the internal array of pointers, not for the pointed objects.
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 1223 of file IndirectSortedArray.h.
|
inline |
Returns a 64-bit non-cryptographic hash value computed for this indirect array.
This function calls pcl::Hash64() for the internal array of pointers, not for the pointed objects.
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 1208 of file IndirectSortedArray.h.
|
inline |
|
inline |
Returns true iff this indirect sorted array is an alias of the indirect sorted array x.
Two objects are aliases if both share the same data. Two indirect containers are aliases if they share a unique set of data pointers.
Definition at line 206 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 263 of file IndirectSortedArray.h.
|
inline |
Returns true iff this indirect sorted array uniquely references its contained array of data pointers.
Definition at line 194 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 256 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 403 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 899 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 235 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 270 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 952 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 960 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 937 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 945 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 305 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 340 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 354 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 396 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 312 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 410 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 368 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 382 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 326 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 520 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 504 of file IndirectSortedArray.h.
|
inline |
Copy assignment operator.
Causes this indirect array to reference the same set of pointers as another array x. Returns a reference to this object.
Definition at line 466 of file IndirectSortedArray.h.
|
inline |
Move assignment operator. Returns a reference to this object.
Definition at line 482 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 319 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 853 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 591 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 730 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 740 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 747 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 662 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 655 of file IndirectSortedArray.h.
|
inline |
Removes a contiguous leading sequence of n existing pointers from this indirect sorted array. This operation is equivalent to:
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.
Only pointers are removed by this function; the pointed objects are not affected in any way.
Definition at line 679 of file IndirectSortedArray.h.
|
inline |
Removes a contiguous trailing sequence of n existing pointers from this indirect sorted array. This operation is equivalent to:
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.
Only pointers are removed by this function; the pointed objects are not affected in any way.
Definition at line 696 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 860 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 361 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 375 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 967 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 982 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 974 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 989 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 1004 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 996 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 291 of file IndirectSortedArray.h.
|
inline |
Removes a contiguous trailing sequence of n existing pointers from this indirect array. This function is a synonym for RemoveLast().
Definition at line 723 of file IndirectSortedArray.h.
|
inline |
Returns the total number of bytes required to store the array of data pointers in this indirect array.
Definition at line 228 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 1033 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 867 of file IndirectSortedArray.h.
|
inline |
Generates a comma-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
Definition at line 1165 of file IndirectSortedArray.h.
|
inline |
Generates a sequence of string tokens separated with the specified separator string. Returns a reference to the target string s.
For each non-null pointer in this indirect array, this function appends a string representation of the pointed object (known as a token) to the target string s. If the array contains more than one non-null pointer, 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 1123 of file IndirectSortedArray.h.
|
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 non-null pointer p in this indirect array, this function appends a string representation of the pointed object (known as a token) to the target string s by calling the append function:
If the array contains more than one non-null pointer, successive tokens are separated by calling:
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 1151 of file IndirectSortedArray.h.
|
inline |
Generates a space-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
Definition at line 1179 of file IndirectSortedArray.h.
|
inline |
Generates a tabulator-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
Definition at line 1193 of file IndirectSortedArray.h.
|
inline |
|
inline |
|
inline |
#
Definition at line 497 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 490 of file IndirectSortedArray.h.
|
inline |
Removes a trailing sequence of contiguous pointers from the specified iterator of this indirect array. This operation is equivalent to:
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.
Only pointers are removed by this function; the pointed objects are not affected in any way.
Definition at line 714 of file IndirectSortedArray.h.
|
inline |
Ensures that the specified iterator points to a uniquely referenced pointer. If necessary, this function builds a new, uniquely referenced copy of this indirect array by calling EnsureUnique().
If the iterator i is changed, it is guaranteed to point to the pointer at the same array index it was pointing to before calling this function.
Definition at line 423 of file IndirectSortedArray.h.
|
inline |
Ensures that the specified iterators point to uniquely referenced pointers. If necessary, this function builds a new, uniquely referenced copy of this indirect array by calling EnsureUnique().
If the iterators i and j are changed, they are guaranteed to point to the pointers at the same array indices they were pointing to before calling this function.
Definition at line 437 of file IndirectSortedArray.h.
|
inline |
#
Definition at line 277 of file IndirectSortedArray.h.
|
friend |
Exchanges two indirect sorted arrays x1 and x2.
Definition at line 1041 of file IndirectSortedArray.h.