#include <list_value.hpp>
Definition at line 199 of file list_value.hpp.
◆ const_reference
◆ list_value_reverse_iterator
◆ size_type
◆ value_type
◆ list_value() [1/2]
sparrow::list_value::list_value |
( |
| ) |
|
|
default |
Default constructor creating an empty list view.
- Postcondition
- size() returns 0
-
empty() returns true
-
All iterators are equal (begin() == end())
◆ list_value() [2/2]
Constructs list view over specified array range.
- Parameters
-
flat_array | Pointer to the flattened array containing list data |
index_begin | Starting index of the list (inclusive) |
index_end | Ending index of the list (exclusive) |
- Precondition
- flat_array must be a valid pointer to array_wrapper
-
index_begin must be <= index_end
-
index_end must be <= flat_array->size()
- Postcondition
- size() returns (index_end - index_begin)
-
List provides view over elements [index_begin, index_end)
-
Iterators are valid for traversing the specified range
◆ back()
Gets reference to the last element.
- Returns
- Const reference to the last element
- Precondition
- List must not be empty (!empty())
- Postcondition
- Returns valid reference to last element
-
Equivalent to (*this)[size() - 1]
◆ begin() [1/2]
Gets iterator to the beginning of the list.
- Returns
- Iterator pointing to the first element
- Postcondition
- Iterator is valid for list traversal
-
For empty list, equals end()
◆ begin() [2/2]
Gets const iterator to the beginning of the list.
- Returns
- Const iterator pointing to the first element
- Postcondition
- Iterator is valid for list traversal
-
For empty list, equals end()
◆ cbegin()
Gets const iterator to the beginning of the list.
- Returns
- Const iterator pointing to the first element
- Postcondition
- Iterator is valid for list traversal
-
Guarantees const iterator even for non-const list
◆ cend()
Gets const iterator to the end of the list.
- Returns
- Const iterator pointing past the last element
- Postcondition
- Iterator marks the end of the list range
-
Guarantees const iterator even for non-const list
◆ crbegin()
Gets const reverse iterator to the beginning of reversed list.
- Returns
- Const reverse iterator pointing to the last element
- Postcondition
- Iterator is valid for reverse traversal
-
Guarantees const iterator even for non-const list
◆ crend()
Gets const reverse iterator to the end of reversed list.
- Returns
- Const reverse iterator pointing before the first element
- Postcondition
- Iterator marks the end of reverse traversal
-
Guarantees const iterator even for non-const list
◆ empty()
bool sparrow::list_value::empty |
( |
| ) |
const |
|
nodiscard |
Checks if the list is empty.
- Returns
- true if list contains no elements, false otherwise
- Postcondition
- Return value equals (size() == 0)
-
Equivalent to (begin() == end())
◆ end() [1/2]
Gets iterator to the end of the list.
- Returns
- Iterator pointing past the last element
- Postcondition
- Iterator marks the end of the list range
-
Not dereferenceable
◆ end() [2/2]
Gets const iterator to the end of the list.
- Returns
- Const iterator pointing past the last element
- Postcondition
- Iterator marks the end of the list range
-
Not dereferenceable
◆ front()
Gets reference to the first element.
- Returns
- Const reference to the first element
- Precondition
- List must not be empty (!empty())
- Postcondition
- Returns valid reference to first element
-
Equivalent to (*this)[0]
◆ operator[]()
Gets element at specified position without bounds checking.
- Parameters
-
i | Index of element to access |
- Returns
- Const reference to element at position i
- Precondition
- i must be < size()
- Postcondition
- Returns valid reference to element
-
Reference remains valid while underlying array exists
◆ rbegin() [1/2]
Gets reverse iterator to the beginning of reversed list.
- Returns
- Reverse iterator pointing to the last element
- Postcondition
- Iterator is valid for reverse traversal
-
For empty list, equals rend()
◆ rbegin() [2/2]
Gets const reverse iterator to the beginning of reversed list.
- Returns
- Const reverse iterator pointing to the last element
- Postcondition
- Iterator is valid for reverse traversal
-
For empty list, equals rend()
◆ rend() [1/2]
Gets reverse iterator to the end of reversed list.
- Returns
- Reverse iterator pointing before the first element
- Postcondition
- Iterator marks the end of reverse traversal
-
Not dereferenceable
◆ rend() [2/2]
Gets const reverse iterator to the end of reversed list.
- Returns
- Const reverse iterator pointing before the first element
- Postcondition
- Iterator marks the end of reverse traversal
-
Not dereferenceable
◆ size()
size_type sparrow::list_value::size |
( |
| ) |
const |
|
nodiscard |
Gets the number of elements in the list.
- Returns
- Number of elements in the list view
- Postcondition
- Returns non-negative count
-
Equals (index_end - index_begin)
The documentation for this class was generated from the following file:
- /home/runner/work/sparrow/sparrow/include/sparrow/layout/list_value.hpp