#include <ptr_vector.h>
Public Member Functions | |
ptr_vector () | |
ptr_vector (iterator first, iterator last) | |
template<typename StlPtrInputIterator> | |
ptr_vector (StlPtrInputIterator first, StlPtrInputIterator last) | |
~ptr_vector () | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
bool | empty () const |
size_type | capacity () const |
void | reserve (size_type n) |
reference | operator[] (size_type n) |
const_reference | operator[] (size_type n) const |
reference | at (size_type n) |
const_reference | at (size_type n) const |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | push_back (pointer x) |
pointer | pop_back () |
iterator | insert (iterator position, pointer x) |
void | insert (iterator position, iterator first, iterator last) |
template<typename StlPtrInputIterator> | |
void | insert (iterator position, StlPtrInputIterator first, StlPtrInputIterator last) |
pointer | detach (iterator position) |
template<typename StlPtrOutputIterator> | |
void | detach (iterator first, iterator last, StlPtrOutputIterator result) |
void | swap (ptr_vector &other) |
void | swap (std::vector< T * > &other) |
void | sort () |
template<typename Compare> | |
void | sort (Compare comp) |
stdx::ptr_vector<T>
is a wrapper for std::vector<T*>
that cuts one level of indirection for iterators and member functions. In essence ptr_vector lets you treat a vector of pointers as if it were a vector of values.
stdx::ptr_vector< T >::ptr_vector | ( | ) | [inline] |
constructs an empty ptr_vector
stdx::ptr_vector< T >::ptr_vector | ( | iterator | first, | |
iterator | last | |||
) | [inline] |
constructs a ptr_vector from a pair of ptr_vector<T>::iterators in the range [first, last), e.g.
ptr_vector one; one.push_back (new T); ptr_vector two (one.begin(), one.end());
stdx::ptr_vector< T >::ptr_vector | ( | StlPtrInputIterator | first, | |
StlPtrInputIterator | last | |||
) | [inline] |
constructs a ptr_vector from a pair of input iterators with value_type T* in the range [first, last), e.g.
std::list<T*> lst; lst.push_back (new T); ptr_vector ptv (lst.begin(), lst.end());
stdx::ptr_vector< T >::~ptr_vector | ( | ) | [inline] |
destroys pointers in ptr_vector; pointed-to objets are NOT destroyed!!
iterator stdx::ptr_vector< T >::begin | ( | ) | [inline] |
const_iterator stdx::ptr_vector< T >::begin | ( | ) | const [inline] |
iterator stdx::ptr_vector< T >::end | ( | ) | [inline] |
const_iterator stdx::ptr_vector< T >::end | ( | ) | const [inline] |
reverse_iterator stdx::ptr_vector< T >::rbegin | ( | ) | [inline] |
const_reverse_iterator stdx::ptr_vector< T >::rbegin | ( | ) | const [inline] |
reverse_iterator stdx::ptr_vector< T >::rend | ( | ) | [inline] |
const_reverse_iterator stdx::ptr_vector< T >::rend | ( | ) | const [inline] |
size_type stdx::ptr_vector< T >::size | ( | ) | const [inline] |
size_type stdx::ptr_vector< T >::max_size | ( | ) | const [inline] |
bool stdx::ptr_vector< T >::empty | ( | ) | const [inline] |
size_type stdx::ptr_vector< T >::capacity | ( | ) | const [inline] |
void stdx::ptr_vector< T >::reserve | ( | size_type | n | ) | [inline] |
ensures that capacity() is greater or equal to n
reference stdx::ptr_vector< T >::operator[] | ( | size_type | n | ) | [inline] |
const_reference stdx::ptr_vector< T >::operator[] | ( | size_type | n | ) | const [inline] |
reference stdx::ptr_vector< T >::at | ( | size_type | n | ) | [inline] |
const_reference stdx::ptr_vector< T >::at | ( | size_type | n | ) | const [inline] |
reference stdx::ptr_vector< T >::front | ( | ) | [inline] |
const_reference stdx::ptr_vector< T >::front | ( | ) | const [inline] |
reference stdx::ptr_vector< T >::back | ( | ) | [inline] |
const_reference stdx::ptr_vector< T >::back | ( | ) | const [inline] |
void stdx::ptr_vector< T >::push_back | ( | pointer | x | ) | [inline] |
appends element x to the ptr_vector; x must not be 0 or NULL
pointer stdx::ptr_vector< T >::pop_back | ( | ) | [inline] |
removes the last element from the ptr_vector;
iterator stdx::ptr_vector< T >::insert | ( | iterator | position, | |
pointer | x | |||
) | [inline] |
inserts element x before position; x must not be 0 or NULL;
void stdx::ptr_vector< T >::insert | ( | iterator | position, | |
iterator | first, | |||
iterator | last | |||
) | [inline] |
inserts a sequence delimited by [first, last) before position;
void stdx::ptr_vector< T >::insert | ( | iterator | position, | |
StlPtrInputIterator | first, | |||
StlPtrInputIterator | last | |||
) | [inline] |
inserts a sequence delimited by input iterators with value_type T* in the range [first, last) before position;
pointer stdx::ptr_vector< T >::detach | ( | iterator | position | ) | [inline] |
removes element denoted by position;
void stdx::ptr_vector< T >::detach | ( | iterator | first, | |
iterator | last, | |||
StlPtrOutputIterator | result | |||
) | [inline] |
copies elements in the range [first, last) into the range [result, result + (last - first)) starting from first and proceeding to last; result must point to the begin of a range large enough to hold the copied elements; removes copied elements from ptr_vector
void stdx::ptr_vector< T >::swap | ( | ptr_vector< T > & | other | ) | [inline] |
exchanges elements with other ptr_vector
void stdx::ptr_vector< T >::swap | ( | std::vector< T * > & | other | ) | [inline] |
exchanges elements with std::vector<T*>
void stdx::ptr_vector< T >::sort | ( | ) | [inline] |
sorts ptr_vector according to operator<
void stdx::ptr_vector< T >::sort | ( | Compare | comp | ) | [inline] |
sorts ptr_vector according to Compare function (object) comp