![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Random-access iterator over the logical sequence stored in a sringbuffer. More...
#include <sringbuffer.h>
Public Types | |
| using | value_type = T |
| Element value type. | |
| using | pointer = T * |
| Pointer to an element. | |
| using | reference = T & |
| Reference to an element. | |
| using | difference_type = sringbuffer_detail::difference_type |
| Type used for iterator distances. | |
| using | size_type = sringbuffer_detail::size_type |
| Type used for indices and offsets. | |
| using | iterator = sringbuffer_iterator |
| Iterator type. | |
| using | iterator_category = core::random_access_iterator_tag |
| Iterator category tag. | |
Public Member Functions | |
| sringbuffer_iterator (pointer ptr, sringbuffer_detail::size_type tail, sringbuffer_detail::size_type size, sringbuffer_detail::size_type index) | |
| Constructs an iterator over a ring-buffer sequence. | |
| T & | operator* () const |
| Dereferences the current logical element. | |
| T * | operator-> () const |
| Accesses the current logical element. | |
| iterator | operator[] (size_type offset) const |
| Accesses storage at a logical offset using the declared iterator result type. | |
| iterator & | operator+= (size_type diff) |
| Advances by a logical offset. | |
| iterator & | operator-= (size_type diff) |
| Moves backward by a logical offset. | |
| iterator & | operator++ () |
| Advances by one logical position. | |
| iterator | operator++ (int) |
| Advances by one logical position. | |
| iterator & | operator-- () |
| Moves backward by one logical position. | |
| iterator | operator-- (int) |
| Moves backward by one logical position. | |
| iterator | operator+ (size_type offset) const |
| Returns an iterator advanced by an offset. | |
| iterator | operator- (size_type offset) const |
| Returns an iterator moved backward by an offset. | |
| difference_type | operator- (const iterator &other) const |
| Calculates the logical distance between iterators from the same buffer. | |
| GAIA_NODISCARD bool | operator== (const iterator &other) const |
| Compares logical iterator positions. | |
| GAIA_NODISCARD bool | operator!= (const iterator &other) const |
| Compares logical iterator positions. | |
| GAIA_NODISCARD bool | operator> (const iterator &other) const |
| Compares logical iterator positions. | |
| GAIA_NODISCARD bool | operator>= (const iterator &other) const |
| Compares logical iterator positions. | |
| GAIA_NODISCARD bool | operator< (const iterator &other) const |
| Compares logical iterator positions. | |
| GAIA_NODISCARD bool | operator<= (const iterator &other) const |
| Compares logical iterator positions. | |
Random-access iterator over the logical sequence stored in a sringbuffer.
| T | Element type, optionally const-qualified. |
| N | Ring-buffer capacity. |
|
inline |
Constructs an iterator over a ring-buffer sequence.
| ptr | Address of the physical buffer. |
| tail | Physical index of the logical front element. |
| size | Number of live elements in the buffer. |
| index | Logical iterator index in the range [0, size]. |
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Dereferences the current logical element.
|
inline |
Returns an iterator advanced by an offset.
| offset | Number of logical positions to advance. |
|
inline |
Advances by one logical position.
|
inline |
Advances by one logical position.
|
inline |
Advances by a logical offset.
| diff | Number of positions to advance. |
|
inline |
Calculates the logical distance between iterators from the same buffer.
| other | Iterator to subtract. |
|
inline |
Returns an iterator moved backward by an offset.
| offset | Number of logical positions to move backward. |
|
inline |
Moves backward by one logical position.
|
inline |
Moves backward by one logical position.
|
inline |
Moves backward by a logical offset.
| diff | Number of positions to move backward. |
|
inline |
Accesses the current logical element.
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Compares logical iterator positions.
| other | Iterator from the same buffer. |
|
inline |
Accesses storage at a logical offset using the declared iterator result type.
| offset | Logical offset from the current index. |