![]() |
ToyGine2 26.2.0
Game Engine for retro consoles
|
Public Types | |
| using | value_type = type |
| Type of elements stored in the vector. | |
| using | size_type = size_t |
| Type used for vector size and capacity. | |
| using | difference_type = std::ptrdiff_t |
| Type used for pointer differences. | |
| using | reference = value_type & |
| Reference to vector element. | |
| using | const_reference = const value_type & |
| Const reference to vector element. | |
| using | pointer = type * |
| Pointer to vector element. | |
| using | const_pointer = const type * |
| Const pointer to vector element. | |
| using | iterator = value_type * |
| Iterator type for vector elements. | |
| using | const_iterator = const value_type * |
| Const iterator type for vector elements. | |
| using | reverse_iterator = std::reverse_iterator<iterator> |
| Reverse iterator type for vector elements. | |
| using | const_reverse_iterator = std::reverse_iterator<const_iterator> |
| Const reverse iterator type for vector elements. | |
Public Member Functions | |
| constexpr | FixedVector () noexcept |
| Default constructor. | |
| constexpr | ~FixedVector () noexcept |
| Destructor for the vector. | |
| FixedVector (size_type count) | |
| Constructs a FixedVector with count default-initialized elements. | |
| FixedVector (size_type count, const type &value) | |
| Constructs a FixedVector with count elements initialized to value. | |
| template<typename InputIterator> | |
| FixedVector (InputIterator first, InputIterator last) | |
| Constructs a FixedVector from a range defined by iterators. | |
| FixedVector (const FixedVector< type, allocatedSize > &other) noexcept | |
| Constructs a copy of other FixedVector. | |
| template<size_t allocatedSize2> | |
| FixedVector (const FixedVector< type, allocatedSize2 > &other) noexcept | |
| Constructs a FixedVector by copying from another FixedVector with different capacity. | |
| FixedVector (FixedVector< type, allocatedSize > &&other) noexcept | |
| Constructs a FixedVector by moving from another FixedVector. | |
| template<size_t allocatedSize2> | |
| FixedVector (FixedVector< type, allocatedSize2 > &&other) noexcept | |
| Constructs a FixedVector by moving from another FixedVector with different capacity. | |
| FixedVector (std::initializer_list< type > init) | |
| Constructs a FixedVector from an initializer list. | |
| FixedVector< type, allocatedSize > & | operator= (const FixedVector< type, allocatedSize > &other) noexcept |
| Copy assigns other FixedVector to this FixedVector. | |
| template<size_t allocatedSize2> | |
| FixedVector< type, allocatedSize > & | operator= (const FixedVector< type, allocatedSize2 > &other) noexcept |
| Copy assigns FixedVector with different capacity to this FixedVector. | |
| FixedVector< type, allocatedSize > & | operator= (FixedVector< type, allocatedSize > &&other) noexcept |
| Move assigns other FixedVector to this FixedVector. | |
| template<size_t allocatedSize2> | |
| FixedVector< type, allocatedSize > & | operator= (FixedVector< type, allocatedSize2 > &&other) noexcept |
| Move assigns FixedVector with different capacity to this FixedVector. | |
| FixedVector< type, allocatedSize > & | operator= (std::initializer_list< type > ilist) |
| Assigns initializer list to this FixedVector. | |
| void | assign (size_type count, const type &value) |
| Assigns count copies of value to the vector. | |
| template<typename InputIterator> | |
| void | assign (InputIterator first, InputIterator last) |
| Assigns elements from the range [ first, last ) to the vector. | |
| void | assign (std::initializer_list< type > ilist) |
| Assigns elements from an initializer list to the vector. | |
| constexpr reference | at (size_type pos) noexcept |
| Access an element at the specified position. | |
| constexpr const_reference | at (size_type pos) const noexcept |
| Access an element at the specified position. | |
| constexpr reference | operator[] (size_type pos) noexcept |
| Access an element at the specified position. | |
| constexpr const_reference | operator[] (size_type pos) const noexcept |
| Access an element at the specified position. | |
| constexpr reference | front () noexcept |
| Returns a reference to the first element of the vector. | |
| constexpr const_reference | front () const noexcept |
| Returns a const reference to the first element of the vector. | |
| constexpr reference | back () noexcept |
| Returns a reference to the last element of the vector. | |
| constexpr const_reference | back () const noexcept |
| Returns a const reference to the last element of the vector. | |
| constexpr pointer | data () noexcept |
| Returns a pointer to the underlying data array. | |
| constexpr const_pointer | data () const noexcept |
| Returns a const pointer to the underlying data array. | |
| constexpr iterator | begin () noexcept |
| Returns an iterator to the first element of the vector. | |
| constexpr const_iterator | begin () const noexcept |
| Returns a const iterator to the first element of the vector. | |
| constexpr const_iterator | cbegin () const noexcept |
| Returns a const iterator to the first element of the vector. | |
| constexpr iterator | end () noexcept |
| Returns an iterator to the element following the last element of the vector. | |
| constexpr const_iterator | end () const noexcept |
| Returns a const iterator to the element following the last element of the vector. | |
| constexpr const_iterator | cend () const noexcept |
| Returns a const iterator to the element following the last element of the vector. | |
| constexpr reverse_iterator | rbegin () noexcept |
| Returns a reverse iterator to the last element of the vector. | |
| constexpr const_reverse_iterator | rbegin () const noexcept |
| Returns a const reverse iterator to the last element of the vector. | |
| constexpr const_reverse_iterator | crbegin () const noexcept |
| Returns a const reverse iterator to the last element of the vector. | |
| constexpr reverse_iterator | rend () noexcept |
| Returns a reverse iterator to the element preceding the first element of the vector. | |
| constexpr const_reverse_iterator | rend () const noexcept |
| Returns a const reverse iterator to the element preceding the first element of the vector. | |
| constexpr const_reverse_iterator | crend () const noexcept |
| Returns a const reverse iterator to the element preceding the first element of the vector. | |
| constexpr bool | empty () const noexcept |
| Checks if the vector is empty. | |
| constexpr size_type | size () const noexcept |
| Returns the number of elements currently stored in the vector. | |
| constexpr size_type | max_size () const noexcept |
| Returns the maximum number of elements the vector can hold. | |
| constexpr size_type | capacity () const noexcept |
| Returns the maximum number of elements that can be stored in the vector. | |
| constexpr void | clear () noexcept |
| Removes all elements from the vector. | |
| constexpr void | push_back (const type &val) noexcept |
Private Attributes | |
| byte | _data [allocatedSize *sizeof(type)] |
| Internal buffer for storing elements. | |
| size_type | _size = 0 |
| Current number of elements in the vector. | |
| using toy::FixedVector< type, allocatedSize >::const_iterator = const value_type * |
Const iterator type for vector elements.
| using toy::FixedVector< type, allocatedSize >::const_pointer = const type * |
Const pointer to vector element.
| using toy::FixedVector< type, allocatedSize >::const_reference = const value_type & |
Const reference to vector element.
| using toy::FixedVector< type, allocatedSize >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Const reverse iterator type for vector elements.
| using toy::FixedVector< type, allocatedSize >::difference_type = std::ptrdiff_t |
Type used for pointer differences.
| using toy::FixedVector< type, allocatedSize >::iterator = value_type * |
Iterator type for vector elements.
| using toy::FixedVector< type, allocatedSize >::pointer = type * |
Pointer to vector element.
| using toy::FixedVector< type, allocatedSize >::reference = value_type & |
Reference to vector element.
| using toy::FixedVector< type, allocatedSize >::reverse_iterator = std::reverse_iterator<iterator> |
Reverse iterator type for vector elements.
| using toy::FixedVector< type, allocatedSize >::size_type = size_t |
Type used for vector size and capacity.
| using toy::FixedVector< type, allocatedSize >::value_type = type |
Type of elements stored in the vector.
|
constexprnoexcept |
Default constructor.
|
constexprnoexcept |
Destructor for the vector.
This destructor cleans up the vector.
|
inlineexplicit |
Constructs a FixedVector with count default-initialized elements.
This constructor creates a FixedVector containing count elements, each initialized with the default value of type.
| count | The number of elements to create. |
|
inline |
Constructs a FixedVector with count elements initialized to value.
This constructor creates a FixedVector containing count elements, each initialized with the specified value.
| count | The number of elements to create. |
| value | The value to initialize all elements with. |
|
inline |
Constructs a FixedVector from a range defined by iterators.
This constructor initializes a FixedVector with elements from the range [ first, last ).
| InputIterator | The type of the input iterator. Must not be an integral type. |
| first | Iterator pointing to the first element to copy. |
| last | Iterator pointing to one past the last element to copy. |
|
inlinenoexcept |
Constructs a copy of other FixedVector.
This constructor initializes a FixedVector by copying the content from another FixedVector of the same type and capacity.
| other | The source FixedVector to copy content from. |
|
inlinenoexcept |
Constructs a FixedVector by copying from another FixedVector with different capacity.
This constructor initializes a FixedVector by copying the content from another FixedVector of the same type but potentially different capacity.
| allocatedSize2 | The capacity of the source FixedVector. Must be greater than zero. |
| other | The source FixedVector to copy content from. |
|
inlinenoexcept |
Constructs a FixedVector by moving from another FixedVector.
This constructor initializes a FixedVector by moving the content from another FixedVector of the same type and capacity. The source vector is left in a valid but unspecified state.
| other | The source FixedVector to move content from. |
|
inlinenoexcept |
Constructs a FixedVector by moving from another FixedVector with different capacity.
This constructor initializes a FixedVector by moving the content from another FixedVector of the same type but potentially different capacity. The source vector is left in a valid but unspecified state.
| allocatedSize2 | The capacity of the source FixedVector. Must be greater than zero. |
| other | The source FixedVector to move content from. |
|
inlineexplicit |
Constructs a FixedVector from an initializer list.
This constructor initializes a FixedVector with the elements from the provided initializer list.
| init | The initializer list containing the elements to initialize the vector with. |
|
inline |
Assigns elements from the range [ first, last ) to the vector.
This method replaces the current contents of the vector with elements from the range [ first, last ).
| InputIterator | The type of the input iterator. Must not be an integral type. |
| first | Iterator pointing to the first element to assign. |
| last | Iterator pointing to one past the last element to assign. |
|
inline |
Assigns count copies of value to the vector.
This method replaces the current contents of the vector with count copies of value.
| count | The number of copies of value to assign. |
| value | The value to assign count copies of. |
|
inline |
Assigns elements from an initializer list to the vector.
This method replaces the current contents of the vector with elements from the initializer list.
| ilist | The initializer list containing the elements to assign. |
|
nodiscardconstexprnoexcept |
Access an element at the specified position.
This method provides read-only access to an element at the specified pos.
| pos | The position of the element to access in the vector. |
|
nodiscardconstexprnoexcept |
Access an element at the specified position.
This method provides direct access to an element at the specified pos.
| pos | The position of the element to access in the vector. |
|
nodiscardconstexprnoexcept |
Returns a const reference to the last element of the vector.
This method provides read-only access to the last element of the vector.
|
nodiscardconstexprnoexcept |
Returns a reference to the last element of the vector.
This method provides direct access to the last element of the vector.
|
nodiscardconstexprnoexcept |
Returns a const iterator to the first element of the vector.
This method returns a const iterator pointing to the first element of the vector.
|
nodiscardconstexprnoexcept |
Returns an iterator to the first element of the vector.
This method returns an iterator pointing to the first element of the vector.
|
nodiscardconstexprnoexcept |
Returns the maximum number of elements that can be stored in the vector.
This method returns the maximum number of elements that the vector can store without reallocation. This value is fixed at compile time and determined by the template parameter allocatedSize.
|
nodiscardconstexprnoexcept |
Returns a const iterator to the first element of the vector.
This method returns a const iterator pointing to the first element of the vector.
|
nodiscardconstexprnoexcept |
Returns a const iterator to the element following the last element of the vector.
This method returns a const iterator pointing to the element following the last element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
constexprnoexcept |
Removes all elements from the vector.
This method destroys all elements currently stored in the vector and sets the size to zero. The vector can be reused after clearing.
0).
|
nodiscardconstexprnoexcept |
Returns a const reverse iterator to the last element of the vector.
This method returns a const reverse iterator pointing to the last element of the vector.
|
nodiscardconstexprnoexcept |
Returns a const reverse iterator to the element preceding the first element of the vector.
This method returns a const reverse iterator pointing to the element preceding the first element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
nodiscardconstexprnoexcept |
Returns a const pointer to the underlying data array.
This method provides read-only access to the underlying data storage of the vector.
|
nodiscardconstexprnoexcept |
Returns a pointer to the underlying data array.
This method provides direct access to the underlying data storage of the vector.
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
Returns a const iterator to the element following the last element of the vector.
This method returns a const iterator pointing to the element following the last element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
nodiscardconstexprnoexcept |
Returns an iterator to the element following the last element of the vector.
This method returns an iterator pointing to the element following the last element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
nodiscardconstexprnoexcept |
Returns a const reference to the first element of the vector.
This method provides read-only access to the first element of the vector.
|
nodiscardconstexprnoexcept |
Returns a reference to the first element of the vector.
This method provides direct access to the first element of the vector.
|
nodiscardconstexprnoexcept |
Returns the maximum number of elements the vector can hold.
This method returns the theoretical maximum number of elements that the vector can hold. For FixedVector, this is equal to the allocated capacity.
|
inlinenoexcept |
Copy assigns other FixedVector to this FixedVector.
This operator assigns the contents of another FixedVector with the same capacity to this vector.
| other | The FixedVector to copy content from. |
|
inlinenoexcept |
Copy assigns FixedVector with different capacity to this FixedVector.
This operator assigns the contents of another FixedVector with different capacity to this vector.
| allocatedSize2 | The capacity of the source FixedVector. |
| other | The FixedVector to copy content from. |
|
inlinenoexcept |
Move assigns other FixedVector to this FixedVector.
This operator assigns the contents of another FixedVector with the same capacity to this vector using move semantics.
| other | The FixedVector to move content from. |
|
inlinenoexcept |
Move assigns FixedVector with different capacity to this FixedVector.
This operator assigns the contents of another FixedVector with different capacity to this vector using move semantics.
| allocatedSize2 | The capacity of the source FixedVector. |
| other | The FixedVector to move content from. |
|
inline |
Assigns initializer list to this FixedVector.
This operator assigns the contents of an initializer list to this vector.
| ilist | The initializer list containing the elements to assign. |
|
nodiscardconstexprnoexcept |
Access an element at the specified position.
This operator provides read-only access to an element at the specified pos.
| pos | The position of the element to access in the vector. |
|
nodiscardconstexprnoexcept |
Access an element at the specified position.
This operator provides direct access to an element at the specified pos.
| pos | The position of the element to access in the vector. |
|
constexprnoexcept |
|
nodiscardconstexprnoexcept |
Returns a const reverse iterator to the last element of the vector.
This method returns a const reverse iterator pointing to the last element of the vector.
|
nodiscardconstexprnoexcept |
Returns a reverse iterator to the last element of the vector.
This method returns a reverse iterator pointing to the last element of the vector.
|
nodiscardconstexprnoexcept |
Returns a const reverse iterator to the element preceding the first element of the vector.
This method returns a const reverse iterator pointing to the element preceding the first element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
nodiscardconstexprnoexcept |
Returns a reverse iterator to the element preceding the first element of the vector.
This method returns a reverse iterator pointing to the element preceding the first element of the vector. This iterator acts as a placeholder and cannot be dereferenced.
|
nodiscardconstexprnoexcept |
Returns the number of elements currently stored in the vector.
This method returns the current number of elements in the vector.
0.
|
private |
Internal buffer for storing elements.
|
private |
Current number of elements in the vector.