|
Bifrost SDK
Bifrost SDK documentation
|
Define a Amino array of elements of type T.
More...
#include <Array.h>
Public Types | |
| using | value_type = typename BaseClass::value_type |
The type of the value being stored in the array. Equivalent to T. More... | |
| using | pointer = typename BaseClass::pointer |
Type to represent a mutable pointer to an array element value. Equivalent to value_type*. More... | |
| using | const_pointer = typename BaseClass::const_pointer |
Type to represent a constant pointer to an array element value. Equivalent to value_type const*. More... | |
| using | reference = typename BaseClass::reference |
Type to represent a mutable reference to an array element value. Equivalent to value_type&. More... | |
| using | const_reference = typename BaseClass::const_reference |
Type to represent a constant reference to an array element value. Equivalent to value_type const&. More... | |
| using | difference_type = typename BaseClass::difference_type |
A signed integral type. Usually the same as ptrdiff_t. More... | |
| using | size_type = typename BaseClass::size_type |
An unsigned integral that can represent any non-negative value of difference_type. Usually the same as size_t. More... | |
| using | iterator = typename BaseClass::iterator |
Type representing a random-access iterator to a value_type. More... | |
| using | const_iterator = typename BaseClass::const_iterator |
Type representing a random-access iterator to a const value_type. More... | |
Public Member Functions | |
| Array () | |
| Construct an empty array. More... | |
| Array (size_type n) | |
Construct an array with n default initialized elements. More... | |
| Array (size_type n, const value_type &value) | |
Construct an array with n elements of value value. More... | |
| template<class InputIterator , typename = enable_if_input_iterator_t<InputIterator>> | |
| Array (InputIterator first, InputIterator last) | |
Construct an array with the values in the range [first,last), in the same order. More... | |
| Array (std::initializer_list< value_type > init) | |
| Construct an array with the contents of the initializer_list. More... | |
| Array (const Array< T > &other)=default | |
| Copy constructor. More... | |
| Array (Array< T > &&other) noexcept=default | |
| Move constructor. More... | |
| ~Array ()=default | |
| Destroys the array. This calls the destructor for each element, and releases all the storage allocated by the array. More... | |
| Array< T > & | operator= (const Array< T > &other)=default |
| Copy assignment operator. More... | |
| Array< T > & | operator= (Array< T > &&other) noexcept=default |
| Move assignment operator. More... | |
| Array< T > & | operator= (std::initializer_list< value_type > init) |
Copy all the elements from init into the current array. More... | |
| void | assign (size_type count, const value_type &value) |
Replaces the contents of the container with count copies of value value. More... | |
| template<class InputIterator , typename = enable_if_input_iterator_t<InputIterator>> | |
| void | assign (InputIterator first, InputIterator last) |
Replaces the contents of the container with copies of those in the range [first,last). More... | |
| void | assign (std::initializer_list< T > init) |
Replaces the contents of the container with the elements from the initializer list init. More... | |
| bool | empty () const noexcept |
Check whether the array is empty (size() == 0). More... | |
| size_type | size () const noexcept |
| Get the number of elements in the array. More... | |
| size_type | max_size () const |
| Return the maximum number of elements the array is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest possible container. More... | |
| void | reserve (size_type new_capacity) |
| Increase the capacity of the array to a value that's greater or equal to new_capacity. More... | |
| size_type | capacity () const noexcept |
| Get the number of elements that the container has currently allocated space for. More... | |
| void | shrink_to_fit () noexcept |
| Requests the removal of unused capacity. More... | |
| void | clear () noexcept |
| Removes all elements from the container. More... | |
| iterator | insert (const_iterator pos, size_type count, const value_type &value) |
| Inserts count copies of the value before pos. More... | |
| template<class InputIterator , typename = enable_if_input_iterator_t<InputIterator>> | |
| iterator | insert (const_iterator pos, InputIterator first, InputIterator last) |
Inserts elements from range [first,last) before pos. More... | |
| iterator | insert (const_iterator pos, std::initializer_list< value_type > init) |
| inserts elements from initializer list init before pos. More... | |
| iterator | erase (const_iterator pos) |
| Removes the element at pos from the container. More... | |
| iterator | erase (const_iterator first, const_iterator last) |
Removes the elements in the range [first,last) from the container. More... | |
| template<typename... Args, typename = enable_if_constructible_t<Args...>> | |
| void | emplace_back (Args &&... args) |
| Appends an element constructed from the given arguments to the end of the container. More... | |
| void | pop_back () |
| Removes the last element of the container. More... | |
| void | resize (size_type count) |
Resizes the container to contain count elements. More... | |
| void | resize (size_type count, const value_type &value) |
Resizes the container to contain count elements. More... | |
| void | swap (Array &other) noexcept |
| Exchange the content of the array by the content of other, which is another array object containing elements of the same type. More... | |
| reference | at (size_type n) |
Get a reference to the element at position n in the array. More... | |
| const_reference | at (size_type n) const |
Get a reference to the element at position n in the array. More... | |
| reference | operator[] (size_type n) |
Get a reference to the element at position n in the array. More... | |
| const_reference | operator[] (size_type n) const |
Get a reference to the element at position n in the array. More... | |
| reference | front () |
| Get a reference to the first element in the array. More... | |
| const_reference | front () const |
| Get a reference to the first element in the array. More... | |
| reference | back () |
| Get a reference to the last element in the array. More... | |
| const_reference | back () const |
| Get a reference to the last element in the array. More... | |
| pointer | data () noexcept |
| Get a pointer to the underlying storage of the array. More... | |
| const_pointer | data () const noexcept |
| Get a pointer to the underlying storage of the array. More... | |
| iterator | begin () noexcept |
| Get a iterator pointing to the first element in the array. More... | |
| const_iterator | begin () const noexcept |
| Get a iterator pointing to the first element in the array. More... | |
| const_iterator | cbegin () const noexcept |
| Get a iterator pointing to the first element in the array. More... | |
| iterator | end () noexcept |
| Get a iterator pointing to the element just past the last element in the array (past-the-end element). More... | |
| const_iterator | end () const noexcept |
| Get a iterator pointing to the element just past the last element in the array (past-the-end element). More... | |
| const_iterator | cend () const noexcept |
| Get a iterator pointing to the element just past the last element in the array (past-the-end element). More... | |
| iterator | insert (const_iterator pos, const value_type &value) |
| Inserts value before pos. More... | |
| iterator | insert (const_iterator pos, value_type &&value) |
| Inserts value before pos. More... | |
| void | push_back (const value_type &value) |
| Appends the given element value to the end of the container. More... | |
| void | push_back (value_type &&value) |
| Appends the given element value to the end of the container. More... | |
Define a Amino array of elements of type T.
Amino Arrays are resizable containers of contiguous elements.
Amino Arrays of any Amino-known types can be used in Amino graphs, but they must always be memory managed by Amino::Ptr. If the element type is itself an Array or a custom user class, it must also be managed by an Amino::Ptr.
| T | The type of the elements. |
| using Amino::Array< T >::const_iterator = typename BaseClass::const_iterator |
| using Amino::Array< T >::const_pointer = typename BaseClass::const_pointer |
| using Amino::Array< T >::const_reference = typename BaseClass::const_reference |
| using Amino::Array< T >::difference_type = typename BaseClass::difference_type |
| using Amino::Array< T >::iterator = typename BaseClass::iterator |
| using Amino::Array< T >::pointer = typename BaseClass::pointer |
| using Amino::Array< T >::reference = typename BaseClass::reference |
| using Amino::Array< T >::size_type = typename BaseClass::size_type |
| using Amino::Array< T >::value_type = typename BaseClass::value_type |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
Construct an array with the values in the range [first,last), in the same order.
The range used is [first,last), which includes all the elements between first and last, including the element pointed by first, but not the element pointed by last.
| InputIterator | Input iterator type. |
| first | Input iterator to the first position in the range. |
| last | Input iterator to the last position in the range. |
|
inline |
|
default |
Copy constructor.
Construct a new array containing a copy of the elements in other, in the same order.
| other | An array of the same type whose elements are to be copied. |
|
defaultnoexcept |
Move constructor.
Construct a new array taking ownership of the elements in other.
| other | An array of the same type whose elements are to be copied. |
|
default |
Destroys the array. This calls the destructor for each element, and releases all the storage allocated by the array.
|
inline |
Replaces the contents of the container with copies of those in the range [first,last).
*this = Array<T>(first, last) except that the already allocated memory by *this may be reused if its capacity is large enough to hold std::distance(first, last) elements.| first | iterator to first element to copy |
| last | end iterator of range to copy |
|
inline |
Replaces the contents of the container with count copies of value value.
*this = Array<T>(count, value) except that the already allocated memory by *this may be reused if its capacity is large enough to hold count elements.| count | the new size of the container. |
| value | the value to initialize elements of the container with. |
|
inline |
Replaces the contents of the container with the elements from the initializer list init.
*this = Array<T>(init) except that the already allocated memory by *this may be reused if its capacity is large enough to hold std::distance(first, last) elements.| init | initializer list to copy the values from |
|
inline |
Get a reference to the element at position n in the array.
n >= size(). That's because Amino::Array does not throw any exceptions, so it asserts instead.n < size()| n | The index of the element in the array. |
n in the array.
|
inline |
Get a reference to the element at position n in the array.
n >= size(). That's because Amino::Array does not throw any exceptions, so it asserts instead.n < size()| n | The index of the element in the array. |
n in the array.
|
inline |
Get a reference to the last element in the array.
Unlike end(), which returns an iterator just past the last element in the array, this function returns a direct reference to the last element.
!empty()
|
inline |
Get a reference to the last element in the array.
Unlike end(), which returns an iterator just past the last element in the array, this function returns a direct reference to the last element.
!empty()
|
inlinenoexcept |
Get a iterator pointing to the first element in the array.
Unlike front(), which returns a direct reference to the first element in the array, this function returns a random-access iterator pointing to the first element. If the array is empty, the returned iterator is the same as end().
|
inlinenoexcept |
Get a iterator pointing to the first element in the array.
Unlike front(), which returns a direct reference to the first element in the array, this function returns a random-access iterator pointing to the first element. If the array is empty, the returned iterator is the same as end().
|
inlinenoexcept |
|
inlinenoexcept |
Get a iterator pointing to the first element in the array.
Unlike front(), which returns a direct reference to the first element in the array, this function returns a random-access iterator pointing to the first element. If the array is empty, the returned iterator is the same as end().
|
inlinenoexcept |
Get a iterator pointing to the element just past the last element in the array (past-the-end element).
Unlike back(), which returns a reference to the last element in the array, this function returns a random-access iterator pointing past the last element. This iterator does not point to any valid element, and therefore should not be dereferenced. If the array is empty, the returned iterator is the same as begin().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Get a iterator pointing to the element just past the last element in the array (past-the-end element).
Unlike back(), which returns a reference to the last element in the array, this function returns a random-access iterator pointing past the last element. This iterator does not point to any valid element, and therefore should not be dereferenced. If the array is empty, the returned iterator is the same as begin().
|
inlinenoexcept |
Get a iterator pointing to the element just past the last element in the array (past-the-end element).
Unlike back(), which returns a reference to the last element in the array, this function returns a random-access iterator pointing past the last element. This iterator does not point to any valid element, and therefore should not be dereferenced. If the array is empty, the returned iterator is the same as begin().
|
inline |
Removes the elements in the range [first,last) from the container.
| first | beginning of range to remove |
| last | end of range to remove |
|
inline |
Removes the element at pos from the container.
| pos | iterator to the element to remove. Must be valid and dereferenceable |
|
inline |
Get a reference to the first element in the array.
Unlike begin(), which returns an iterator to the first element in the array, this function returns a direct reference to the first element.
!empty()
|
inline |
Get a reference to the first element in the array.
Unlike begin(), which returns an iterator to the first element in the array, this function returns a direct reference to the first element.
!empty()
|
inline |
|
inline |
Inserts elements from range [first,last) before pos.
| pos | iterator before which the content will be inserted. pos may be the end() iterator |
| first | iterator to first element to insert |
| last | end iterator of range to insert |
(begin() <= pos && pos <= end()) !(begin() <= first && first <= end()) !(begin() <= last && last <= end())
|
inline |
Inserts count copies of the value before pos.
| pos | iterator before which the content will be inserted. pos may be the end() iterator |
| count | number of copies to make |
| value | element value to copy |
|
inline |
inserts elements from initializer list init before pos.
| pos | iterator before which the content will be inserted. pos may be the end() iterator |
| init | initializer list to insert the values from |
|
inline |
|
inline |
Return the maximum number of elements the array is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest possible container.
|
defaultnoexcept |
Move assignment operator.
Take ownership of all the elements of other into the current array. Any elements held in the current array before this call are destroyed.
| other | An array of the same type. |
|
default |
Copy assignment operator.
Copy all the elements from other into the current array. Any elements held in the current array before this call are destroyed.
| other | An array of the same type. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Increase the capacity of the array to a value that's greater or equal to new_capacity.
If new_capacity is greater than the current capacity(), new storage is allocated and elements are moved the that new storage, otherwise the method does nothing.
| new_capacity | The new capacity of the array. |
|
inline |
Resizes the container to contain count elements.
If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, additional default elements are appended.
size() == count| count | new size of the container. |
|
inline |
Resizes the container to contain count elements.
If the current size is greater than count, the container is reduced to its first count elements. If the current size is less than count, additional copies of value are appended.
size() == count| count | new size of the container. |
| value | the value to initialize the new elements with. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Exchange the content of the array by the content of other, which is another array object containing elements of the same type.
Array sizes can be different.
After a call to this function, the elements in this array are those which were in other before the call, and the elements of other are those which were in this array. All iterators, references and pointers remain valid for the swapped arrays.
| other | An array of the same type the swap with. |
Definition at line 608 of file Array.h.
References Amino::swap().