![]() |
PST SDK
6.0.0.0-272350a
|
Basic vector class, cloning std::vector<T>. More...
#include <PstVector.h>
Classes | |
class | Allocator |
Public Types | |
typedef T | value_type |
typedef size_t | size_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | iterator |
typedef const T * | const_iterator |
Private Member Functions | |
void | resize_internal (size_type size, const_pointer data) |
void | check_bounds (size_type index) const |
Private Attributes | |
size_type | m_size |
size_type | m_allocated |
pointer | m_array |
Allocator | m_allocator |
This class can safely be passed across the DLL boundary.
PstVector<T> has been defined for the following types:
typedef const T* PSTech::Utils::PstVector< T >::const_iterator |
typedef const T* PSTech::Utils::PstVector< T >::const_pointer |
typedef const T& PSTech::Utils::PstVector< T >::const_reference |
typedef T* PSTech::Utils::PstVector< T >::iterator |
typedef T* PSTech::Utils::PstVector< T >::pointer |
typedef T& PSTech::Utils::PstVector< T >::reference |
typedef size_t PSTech::Utils::PstVector< T >::size_type |
typedef T PSTech::Utils::PstVector< T >::value_type |
PSTech::Utils::PstVector< T >::PstVector | ( | ) |
Default constructor creates empty PstVector of size 0
|
explicit |
Construct a PstVector of size size, using the default constructor of T
PSTech::Utils::PstVector< T >::PstVector | ( | size_type | size, |
const_reference | data | ||
) |
Construct a PstVector of size size and filling it with copies of data
PSTech::Utils::PstVector< T >::PstVector | ( | const PstVector< T > & | vector | ) |
Copy constructor
|
noexcept |
Move constructor
PSTech::Utils::PstVector< T >::~PstVector | ( | ) |
Destructor
void PSTech::Utils::PstVector< T >::assign | ( | size_type | count, |
const_reference | data | ||
) |
const_reference PSTech::Utils::PstVector< T >::at | ( | size_type | index | ) | const |
Get a const reference to the item stored at position `índex' in the PstVector with bounds check. If `index' is larger than the size of the PstVector, a PSTech::OutOfRangeException is thrown.
PSTech::OutOfRangeException |
reference PSTech::Utils::PstVector< T >::at | ( | size_type | index | ) |
Get a reference to the item stored at position `índex' in the PstVector with bounds check. If `index' is larger than the size of the PstVector, a PSTech::OutOfRangeException is thrown.
PSTech::OutOfRangeException |
const_reference PSTech::Utils::PstVector< T >::back | ( | ) | const |
Get a const reference to the last element in the PstVector.
reference PSTech::Utils::PstVector< T >::back | ( | ) |
Get a reference to the last element in the PstVector.
const_iterator PSTech::Utils::PstVector< T >::begin | ( | ) | const |
Get a const iterator to the beginning of the PstVector.
iterator PSTech::Utils::PstVector< T >::begin | ( | ) |
Get an iterator to the beginning of the PstVector.
size_type PSTech::Utils::PstVector< T >::capacity | ( | ) | const |
Get the number of elements for which memory has been allocated.
const_iterator PSTech::Utils::PstVector< T >::cbegin | ( | ) | const |
Get a const iterator to the beginning of the PstVector.
const_iterator PSTech::Utils::PstVector< T >::cend | ( | ) | const |
Get a const iterator to the end of the PstVector.
|
private |
void PSTech::Utils::PstVector< T >::clear | ( | ) |
bool PSTech::Utils::PstVector< T >::empty | ( | ) | const |
Returns true if the PstVector is empty.
const_iterator PSTech::Utils::PstVector< T >::end | ( | ) | const |
Get a const iterator to the end of the PstVector.
iterator PSTech::Utils::PstVector< T >::end | ( | ) |
Get an iterator to the end of the PstVector.
const_reference PSTech::Utils::PstVector< T >::front | ( | ) | const |
Get a const reference to the first element in the PstVector.
reference PSTech::Utils::PstVector< T >::front | ( | ) |
Get a reference to the first element in the PstVector.
PstVector& PSTech::Utils::PstVector< T >::operator= | ( | const PstVector< T > & | vector | ) |
Assignment operator
|
noexcept |
Move assignment operator
const_reference PSTech::Utils::PstVector< T >::operator[] | ( | size_type | index | ) | const |
Get a const reference to the item stored at position `índex' in the PstVector.
reference PSTech::Utils::PstVector< T >::operator[] | ( | size_type | index | ) |
Get a reference to the item stored at position `índex' in the PstVector.
void PSTech::Utils::PstVector< T >::pop_back | ( | ) |
Destroy the last element from the back of the PstVector, decreasing its size by one.
void PSTech::Utils::PstVector< T >::push_back | ( | const_reference | data | ) |
Add a copy of `data' to the back of the PstVector, increasing its size by one. If not enough memory has been allocated to store the extra element, double the Pstvector size.
void PSTech::Utils::PstVector< T >::push_back | ( | T && | data | ) |
Move `data' to the back of the PstVector, increasing its size by one. If not enough memory has been allocated to store the extra element, double the Pstvector size.
void PSTech::Utils::PstVector< T >::reserve | ( | size_type | size | ) |
Allocate space for a PstVector of size `size'. This function ensures that the PstVector has enough memory allocated to contain `size' element, allocating more memory if needed.
void PSTech::Utils::PstVector< T >::resize | ( | size_type | size | ) |
Allocate memory for a PstVector of size `size' and initialize its elements using the defualt constructor of T.
void PSTech::Utils::PstVector< T >::resize | ( | size_type | size, |
const_reference | data | ||
) |
Allocate memory for a PstVector of size `size' and initialize its elements using copies of `data'.
|
private |
size_type PSTech::Utils::PstVector< T >::size | ( | ) | const |
Get the current size of the PstVector
|
noexcept |
Swaps the contents of the Pstvector with vector.
|
private |
|
private |
|
private |
|
private |