Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A re-sizable array-like ADT. A subset of the STL Vector interface. More...
#include <Vector.h>
Inherits gts::AlignedAllocator< GTS_NO_SHARING_CACHE_LINE_SIZE >.
Public Types | |
using | size_type = size_t |
using | value_type = T |
using | allocator_type = TAllocator |
Public Member Functions | |
~Vector () | |
Destructs the container. The destructors of the elements are called and the used storage is deallocated. | |
Vector (const allocator_type &allocator=allocator_type()) | |
Constructs an empty container with the given 'allocator'. | |
Vector (size_type count, const allocator_type &allocator=allocator_type()) | |
Constructs the container with 'count' copies of default constructed values. | |
Vector (size_type count, value_type const &fill, const allocator_type &alloc=allocator_type()) | |
Constructs the container with 'count' copies of elements with value 'fill'. | |
Vector (std::initializer_list< value_type > initList, const allocator_type &alloc=allocator_type()) | |
Constructs the container with an InitializerList. | |
Vector (Vector const &other) | |
Copy constructor. Constructs the container with the copy of the contents of 'other'. | |
Vector (Vector &&other) | |
Move constructor. Constructs the container with the contents of other using move semantics. After the move, other is invalid. | |
Vector & | operator= (Vector const &other) |
Copy assignment operator. Replaces the contents with a copy of the contents of 'other'. | |
Vector & | operator= (Vector &&other) |
Move assignment operator. Replaces the contents with those of other using move semantics. After the move, other is invalid. | |
bool | empty () const |
Checks if the contains has no elements. More... | |
size_type | size () const |
Gets the number of elements in the container. More... | |
size_type | capacity () const |
Gets the number of elements that can be held in the currently allocated storage. More... | |
value_type const * | begin () const |
Gets a pointer to the first element;. More... | |
value_type * | begin () |
Gets a pointer to the first element;. More... | |
value_type const * | end () const |
Gets a pointer to one past the last element;. More... | |
value_type * | end () |
Gets a pointer to one past the last element;. More... | |
value_type const & | front () const |
Gets the first element. More... | |
value_type & | front () |
Gets the first element. More... | |
value_type const & | back () const |
Gets the last element. More... | |
value_type & | back () |
Gets the last element. More... | |
value_type const & | operator[] (size_type pos) const |
Gets the element at pos. More... | |
value_type & | operator[] (size_type pos) |
Gets the element at pos. More... | |
value_type const * | data () const |
A pointer to the underlying storage array. More... | |
value_type * | data () |
A pointer to the underlying storage array. More... | |
allocator_type | get_allocator () const |
Get this Vectors allocator. More... | |
void | push_back (value_type const &val) |
void | push_back (value_type &&val) |
template<typename... TArgs> | |
void | emplace_back (TArgs &&... args) |
void | pop_back () |
void | resize (size_type count) |
void | resize (size_type count, value_type const &fill) |
void | reserve (size_type count) |
void | shrink_to_fit () |
void | clear () |
template<typename... TArgs> | |
void | emplace_back (TArgs &&... args) |
template<typename... TArgs> | |
void | _init (size_type count, TArgs &&... args) |
A re-sizable array-like ADT. A subset of the STL Vector interface.
T | The element type stored in the container. |
TAllocator | The allocator used by the storage backing. |
T & Vector::back | ( | ) |
Gets the last element.
T const & Vector::back | ( | ) | const |
Gets the last element.
T * Vector::begin | ( | ) |
Gets a pointer to the first element;.
T const * Vector::begin | ( | ) | const |
Gets a pointer to the first element;.
Vector< T, TAllocator >::size_type Vector::capacity | ( | ) | const |
Gets the number of elements that can be held in the currently allocated storage.
void Vector::clear | ( | ) |
Removes all elements but does not destroy the underlying array.
T * Vector::data | ( | ) |
A pointer to the underlying storage array.
T const * Vector::data | ( | ) | const |
A pointer to the underlying storage array.
void gts::Vector< T, TAllocator >::emplace_back | ( | TArgs &&... | args | ) |
Construct a new element at the end.
bool Vector::empty | ( | ) | const |
Checks if the contains has no elements.
T * Vector::end | ( | ) |
Gets a pointer to one past the last element;.
T const * Vector::end | ( | ) | const |
Gets a pointer to one past the last element;.
T & Vector::front | ( | ) |
Gets the first element.
T const & Vector::front | ( | ) | const |
Gets the first element.
Vector< T, TAllocator >::allocator_type Vector::get_allocator | ( | ) | const |
Get this Vectors allocator.
T & Vector::operator[] | ( | size_type | pos | ) |
Gets the element at pos.
T const & Vector::operator[] | ( | size_type | pos | ) | const |
Gets the element at pos.
void Vector::pop_back | ( | ) |
Removes and destroys the element at the end.
void gts::Vector< T, TAllocator >::push_back | ( | value_type && | val | ) |
Moves 'val' to the end.
void gts::Vector< T, TAllocator >::push_back | ( | value_type const & | val | ) |
Copies 'val' to the end.
void Vector::reserve | ( | size_type | count | ) |
Grow the underlying array if count > capacity, otherwise it does nothing.
void Vector::resize | ( | size_type | count | ) |
Resize the vector to have 'count' elements. If count > size(), new will be default constructed.
void gts::Vector< T, TAllocator >::resize | ( | size_type | count, |
value_type const & | fill | ||
) |
Resize the vector to have 'count' elements. If count > size(), new will be constructed with the value of 'fill'.
void Vector::shrink_to_fit | ( | ) |
Resize the array to size().
Vector< T, TAllocator >::size_type Vector::size | ( | ) | const |
Gets the number of elements in the container.