ArrayDef.h file
This module provides macro definitions for implementing and working with CnxArray(T, N)
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Defines
- #define CnxArray(T, N)
- Macro alias for a
CnxArray(T, N)containing up toNTs. - #define CnxArrayIterator(T, N)
- macro alias for the concrete type for an iterator into the mutable iteration of a
CnxArray(T, N)containing up toNTs - #define CnxArrayConstIterator(T, N)
- macro alias for the concrete type for an iterator into the const iteration of a
CnxArray(T, N)containing up toNTs - #define CnxArrayIdentifier(T, N, Identifier)
- macro alias for an identifier (type, function, etc) associated with a
CnxArray(T, N)containing up toNTs - #define cnx_array_new(T, N)
- Creates a new
CnxArray(T, N)with defaulted associated functions. - #define cnx_array_new_with_allocator(T, N, allocator)
- Creates a new
CnxArray(T, N)with defaulted associated functions. - #define cnx_array_new_with_collection_data(T, N, collection_data_ptr)
- Creates a new
CnxArray(T, N)with provided associated functions. - #define cnx_array_new_with_allocator_and_collection_data(T, N, allocator, collection_data_ptr)
- Creates a new
CnxArray(T, N)with provided associated functions. - #define cnx_array_clone(self)
- Clones the given
CnxArray(T, N) - #define cnx_array_at_mut(self, index)
- Returns a mutable reference to the element at the given
indexinto the givenCnxArray(T, N) - #define cnx_array_at(self, index)
- Returns a const reference to the element at the given
indexinto the givenCnxArray(T, N) - #define cnx_array_front_mut(self)
- Returns a mutable reference to the first element in the given
CnxArray(T, N) - #define cnx_array_front(self)
- Returns a const reference to the first element in the given
CnxArray(T, N) - #define cnx_array_back_mut(self)
- Returns a mutable reference to the last element in the given
CnxArray(T, N) - #define cnx_array_back(self)
- Returns a const reference to the last element in the given
CnxArray(T, N) - #define cnx_array_data_mut(self)
- Returns a mutable reference to the internal array in the given
CnxArray(T, N) - #define cnx_array_data(self)
- Returns a const reference to the internal array in the given
CnxArray(T, N) - #define cnx_array_is_empty(self)
- Returns whether the given
CnxArray(T, N)is empty. - #define cnx_array_is_full(self)
- Returns whether the given
CnxArray(T, N)is full. - #define cnx_array_size(self)
- Returns the current size of the given
CnxArray(T, N) - #define cnx_array_capacity(self)
- Returns the capacity of the given
CnxArray(T, N)(ie theN) - #define cnx_array_resize(self, new_size)
- Resizes the given
CnxArray(T, N)tonew_size - #define cnx_array_clear(self)
- Resets the given
CnxArray(T, N)to a size of zero, destroying any active elements in the array. - #define cnx_array_push_back(self, element)
- Pushes a new element into the given
CnxArray(T, N), at the end. - #define cnx_array_pop_back(self)
- Removes the last element from the given
CnxArray(T, N)and returns it. - #define cnx_array_insert(self, element, index)
- Inserts the given element at the given index in the
CnxArray(T, N) - #define cnx_array_erase(self, index)
- Erases the element at
indexfrom theCnxArray(T, N) - #define cnx_array_erase_n(self, index, num_elements)
- Erases
num_elementselements from theCnxArray(T, N), starting atindex - #define cnx_array_free(self)
- Frees the given
CnxArray(T, N), destroying its elements. - #define cnx_array_begin(self)
- Returns a
CnxRandomAccessIteratorinto the mutable iteration of the givenCnxArray(T, N), starting at the beginning of the iteration (pointing at the beginning of the array) - #define cnx_array_end(self)
- Returns a
CnxRandomAccessIteratorinto the mutable iteration of the givenCnxArray(T, N), starting at the end of the iteration (pointing at the end of the array) - #define cnx_array_rbegin(self)
- Returns a
CnxRandomAccessIteratorinto the mutable iteration of the givenCnxArray(T, N), starting at the beginning of the reversed iteration (pointing at the end of the array) - #define cnx_array_rend(self)
- Returns a
CnxRandomAccessIteratorinto the mutable iteration of the givenCnxArray(T, N), starting at the end of the reversed iteration (pointing at the beginning of the array) - #define cnx_array_iterator_equals(first, second)
- Returns whether the given pair of iterators are equal (they belong to the same collection and point to the same element), IE: if
first == second - #define cnx_array_cbegin(self)
- Returns a
CnxRandomAccessIteratorinto the const iteration of the givenCnxArray(T, N), starting at the beginning of the iteration (pointing at the beginning of the array) - #define cnx_array_cend(self)
- Returns a
CnxRandomAccessIteratorinto the const iteration of the givenCnxArray(T, N), starting at the end of the iteration (pointing at the end of the array) - #define cnx_array_crbegin(self)
- Returns a
CnxRandomAccessIteratorinto the const iteration of the givenCnxArray(T, N), starting at the beginning of the reversed iteration (pointing at the end of the array) - #define cnx_array_crend(self)
- Returns a
CnxRandomAccessIteratorinto the const iteration of the givenCnxArray(T, N), starting at the end of the reversed iteration (pointing at the beginning of the array) - #define cnx_array_const_iterator_equals(first, second)
- Returns whether the given pair of const iterators are equal (they belong to the same collection and point to the same element), IE: if
first == second - #define cnx_array_into_iter(self)
- Returns a
CnxRandomAccessIteratorinto the mutable iteration of the givenCnxArray(T, N) - #define cnx_array_into_reverse_iter(self)
- Returns a
CnxRandomAccessIteratorinto the mutable reversed iteration of the givenCnxArray(T, N) - #define cnx_array_into_const_iter(self)
- Returns a
CnxRandomAccessIteratorinto the const iteration of the givenCnxArray(T, N) - #define cnx_array_into_reverse_const_iter(self)
- Returns a
CnxRandomAccessIteratorinto the const reversed iteration of the givenCnxArray(T, N) - #define CnxScopedArray(T, N)
- declare a
CnxArray(T, N)variable with this attribute to havecnx_array_freeautomatically called on it at scope end
Define documentation
#define cnx_array_into_iter(self)
Returns a CnxRandomAccessIterator into the mutable iteration of the given CnxArray(T, N)
| Parameters | |
|---|---|
| self | - The CnxArray(T, N) to get an iterator to |
| Returns | a random access iterator into the array |
#define cnx_array_into_reverse_iter(self)
Returns a CnxRandomAccessIterator into the mutable reversed iteration of the given CnxArray(T, N)
| Parameters | |
|---|---|
| self | - The CnxArray(T, N) to get an iterator to |
| Returns | a random access iterator into the reversed array |
#define cnx_array_into_const_iter(self)
Returns a CnxRandomAccessIterator into the const iteration of the given CnxArray(T, N)
| Parameters | |
|---|---|
| self | - The CnxArray(T, N) to get an iterator to |
| Returns | a random access iterator into the array |
#define cnx_array_into_reverse_const_iter(self)
Returns a CnxRandomAccessIterator into the const reversed iteration of the given CnxArray(T, N)
| Parameters | |
|---|---|
| self | - The CnxArray(T, N) to get an iterator to |
| Returns | a random access iterator into the reversed array |