PCL
|
Generic dynamic array. More...
#include <Array.h>
Public Types | |
using | allocator = pcl::Allocator< T, A > |
using | block_allocator = A |
using | const_iterator = const T * |
using | const_reverse_iterator = ReverseRandomAccessIterator< const_iterator, const T > |
using | iterator = T * |
using | reverse_iterator = ReverseRandomAccessIterator< iterator, T > |
Public Member Functions | |
Array () | |
Array (Array &&x) | |
Array (const Array &x) | |
template<class FI > | |
Array (FI i, FI j) | |
Array (size_type n) | |
Array (size_type n, const T &v) | |
template<typename T1 > | |
Array (std::initializer_list< T1 > l) | |
~Array () | |
void | Add (const Array &x) |
void | Add (const T &v, size_type n=1) |
template<class FI > | |
void | Add (FI p, FI q) |
const allocator & | Allocator () const noexcept |
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 noexcept(noexcept(f)) |
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 noexcept |
size_type | Available () const noexcept |
iterator | Begin () |
iterator | begin () |
const_iterator | Begin () const noexcept |
const_iterator | begin () const noexcept |
size_type | Capacity () const noexcept |
void | Clear () |
const_iterator | ConstBegin () const noexcept |
const_iterator | ConstEnd () const noexcept |
const_reverse_iterator | ConstReverseBegin () const noexcept |
const_reverse_iterator | ConstReverseEnd () const noexcept |
bool | Contains (const T &v) const noexcept |
template<class BP > | |
bool | Contains (const T &v, BP p) const noexcept(noexcept(p)) |
template<class C > | |
iterator | ContainsSubset (const C &c) const noexcept |
template<class C , class BP > | |
iterator | ContainsSubset (const C &c, BP p) const noexcept(noexcept(p)) |
template<class FI > | |
iterator | ContainsSubset (FI i, FI j) const noexcept |
template<class FI , class BP > | |
iterator | ContainsSubset (FI i, FI j, BP p) const noexcept(noexcept(p)) |
size_type | Count (const T &v) const noexcept |
template<class BP > | |
size_type | Count (const T &v, BP p) const noexcept(noexcept(p)) |
template<class UP > | |
size_type | CountIf (UP p) const noexcept(noexcept(p)) |
iterator | End () |
iterator | end () |
const_iterator | End () const noexcept |
const_iterator | end () const noexcept |
void | EnsureUnique () |
iterator | Expand (size_type n=1) |
void | Fill (const T &v) |
template<class F > | |
iterator | FirstThat (F f) |
template<class F > | |
const_iterator | FirstThat (F f) const noexcept(noexcept(f)) |
iterator | Grow (iterator i, size_type n=1) |
uint64 | Hash (uint64 seed=0) const noexcept |
uint32 | Hash32 (uint32 seed=0) const noexcept |
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 noexcept |
bool | IsEmpty () const noexcept |
bool | IsUnique () const noexcept |
bool | IsValid () const noexcept |
template<class F > | |
const_iterator | LastThat (F f) const noexcept(noexcept(f)) |
size_type | Length () const noexcept |
size_type | LowerBound () const noexcept |
iterator | MaxItem () |
const_iterator | MaxItem () const noexcept |
template<class BP > | |
iterator | MaxItem (BP p) |
template<class BP > | |
const_iterator | MaxItem (BP p) const noexcept(noexcept(p)) |
iterator | MinItem () |
const_iterator | MinItem () const noexcept |
template<class BP > | |
iterator | MinItem (BP p) |
template<class BP > | |
const_iterator | MinItem (BP p) const noexcept(noexcept(p)) |
iterator | MutableIterator (const_iterator i) |
T & | operator* () |
const T & | operator* () const noexcept |
Array & | operator= (Array &&x) |
Array & | operator= (const Array &x) |
T & | operator[] (size_type i) |
const T & | operator[] (size_type i) const noexcept |
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 (const T &v) |
template<class BP > | |
void | Remove (const T &v, BP p) |
void | Remove (iterator i, iterator j) |
void | Remove (iterator i, size_type n=1) |
void | RemoveFirst (size_type n=1) |
void | RemoveLast (size_type n=1) |
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 noexcept |
reverse_iterator | ReverseEnd () |
const_reverse_iterator | ReverseEnd () const noexcept |
void | Rotate (distance_type n) |
iterator | Search (const T &v) |
const_iterator | Search (const T &v) const noexcept |
template<class BP > | |
iterator | Search (const T &v, BP p) |
template<class BP > | |
const_iterator | Search (const T &v, BP p) const noexcept(noexcept(p)) |
iterator | SearchLast (const T &v) |
const_iterator | SearchLast (const T &v) const noexcept |
template<class BP > | |
iterator | SearchLast (const T &v, BP p) |
template<class BP > | |
const_iterator | SearchLast (const T &v, BP p) const noexcept(noexcept(p)) |
template<class BI > | |
iterator | SearchLastSubset (BI i, BI j) |
template<class BI > | |
const_iterator | SearchLastSubset (BI i, BI j) const noexcept |
template<class BI , class BP > | |
iterator | SearchLastSubset (BI i, BI j, BP p) |
template<class BI , class BP > | |
const_iterator | SearchLastSubset (BI i, BI j, BP p) const noexcept(noexcept(p)) |
template<class C > | |
iterator | SearchLastSubset (const C &x) |
template<class C > | |
const_iterator | SearchLastSubset (const C &x) const noexcept |
template<class C , class BP > | |
iterator | SearchLastSubset (const C &x, BP p) |
template<class C , class BP > | |
const_iterator | SearchLastSubset (const C &x, BP p) const noexcept(noexcept(p)) |
template<class C > | |
iterator | SearchSubset (const C &x) |
template<class C > | |
const_iterator | SearchSubset (const C &x) const noexcept |
template<class C , class BP > | |
iterator | SearchSubset (const C &x, BP p) |
template<class C , class BP > | |
const_iterator | SearchSubset (const C &x, BP p) const noexcept(noexcept(p)) |
template<class FI > | |
iterator | SearchSubset (FI i, FI j) |
template<class FI > | |
const_iterator | SearchSubset (FI i, FI j) const noexcept |
template<class FI , class BP > | |
iterator | SearchSubset (FI i, FI j, BP p) |
template<class FI , class BP > | |
const_iterator | SearchSubset (FI i, FI j, BP p) const noexcept(noexcept(p)) |
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 noexcept |
void | Sort () |
template<class BP > | |
void | Sort (BP p) |
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 &&x) |
void | Transfer (Array &x) |
void | Truncate (iterator i) |
void | UniquifyIterator (iterator &i) |
void | UniquifyIterators (iterator &i, iterator &j) |
size_type | UpperBound () const noexcept |
Friends | |
void | Swap (Array &x1, Array &x2) noexcept |
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).
using pcl::Array< T, A >::allocator = pcl::Allocator<T,A> |
using pcl::Array< T, A >::block_allocator = A |
using pcl::Array< T, A >::const_iterator = const T* |
using pcl::Array< T, A >::const_reverse_iterator = ReverseRandomAccessIterator<const_iterator, const T> |
using pcl::Array< T, A >::iterator = T* |
using pcl::Array< T, A >::reverse_iterator = ReverseRandomAccessIterator<iterator, T> |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
Constructs an array that stores a copy of the objects in the specified initializer list l.
This constructor is equivalent to:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
A synonym for Append( const T&, size_type )
|
inline |
A synonym for Append( FI, FI )
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
Replaces the contents of this array with a copy of the sequence defined by the range [i,j) of forward iterators.
Definition at line 733 of file Array.h.
References pcl::Distance().
|
inline |
Returns an array iterator located at the specified array index i.
Definition at line 355 of file Array.h.
Referenced by pcl::GenericChebyshevFit< Tx, Ty >::Evaluate(), and pcl::Compression::Unshuffle().
|
inlinenoexcept |
|
inlinenoexcept |
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.
|
inline |
Returns a mutable iterator located at the beginning of this array.
Definition at line 426 of file Array.h.
Referenced by pcl::JPLEphemeris::ConstantValue(), pcl::CryptographicHash::Finalize(), pcl::CryptographicHash::Hash(), pcl::Compression::InPlaceUnshuffle(), pcl::ICCProfile::IsValid(), pcl::Array< T, A >::Replace(), pcl::Compression::Shuffle(), and pcl::Compression::Uncompress().
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
STL-compatible iteration. Equivalent to Begin() const.
|
inlinenoexcept |
|
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 1173 of file Array.h.
Referenced by pcl::XPSD::SearchData< StarData >::ResetSearchResults().
|
inlinenoexcept |
Returns an immutable iterator located at the beginning of this array.
Definition at line 443 of file Array.h.
Referenced by pcl::Array< T, A >::Replace().
|
inlinenoexcept |
Returns an immutable iterator located at the end of this array.
Definition at line 468 of file Array.h.
Referenced by pcl::Array< T, A >::Replace().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Returns a mutable iterator located at the end of this array.
Definition at line 451 of file Array.h.
Referenced by pcl::JPLEphemeris::ConstantValue(), pcl::FileFormatInstance::ImagePropertyDescription(), pcl::FileFormatInstance::PropertyDescription(), and pcl::Array< T, A >::Replace().
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
STL-compatible iteration. Equivalent to End() const.
|
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 242 of file Array.h.
Referenced by pcl::RedundantMultiscaleTransform::operator=(), and pcl::Array< T, A >::Replace().
|
inline |
Appends a contiguous sequence of n default-constructed objects to this array. This operation is equivalent to:
Returns an iterator pointing to the first newly created array element, or End() if n is zero.
|
inline |
Sets all objects contained by this array equal to v.
Definition at line 1362 of file Array.h.
Referenced by pcl::AES256::AES256().
|
inline |
|
inlinenoexcept |
|
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 816 of file Array.h.
References pcl::Range().
|
inlinenoexcept |
Returns a non-cryptographic hash value computed for this array. This function is a synonym for Hash64().
Definition at line 2020 of file Array.h.
References pcl::Hash64().
|
inlinenoexcept |
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 2011 of file Array.h.
References pcl::Hash32().
|
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 1998 of file Array.h.
References pcl::Hash64().
|
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.
|
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.
|
inline |
|
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.
Definition at line 925 of file Array.h.
References pcl::Range().
|
inlinenoexcept |
|
inlinenoexcept |
Returns true iff this array is empty.
Definition at line 312 of file Array.h.
Referenced by pcl::QuadTree< T >::LeafNode::LeafNode(), and pcl::GenericChebyshevFit< Tx, Ty >::IsValid().
|
inlinenoexcept |
|
inlinenoexcept |
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:
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.
|
inlinenoexcept |
|
inlinenoexcept |
Returns the length of this dynamic array.
Definition at line 266 of file Array.h.
Referenced by pcl::PointSurfacePolynomial< P >::Initialize(), pcl::GenericChebyshevFit< Tx, Ty >::IsTruncated(), pcl::QuadTree< T >::LeafNode::Length(), and pcl::GenericChebyshevFit< Tx, Ty >::Length().
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
Returns a mutable iterator pointing to the same array element as the specified immutable iterator i.
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
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.
|
inline |
|
inline |
|
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 1044 of file Array.h.
References pcl::Max().
|
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.
|
inline |
Removes a contiguous leading sequence of n existing objects from this 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.
|
inline |
Removes a contiguous trailing sequence of n existing objects from this 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.
|
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 1199 of file Array.h.
References pcl::Array< T, A >::Begin(), pcl::Array< T, A >::ConstBegin(), pcl::Array< T, A >::ConstEnd(), pcl::Array< T, A >::End(), and pcl::Array< T, A >::EnsureUnique().
|
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.
|
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.
Definition at line 1264 of file Array.h.
References pcl::Range().
|
inline |
|
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:
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
#
Definition at line 1578 of file Array.h.
Referenced by pcl::FileFormatInstance::ImagePropertyDescription(), and pcl::FileFormatInstance::PropertyDescription().
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
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.
|
inline |
|
inline |
|
inline |
|
inline |
Removes a contiguous trailing sequence of n existing objects from this array. This function is a synonym for RemoveLast().
|
inlinenoexcept |
|
inline |
|
inline |
|
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.
|
inline |
Generates a comma-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inline |
Generates a newline-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
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.
|
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.
|
inline |
Generates a space-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inline |
Generates a tabulator-separated sequence of string tokens. Returns a reference to the target string s.
This function is equivalent to:
|
inline |
|
inline |
|
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 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.
|
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.
|
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.
|
inlinenoexcept |