SourcePro® 2022.1 |
SourcePro® API Reference Guide |
A pointer-based collection of values implemented as a vector. More...
#include <rw/tpvector.h>
Public Types | |
typedef const_pointer | const_iterator |
typedef const value_type * | const_pointer |
typedef const value_type & | const_reference |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef ptrdiff_t | difference_type |
typedef pointer | iterator |
typedef value_type * | pointer |
typedef value_type & | reference |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef size_t | size_type |
typedef T * | value_type |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
bool | operator!= (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
template<class T > | |
bool | operator< (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
template<class T > | |
bool | operator<= (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
template<class T > | |
bool | operator== (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
template<class T > | |
bool | operator> (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
template<class T > | |
bool | operator>= (const RWTPtrVector< T > &lhs, const RWTPtrVector< T > &rhs) |
Class RWTPtrVector is a simple parameterized vector of pointers to objects of type T
. It is most useful when you know precisely how many pointers must be held in the collection. If the intention is to insert an unknown number of objects into a collection, then class RWTPtrOrderedVector may be a better choice. Class T
can be of any type.
Program output (if run on June 18, 2009):
typedef const_pointer RWTPtrVector< T >::const_iterator |
A type that provides a const
random-access iterator over the elements in the container.
typedef const value_type* RWTPtrVector< T >::const_pointer |
A type that provides a const
pointer to an element in the container.
typedef const value_type& RWTPtrVector< T >::const_reference |
A type that provides a const
reference to an element in the container.
typedef std::reverse_iterator<const_iterator> RWTPtrVector< T >::const_reverse_iterator |
A type that provides a const
random-access, reverse-order iterator over the elements in the container.
typedef ptrdiff_t RWTPtrVector< T >::difference_type |
A signed integral type used to indicate the distance between two valid iterators on the same container.
typedef pointer RWTPtrVector< T >::iterator |
A type that provides a random-access iterator over the elements in the container.
typedef value_type* RWTPtrVector< T >::pointer |
A type that provides a pointer to an element in the container.
typedef value_type& RWTPtrVector< T >::reference |
A type that provides a reference to an element in the container.
typedef std::reverse_iterator<iterator> RWTPtrVector< T >::reverse_iterator |
A type that provides a random-access, reverse-order iterator over the elements in the container.
typedef size_t RWTPtrVector< T >::size_type |
An unsigned integral type used for counting the number of elements in the container.
typedef T* RWTPtrVector< T >::value_type |
A type representing the container's data type.
|
inline |
Constructs an empty vector of length zero.
|
inline |
Constructs a vector of length n. The initial values of the elements are undefined. Hence, they can (and probably will) be garbage.
|
inline |
Constructs a vector of length n, with each element pointing to the item ival.
|
inline |
Copy constructor. The constructed vector is a shallow copy of rhs. The two vectors will then have the same length, and pointers held by the two vectors will point to the same items.
|
inline |
Move constructor. The constructed vector takes ownership of the data owned by rhs.
|
inline |
Constructs a vector by copying elements from the range [first, last).
InputIterator
is an input iterator type that points to elements that are convertible to value_type objects.
|
inline |
Invokes the function pointer fn on each item in the collection. Client data may be passed through parameter d.
|
inline |
Invokes the function pointer fn on each item in the collection. Client data may be passed through parameter d.
|
inline |
Invokes the function pointer fn on each item in the collection. Client data may be passed through parameter d.
|
inline |
Copies each element in the range [first, last) into self, replacing any existing items.
InputIterator
is an input iterator type that points to elements that are convertible to value_type objects.
|
inline |
Returns a reference to the i th element of self.
RWBoundsErr | Thrown if index i is not between 0 and one less than the number of entries in self. |
|
inline |
Returns a reference to the i th element of self.
RWBoundsErr | Thrown if index i is not between 0 and one less than the number of entries in self. |
|
inline |
Returns an iterator referring to the first element in the container.
If the container is empty, returns end().
|
inline |
Returns an iterator referring to the first element in the container.
If the container is empty, returns end().
|
inline |
Returns an iterator referring to the first element in the container.
If the container is empty, returns end().
|
inline |
Returns an iterator referring to the element after the last element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Clears the collection by removing all items from self. Does not call operator delete
on the individual items.
|
inline |
Removes all items from the collection and uses operator delete
to destroy the objects pointed to by those items. Do not use this method if multiple pointers to the same object are stored.
|
inline |
Returns true
if there exists an element t
in self such that the expression ((*fn)(t,d))
is true
, otherwise returns false
. Client data may be passed through parameter d.
|
inline |
Returns true
if there exists an element t
in self such that the expression (*t == *a)
is true
, otherwise returns false
.
|
inline |
Returns an iterator referring to the last element in the container.
If the container is empty, returns rend().
|
inline |
Returns an iterator referring to the element before the first element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Returns a pointer to the first element of the vector. The value returned is undefined if the vector is empty.
|
inline |
Returns a pointer to the first element of the vector. The value returned is undefined if the vector is empty.
|
inline |
Returns an iterator referring to the element after the last element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Returns an iterator referring to the element after the last element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Returns the number of items in self.
|
inline |
If there exists an element t
in self such that the expression ((*fn)(t,d))
is true
, returns t
. Otherwise, returns rwnil. Client data may be passed through parameter d.
|
inline |
If there exists an element t
in self such that the expression (*t == *a)
is true
, returns t
. Otherwise, returns rwnil.
|
inline |
Returns a reference to the first item in the collection.
Calling this function on an empty collection results in undefined behavior.
|
inline |
Returns a reference to the first item in the collection.
Calling this function on an empty collection results in undefined behavior.
|
inline |
Returns the position of the first item t
in self such that (*t == *a)
, or returns RW_NPOS if no such item exists.
|
inline |
Returns the position of the first item t
in self such that ((*fn)(t,d))
is true
, or returns RW_NPOS if no such item exists. Client data may be passed through parameter d.
|
inline |
Returns true
if there are no items in the collection, otherwise false
.
|
inline |
Returns a reference to the last item in the collection.
Calling this function on an empty collection results in undefined behavior.
|
inline |
Returns a reference to the last item in the collection.
Calling this function on an empty collection results in undefined behavior.
|
inline |
Returns the number of items in self.
|
inline |
Returns a reference to the maximum element in self.
|
inline |
Returns a reference to the maximum element in self.
|
inline |
Returns a reference to the minimum element in self.
|
inline |
Returns a reference to the minimum element in self.
|
inline |
Returns the number of elements t
in self such that the expression ((*fn)(t,d))
is true
. Client data may be passed through parameter d.
|
inline |
Returns the number of elements t
in self such that the expression (*t == *a)
is true
.
|
inline |
Returns the i th value in the vector. The index i must be between zero and the length of the vector, less one. No bounds checking is performed.
|
inline |
Returns the i th value in the vector. The index i must be between zero and the length of the vector, less one. No bounds checking is performed.
|
inline |
Sets self to a shallow copy of rhs. The two vectors will then have the same length, and pointers held by the two vectors will point to the same items.
|
inline |
Move assignment. Self takes ownership of the data owned by rhs.
|
inline |
Sets all elements in self to point to the item p.
|
inline |
Returns the i th value in the vector.
RWBoundsErr | Thrown if the index i is not between zero and the length of the vector, less one. |
|
inline |
Returns the i th value in the vector.
RWBoundsErr | Thrown if the index i is not between zero and the length of the vector, less one. |
|
inline |
Returns an iterator referring to the last element in the container.
If the container is empty, returns rend().
|
inline |
Returns an iterator referring to the last element in the container.
If the container is empty, returns rend().
|
inline |
Returns an iterator referring to the element before the first element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Returns an iterator referring to the element before the first element in the container.
Dereferencing the iterator returned by this function results in undefined behavior.
|
inline |
Replaces with newVal all elements t
in self such that the expression ((*fn)(t,d))
is true
. Returns the number of items replaced. Client data may be passed through parameter d
.
|
inline |
Replaces with newVal all elements t
in self such that the expression (*t == *oldVal)
is true
. Returns the number of items replaced.
|
inline |
Changes the length of the vector to N. If this increases the length of the vector, then the initial value of the additional elements is undefined.
|
inline |
Changes the length of the vector to N. If this increases the length of the vector, then the initial value of the additional elements is set to rwnil.
|
inline |
Sorts the collection using the less-than operator to compare elements. Elements are dereferenced before being compared.
|
inline |
Swaps the data owned by self with the data owned by rhs.
|
related |
Equivalent to !(lhs == rhs)
.
|
related |
Returns true
if lhs is lexicographically less than rhs, otherwise false
. Items in each collection are dereferenced before being compared. Assumes that type T
has well-defined less-than semantics.
|
related |
Equivalent to !(rhs < lhs)
.
|
related |
Returns true
if lhs and rhs are equal, otherwise false
. Two collections are equal if both have the same number of entries, and iterating through both collections produces individual elements that, in turn, compare equal to each other. Elements are dereferenced before being compared.
|
related |
Equivalent to (rhs < lhs)
.
|
related |
Equivalent to !(lhs < rhs)
.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |