Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::ecs::ZipView< Containers >::Iterator Class Reference

The actual iterator performing the intersection logic. More...

#include <ZipView.hpp>

Collaboration diagram for rtp::ecs::ZipView< Containers >::Iterator:

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = std::tuple< typename std::remove_reference_t< Containers >::value_type &... >
 
using difference_type = std::ptrdiff_t
 
using pointer = void
 
using reference = value_type
 

Public Member Functions

 Iterator (tuple_arrays_t &arrays, std::span< const Entity > entities, size_t index)
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
bool operator== (const Iterator &other) const
 
bool operator!= (const Iterator &other) const
 
reference operator* ()
 

Private Member Functions

void skipInvalid ()
 Skip to the next valid entity that has all components.
 

Private Attributes

tuple_arrays_t_arrays
 Tuple of references to SparseArrays.
 
std::span< const Entity_entities
 Entities of the leader SparseArray.
 
size_t _index
 Current index in the entity list.
 

Detailed Description

template<class... Containers>
class rtp::ecs::ZipView< Containers >::Iterator

The actual iterator performing the intersection logic.

Definition at line 37 of file ZipView.hpp.

Member Typedef Documentation

◆ difference_type

template<class... Containers>
using rtp::ecs::ZipView< Containers >::Iterator::difference_type = std::ptrdiff_t

Definition at line 41 of file ZipView.hpp.

◆ iterator_category

template<class... Containers>
using rtp::ecs::ZipView< Containers >::Iterator::iterator_category = std::forward_iterator_tag

Definition at line 39 of file ZipView.hpp.

◆ pointer

template<class... Containers>
using rtp::ecs::ZipView< Containers >::Iterator::pointer = void

Definition at line 42 of file ZipView.hpp.

◆ reference

template<class... Containers>
using rtp::ecs::ZipView< Containers >::Iterator::reference = value_type

Definition at line 43 of file ZipView.hpp.

◆ value_type

template<class... Containers>
using rtp::ecs::ZipView< Containers >::Iterator::value_type = std::tuple<typename std::remove_reference_t<Containers>::value_type&...>

Definition at line 40 of file ZipView.hpp.

Constructor & Destructor Documentation

◆ Iterator()

template<class... Containers>
rtp::ecs::ZipView< Containers >::Iterator::Iterator ( tuple_arrays_t arrays,
std::span< const Entity entities,
size_t  index 
)
inline

Member Function Documentation

◆ operator!=()

template<class... Containers>
bool rtp::ecs::ZipView< Containers >::Iterator::operator!= ( const Iterator other) const
inline

Definition at line 69 of file ZipView.hpp.

References rtp::ecs::ZipView< Containers >::Iterator::_index.

◆ operator*()

template<class... Containers>
reference rtp::ecs::ZipView< Containers >::Iterator::operator* ( )
inline

◆ operator++() [1/2]

template<class... Containers>
Iterator & rtp::ecs::ZipView< Containers >::Iterator::operator++ ( )
inline

◆ operator++() [2/2]

template<class... Containers>
Iterator rtp::ecs::ZipView< Containers >::Iterator::operator++ ( int  )
inline

Definition at line 59 of file ZipView.hpp.

◆ operator==()

template<class... Containers>
bool rtp::ecs::ZipView< Containers >::Iterator::operator== ( const Iterator other) const
inline

Definition at line 65 of file ZipView.hpp.

References rtp::ecs::ZipView< Containers >::Iterator::_index.

◆ skipInvalid()

template<class... Containers>
void rtp::ecs::ZipView< Containers >::Iterator::skipInvalid ( )
inlineprivate

Member Data Documentation

◆ _arrays

template<class... Containers>
tuple_arrays_t& rtp::ecs::ZipView< Containers >::Iterator::_arrays
private

Tuple of references to SparseArrays.

Definition at line 82 of file ZipView.hpp.

Referenced by rtp::ecs::ZipView< Containers >::Iterator::operator*(), and rtp::ecs::ZipView< Containers >::Iterator::skipInvalid().

◆ _entities

template<class... Containers>
std::span<const Entity> rtp::ecs::ZipView< Containers >::Iterator::_entities
private

◆ _index


The documentation for this class was generated from the following file: