PCL
|
Generic dynamic sorted array. More...
#include <SortedArray.h>
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 allocator & | Allocator () 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 |
SortedArray & | operator= (array_implementation &&x) |
SortedArray & | operator= (const array_implementation &x) |
SortedArray & | operator= (const SortedArray &x) |
SortedArray & | operator= (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) |
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).
Definition at line 82 of file SortedArray.h.
using pcl::SortedArray< T, A >::allocator = typename array_implementation::allocator |
#
Definition at line 96 of file SortedArray.h.
using pcl::SortedArray< T, A >::array_implementation = Array<T,A> |
#
Definition at line 88 of file SortedArray.h.
using pcl::SortedArray< T, A >::block_allocator = typename array_implementation::block_allocator |
#
Definition at line 92 of file SortedArray.h.
using pcl::SortedArray< T, A >::const_iterator = typename array_implementation::const_iterator |
#
Definition at line 104 of file SortedArray.h.
using pcl::SortedArray< T, A >::const_reverse_iterator = typename array_implementation::const_reverse_iterator |
#
Definition at line 112 of file SortedArray.h.
using pcl::SortedArray< T, A >::iterator = typename array_implementation::iterator |
#
Definition at line 100 of file SortedArray.h.
using pcl::SortedArray< T, A >::reverse_iterator = typename array_implementation::reverse_iterator |
#
Definition at line 108 of file SortedArray.h.
|
default |
Constructs an empty sorted array.
|
inlineexplicit |
Constructs a sorted array of n default-constructed objects.
Definition at line 125 of file SortedArray.h.
|
inline |
Constructs a sorted array of n copies of an object v.
Definition at line 133 of file SortedArray.h.
|
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().
|
inline |
Constructs a sorted array that stores a sorted copy of the objects in the specified initializer list l.
This constructor is equivalent to:
Definition at line 158 of file SortedArray.h.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Destroys a SortedArray object. Destroys and deallocates all contained objects.
Definition at line 177 of file SortedArray.h.
|
inline |
#
Definition at line 547 of file SortedArray.h.
|
inline |
#
Definition at line 535 of file SortedArray.h.
References pcl::SortedArray< T, A >::Begin(), and pcl::SortedArray< T, A >::End().
|
inline |
#
Definition at line 554 of file SortedArray.h.
|
inline |
|
inline |
#
Definition at line 272 of file SortedArray.h.
|
inline |
#
Definition at line 696 of file SortedArray.h.
|
inline |
|
inline |
#
Definition at line 434 of file SortedArray.h.
|
inline |
#
Definition at line 504 of file SortedArray.h.
|
inline |
|
inline |
#
Definition at line 286 of file SortedArray.h.
|
inline |
#
Definition at line 237 of file SortedArray.h.
|
inline |
|
inline |
STL-compatible iteration. Equivalent to Begin() const.
Definition at line 406 of file SortedArray.h.
|
inline |
#
Definition at line 230 of file SortedArray.h.
|
inline |
#
Definition at line 666 of file SortedArray.h.
|
inline |
#
Definition at line 803 of file SortedArray.h.
|
inline |
#
Definition at line 811 of file SortedArray.h.
|
inline |
#
Definition at line 719 of file SortedArray.h.
|
inline |
#
Definition at line 728 of file SortedArray.h.
|
inline |
#
Definition at line 736 of file SortedArray.h.
|
inline |
|
inline |
STL-compatible iteration. Equivalent to End() const.
Definition at line 414 of file SortedArray.h.
|
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.
|
inline |
Sets all objects contained by this array equal to v.
Definition at line 688 of file SortedArray.h.
|
inline |
#
Definition at line 704 of file SortedArray.h.
|
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().
|
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.
|
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.
|
inline |
|
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.
|
inline |
#
Definition at line 251 of file SortedArray.h.
|
inline |
Returns true iff this array uniquely references its contained data.
Definition at line 184 of file SortedArray.h.
|
inline |
#
Definition at line 244 of file SortedArray.h.
|
inline |
#
Definition at line 712 of file SortedArray.h.
|
inline |
Returns the length of this sorted array.
Definition at line 223 of file SortedArray.h.
|
inline |
#
Definition at line 258 of file SortedArray.h.
|
inline |
#
Definition at line 758 of file SortedArray.h.
|
inline |
|
inline |
#
Definition at line 743 of file SortedArray.h.
|
inline |
|
inline |
#
Definition at line 293 of file SortedArray.h.
|
inline |
#
Definition at line 328 of file SortedArray.h.
|
inline |
#
Definition at line 342 of file SortedArray.h.
|
inline |
#
Definition at line 300 of file SortedArray.h.
|
inline |
#
Definition at line 356 of file SortedArray.h.
|
inline |
#
Definition at line 370 of file SortedArray.h.
|
inline |
#
Definition at line 314 of file SortedArray.h.
|
inline |
#
Definition at line 480 of file SortedArray.h.
|
inline |
#
Definition at line 464 of file SortedArray.h.
|
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.
|
inline |
Move assignment operator. Returns a reference to this object.
Definition at line 442 of file SortedArray.h.
|
inline |
#
Definition at line 307 of file SortedArray.h.
|
inline |
#
Definition at line 528 of file SortedArray.h.
|
inline |
#
Definition at line 657 of file SortedArray.h.
|
inline |
#
Definition at line 598 of file SortedArray.h.
|
inline |
#
Definition at line 591 of file SortedArray.h.
|
inline |
Removes a contiguous leading sequence of n existing objects from this 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.
Definition at line 612 of file SortedArray.h.
|
inline |
Removes a contiguous trailing sequence of n existing objects from this 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.
Definition at line 626 of file SortedArray.h.
|
inline |
#
Definition at line 673 of file SortedArray.h.
|
inline |
#
Definition at line 349 of file SortedArray.h.
|
inline |
#
Definition at line 363 of file SortedArray.h.
|
inline |
#
Definition at line 773 of file SortedArray.h.
|
inline |
#
Definition at line 781 of file SortedArray.h.
|
inline |
#
Definition at line 788 of file SortedArray.h.
|
inline |
#
Definition at line 796 of file SortedArray.h.
|
inline |
#
Definition at line 279 of file SortedArray.h.
|
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.
|
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.
|
inline |
#
Definition at line 818 of file SortedArray.h.
|
inline |
#
Definition at line 680 of file SortedArray.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 945 of file SortedArray.h.
|
inline |
Generates a newline-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
Definition at line 987 of file SortedArray.h.
|
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.
|
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:
If the array contains more than one element, 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 931 of file SortedArray.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 959 of file SortedArray.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 973 of file SortedArray.h.
|
inline |
|
inline |
|
inline |
#
Definition at line 457 of file SortedArray.h.
|
inline |
#
Definition at line 450 of file SortedArray.h.
|
inline |
Destroys and removes a trailing sequence of contiguous objects from the specified iterator of this array. This operation is equivalent to:
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.
|
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.
|
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.
|
inline |
#
Definition at line 265 of file SortedArray.h.
|
friend |
Exchanges two sorted arrays x1 and x2.
Definition at line 826 of file SortedArray.h.