![]() |
PST SDK
5.2.0.0-0eac0f6
|
Basic vector class, cloning std::vector<T>. More...
#include <PstVector.h>
Collaboration diagram for PSTech::Utils::PstVector< T >: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 |
Public Member Functions | |
| PstVector () | |
| PstVector (size_type size) | |
| PstVector (size_type size, const_reference data) | |
| PstVector (const PstVector &vector) | |
| ~PstVector () | |
| size_type | size () const |
| size_type | capacity () const |
| bool | empty () const |
| void | reserve (size_type size) |
| void | resize (size_type size) |
| void | resize (size_type size, const_reference data) |
| void | clear () |
| void | assign (size_type count, const_reference data) |
| void | push_back (const_reference data) |
| void | push_back (T &&data) |
| void | pop_back () |
| const_reference | at (size_type index) const |
| reference | at (size_type index) |
| const_reference | front () const |
| reference | front () |
| const_reference | back () const |
| reference | back () |
| const_iterator | cbegin () const |
| const_iterator | begin () const |
| iterator | begin () |
| const_iterator | cend () const |
| const_iterator | end () const |
| iterator | end () |
| const_reference | operator[] (size_type index) const |
| reference | operator[] (size_type index) |
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
| 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.
| 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
|
private |
|
private |
|
private |
|
private |