Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::ecs::MessageReaderBase< Derived, T, IterType > Class Template Reference

CRTP base class for message readers providing common functionality. More...

#include <reader.hpp>

Public Types

using value_type = typename IterType::value_type
using size_type = MessageManager::size_type
using iterator = IterType
using const_iterator = IterType

Public Member Functions

constexpr MessageReaderBase () noexcept=default
 MessageReaderBase (const MessageReaderBase &)=delete
constexpr MessageReaderBase (MessageReaderBase &&) noexcept=default
constexpr ~MessageReaderBase () noexcept=default
MessageReaderBaseoperator= (const MessageReaderBase &)=delete
constexpr MessageReaderBaseoperator= (MessageReaderBase &&) noexcept=default
template<typename Action>
requires std::invocable<Action, const value_type&>
constexpr void ForEach (const Action &action) const
 Applies an action to every message (unwrapped const T&).
constexpr auto Collect () const -> std::vector< T >
 Collects all messages (previous + current) into a vector of raw T values.
template<typename Alloc>
requires std::same_as<typename std::allocator_traits<Alloc>::value_type, T>
constexpr auto CollectWith (const Alloc &alloc) const -> std::vector< T, Alloc >
 Collects all messages into a vector of raw T values using a custom allocator.
constexpr auto CollectWith (std::pmr::memory_resource *resource) const -> std::pmr::vector< T >
 Collects all messages into a vector of raw T values using a memory resource.
auto CollectWith (std::nullptr_t) const -> std::pmr::vector< T >=delete
template<typename OutIt>
requires std::output_iterator<OutIt, T>
constexpr void ReadInto (OutIt out) const
 Reads all messages into an output iterator.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr auto Filter (Pred predicate) const noexcept(noexcept(GetDerived().begin().Filter(std::move(predicate)))) -> utils::FilterAdapter< iterator, Pred >
 Returns a lazy filter adapter over the wrapped message sequence.
template<typename Func>
requires std::invocable<Func, const value_type&>
constexpr auto Map (Func transform) const noexcept(noexcept(GetDerived().begin().Map(std::move(transform)))) -> utils::MapAdapter< iterator, Func >
 Returns a lazy map adapter over the wrapped message sequence.
constexpr auto Take (size_t count) const noexcept(noexcept(GetDerived().begin().Take(count))) -> utils::TakeAdapter< iterator >
 Returns a lazy adapter yielding at most count wrappers.
constexpr auto Skip (size_t count) const noexcept(noexcept(GetDerived().begin().Skip(count))) -> utils::SkipAdapter< iterator >
 Returns a lazy adapter that skips the first count wrappers.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr auto TakeWhile (Pred predicate) const noexcept(noexcept(GetDerived().begin().TakeWhile(std::move(predicate)))) -> utils::TakeWhileAdapter< iterator, Pred >
 Returns a lazy adapter that yields wrappers while predicate is true.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr auto SkipWhile (Pred predicate) const noexcept(noexcept(GetDerived().begin().SkipWhile(std::move(predicate)))) -> utils::SkipWhileAdapter< iterator, Pred >
 Returns a lazy adapter that skips wrappers while predicate is true.
constexpr auto Enumerate () const noexcept(noexcept(GetDerived().begin().Enumerate())) -> utils::EnumerateAdapter< iterator >
 Returns a lazy adapter that pairs each wrapper with its zero-based index.
template<typename Func>
requires std::invocable<Func, const value_type&>
constexpr auto Inspect (Func inspector) const noexcept(noexcept(GetDerived().begin().Inspect(std::move(inspector)))) -> utils::InspectAdapter< iterator, Func >
 Returns a lazy adapter that calls inspector on each wrapper as a side-effect.
constexpr auto StepBy (size_t step) const noexcept(noexcept(GetDerived().begin().StepBy(step))) -> utils::StepByAdapter< iterator >
 Returns a lazy adapter that yields every step-th wrapper.
template<typename Iter>
requires utils::ChainAdapterRequirements<iterator, Iter>
constexpr auto Chain (Iter first, Iter last) const noexcept(noexcept(GetDerived().begin().Chain(std::move(first), std::move(last)))) -> utils::ChainAdapter< iterator, Iter >
 Returns a lazy adapter that chains another range of wrappers.
template<std::ranges::input_range R>
requires utils::ChainAdapterRequirements<iterator, std::ranges::iterator_t<R>>
constexpr auto Chain (const R &range) const noexcept(noexcept(GetDerived().begin().Chain(range))) -> utils::ChainAdapter< iterator, std::ranges::iterator_t< R > >
 Returns a lazy adapter that chains another range of wrappers.
constexpr auto Reverse () const noexcept(noexcept(GetDerived().begin().Reverse())) -> utils::ReverseAdapter< iterator >
 Returns a lazy adapter that yields wrappers in reverse order.
constexpr auto Slide (size_t window_size) const noexcept(noexcept(GetDerived().begin().Slide(window_size))) -> utils::SlideAdapter< iterator >
 Returns a lazy adapter that yields windows of window_size wrappers.
constexpr auto Stride (size_t stride) const noexcept(noexcept(GetDerived().begin().Stride(stride))) -> utils::StrideAdapter< iterator >
 Returns a lazy adapter that yields every stride-th wrapper.
template<typename Iter>
requires utils::ZipAdapterRequirements<iterator, Iter>
constexpr auto Zip (Iter first, Iter last) const noexcept(noexcept(GetDerived().begin().Zip(std::move(first), std::move(last)))) -> utils::ZipAdapter< iterator, Iter >
 Returns a lazy adapter that yields pairs of wrappers from two ranges.
template<typename R>
requires utils::ZipAdapterRequirements<iterator, std::ranges::iterator_t<R>>
constexpr auto Zip (const R &range) const noexcept(noexcept(GetDerived().begin().Zip(range))) -> utils::ZipAdapter< iterator, std::ranges::iterator_t< R > >
 Returns a lazy adapter that yields pairs of wrappers from two ranges.
template<typename Acc, typename Folder>
requires std::invocable<Folder, Acc, const value_type&>
constexpr Acc Fold (Acc init, const Folder &folder) const
 Left-folds all messages with an accumulator.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr auto Find (const Pred &predicate) const -> std::optional< value_type >
 Returns a pointer to the first message matching a predicate.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr size_type CountIf (const Pred &predicate) const
 Counts messages matching a predicate.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr auto Partition (const Pred &predicate) const -> std::pair< std::vector< value_type >, std::vector< value_type > >
 Partitions wrapped messages into matching and non-matching groups.
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
constexpr auto MaxBy (const KeyFunc &key_func) const -> std::optional< value_type >
 Finds the wrapped message with the maximum extracted key.
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
constexpr auto MinBy (const KeyFunc &key_func) const -> std::optional< value_type >
 Finds the wrapped message with the minimum extracted key.
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
constexpr auto GroupBy (const KeyFunc &key_func) const -> std::unordered_map< std::decay_t< std::invoke_result_t< KeyFunc, const value_type & > >, std::vector< value_type > >
 Groups wrapped messages by a key extracted from each wrapper.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr bool Any (const Pred &predicate) const
 Checks if any message matches a predicate.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr bool All (const Pred &predicate) const
 Checks if all messages match a predicate.
template<typename Pred>
requires std::predicate<Pred, const value_type&>
constexpr bool None (const Pred &predicate) const
 Checks if no messages match a predicate.
constexpr bool Empty () const noexcept
 Checks if there are no messages.
constexpr size_type Count () const noexcept
 Returns the total number of messages (previous + current).

Detailed Description

template<typename Derived, MessageTrait T, typename IterType>
class helios::ecs::MessageReaderBase< Derived, T, IterType >

CRTP base class for message readers providing common functionality.

This base class contains all reader methods except consumption methods (ConsumeAll and ConsumeIf) which are only available on ConsumableMessageReader.

Template Parameters
DerivedThe derived class (CRTP)
TMessage type
IterTypeThe iterator type for this reader

Definition at line 294 of file reader.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename Derived, MessageTrait T, typename IterType>
using helios::ecs::MessageReaderBase< Derived, T, IterType >::const_iterator = IterType

Definition at line 299 of file reader.hpp.

◆ iterator

template<typename Derived, MessageTrait T, typename IterType>
using helios::ecs::MessageReaderBase< Derived, T, IterType >::iterator = IterType

Definition at line 298 of file reader.hpp.

◆ size_type

template<typename Derived, MessageTrait T, typename IterType>
using helios::ecs::MessageReaderBase< Derived, T, IterType >::size_type = MessageManager::size_type

Definition at line 297 of file reader.hpp.

◆ value_type

template<typename Derived, MessageTrait T, typename IterType>
using helios::ecs::MessageReaderBase< Derived, T, IterType >::value_type = typename IterType::value_type

Definition at line 296 of file reader.hpp.

Constructor & Destructor Documentation

◆ MessageReaderBase() [1/3]

template<typename Derived, MessageTrait T, typename IterType>
helios::ecs::MessageReaderBase< Derived, T, IterType >::MessageReaderBase ( )
constexprdefaultnoexcept

◆ MessageReaderBase() [2/3]

template<typename Derived, MessageTrait T, typename IterType>
helios::ecs::MessageReaderBase< Derived, T, IterType >::MessageReaderBase ( const MessageReaderBase< Derived, T, IterType > & )
delete

◆ MessageReaderBase() [3/3]

template<typename Derived, MessageTrait T, typename IterType>
helios::ecs::MessageReaderBase< Derived, T, IterType >::MessageReaderBase ( MessageReaderBase< Derived, T, IterType > && )
constexprdefaultnoexcept

◆ ~MessageReaderBase()

template<typename Derived, MessageTrait T, typename IterType>
helios::ecs::MessageReaderBase< Derived, T, IterType >::~MessageReaderBase ( )
constexprdefaultnoexcept

Member Function Documentation

◆ All()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
bool helios::ecs::MessageReaderBase< Derived, T, IterType >::All ( const Pred & predicate) const
inlinenodiscardconstexpr

Checks if all messages match a predicate.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
true if all messages match (vacuously true if empty)

Definition at line 698 of file reader.hpp.

◆ Any()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
bool helios::ecs::MessageReaderBase< Derived, T, IterType >::Any ( const Pred & predicate) const
inlinenodiscardconstexpr

Checks if any message matches a predicate.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
true if at least one message matches

Definition at line 686 of file reader.hpp.

◆ Chain() [1/2]

template<typename Derived, MessageTrait T, typename IterType>
template<std::ranges::input_range R>
requires utils::ChainAdapterRequirements<iterator, std::ranges::iterator_t<R>>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Chain ( const R & range) const -> utils::ChainAdapter< iterator, std::ranges::iterator_t< R > >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that chains another range of wrappers.

Template Parameters
RRange type
Parameters
rangeRange to chain
Returns
ChainAdapter over the iterator

Definition at line 512 of file reader.hpp.

◆ Chain() [2/2]

template<typename Derived, MessageTrait T, typename IterType>
template<typename Iter>
requires utils::ChainAdapterRequirements<iterator, Iter>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Chain ( Iter first,
Iter last ) const -> utils::ChainAdapter< iterator, Iter >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that chains another range of wrappers.

Template Parameters
IterIterator type of the range
Parameters
firstIterator to the first element of the range
lastIterator to the end of the range
Returns
ChainAdapter over the iterator

Definition at line 496 of file reader.hpp.

◆ Collect()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Collect ( ) const -> std::vector< T >
nodiscardconstexpr

Collects all messages (previous + current) into a vector of raw T values.

Note
This shadows FunctionalAdapterBase::Collect(). To collect wrapper values, chain a lazy adapter first (e.g., reader.Filter(...).Collect()).
Returns
Vector containing copies of all messages

Definition at line 977 of file reader.hpp.

◆ CollectWith() [1/3]

template<typename Derived, MessageTrait T, typename IterType>
requires std::same_as<typename std::allocator_traits<Alloc>::value_type, T>
template<typename Alloc>
requires std::same_as<typename std::allocator_traits<Alloc>::value_type, T>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::CollectWith ( const Alloc & alloc) const -> std::vector< T, Alloc >
nodiscardconstexpr

Collects all messages into a vector of raw T values using a custom allocator.

Template Parameters
AllocSTL-compatible allocator type for T
Parameters
allocAllocator instance
Returns
Vector containing copies of all messages, using the provided allocator

Definition at line 991 of file reader.hpp.

◆ CollectWith() [2/3]

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::CollectWith ( std::nullptr_t ) const -> std::pmr::vector< T >=delete
delete

◆ CollectWith() [3/3]

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::CollectWith ( std::pmr::memory_resource * resource) const -> std::pmr::vector< T >
nodiscardconstexpr

Collects all messages into a vector of raw T values using a memory resource.

Parameters
resourceMemory resource for allocating the vector
Returns
Vector containing copies of all messages, using the provided memory resource

Definition at line 1003 of file reader.hpp.

◆ Count()

template<typename Derived, MessageTrait T, typename IterType>
size_type helios::ecs::MessageReaderBase< Derived, T, IterType >::Count ( ) const
inlinenodiscardconstexprnoexcept

Returns the total number of messages (previous + current).

Returns
Total message count

Definition at line 727 of file reader.hpp.

◆ CountIf()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
size_type helios::ecs::MessageReaderBase< Derived, T, IterType >::CountIf ( const Pred & predicate) const
inlinenodiscardconstexpr

Counts messages matching a predicate.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
Number of matching messages

Definition at line 619 of file reader.hpp.

◆ Empty()

template<typename Derived, MessageTrait T, typename IterType>
bool helios::ecs::MessageReaderBase< Derived, T, IterType >::Empty ( ) const
inlinenodiscardconstexprnoexcept

Checks if there are no messages.

Returns
true if both previous and current spans are empty

Definition at line 718 of file reader.hpp.

◆ Enumerate()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Enumerate ( ) const -> utils::EnumerateAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that pairs each wrapper with its zero-based index.

Returns
EnumerateAdapter over the iterator

Definition at line 454 of file reader.hpp.

◆ Filter()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Filter ( Pred predicate) const -> utils::FilterAdapter< iterator, Pred >
inlinenodiscardconstexprnoexcept

Returns a lazy filter adapter over the wrapped message sequence.

The adapter yields only those wrapper elements for which predicate returns true. Chain further adapters or call terminal operations (.Collect(), .ForEach(), etc.) on the result.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicateFilter predicate
Returns
FilterAdapter over the iterator

Definition at line 376 of file reader.hpp.

◆ Find()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Find ( const Pred & predicate) const -> std::optional< value_type >
inlinenodiscardconstexpr

Returns a pointer to the first message matching a predicate.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
Optional containing the first matching message, or std::nullopt if none found

Definition at line 606 of file reader.hpp.

◆ Fold()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Acc, typename Folder>
requires std::invocable<Folder, Acc, const value_type&>
Acc helios::ecs::MessageReaderBase< Derived, T, IterType >::Fold ( Acc init,
const Folder & folder ) const
inlinenodiscardconstexpr

Left-folds all messages with an accumulator.

Template Parameters
AccAccumulator type
FolderCallable type (Acc, const value_type&) -> Acc
Parameters
initInitial accumulator value
folderFolding function
Returns
Final accumulated value

Definition at line 593 of file reader.hpp.

◆ ForEach()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Action>
requires std::invocable<Action, const value_type&>
void helios::ecs::MessageReaderBase< Derived, T, IterType >::ForEach ( const Action & action) const
inlineconstexpr

Applies an action to every message (unwrapped const T&).

Template Parameters
ActionCallable type (const value_type&) -> void
Parameters
actionAction to apply

Definition at line 317 of file reader.hpp.

◆ GroupBy()

template<typename Derived, MessageTrait T, typename IterType>
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::GroupBy ( const KeyFunc & key_func) const -> std::unordered_map< std::decay_t< std::invoke_result_t< KeyFunc, const value_type & > >, std::vector< value_type > >
inlinenodiscardconstexpr

Groups wrapped messages by a key extracted from each wrapper.

Template Parameters
KeyFuncKey extractor type (const value_type&) -> Key
Parameters
key_funcKey extraction function
Returns
Hash map from key to grouped wrappers

Definition at line 671 of file reader.hpp.

◆ Inspect()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Func>
requires std::invocable<Func, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Inspect ( Func inspector) const -> utils::InspectAdapter< iterator, Func >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that calls inspector on each wrapper as a side-effect.

Template Parameters
FuncInspector type (const value_type&) -> void
Parameters
inspectorSide-effect function
Returns
InspectAdapter over the iterator

Definition at line 469 of file reader.hpp.

◆ Map()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Func>
requires std::invocable<Func, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Map ( Func transform) const -> utils::MapAdapter< iterator, Func >
inlinenodiscardconstexprnoexcept

Returns a lazy map adapter over the wrapped message sequence.

Each wrapper is transformed by transform.

Template Parameters
FuncTransform type (const value_type&) -> R
Parameters
transformTransformation function
Returns
MapAdapter over the iterator

Definition at line 391 of file reader.hpp.

◆ MaxBy()

template<typename Derived, MessageTrait T, typename IterType>
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::MaxBy ( const KeyFunc & key_func) const -> std::optional< value_type >
inlinenodiscardconstexpr

Finds the wrapped message with the maximum extracted key.

Template Parameters
KeyFuncKey extractor type (const value_type&) -> Key
Parameters
key_funcKey extraction function
Returns
Matching wrapper, or std::nullopt if the reader is empty

Definition at line 645 of file reader.hpp.

◆ MinBy()

template<typename Derived, MessageTrait T, typename IterType>
template<typename KeyFunc>
requires std::invocable<KeyFunc, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::MinBy ( const KeyFunc & key_func) const -> std::optional< value_type >
inlinenodiscardconstexpr

Finds the wrapped message with the minimum extracted key.

Template Parameters
KeyFuncKey extractor type (const value_type&) -> Key
Parameters
key_funcKey extraction function
Returns
Matching wrapper, or std::nullopt if the reader is empty

Definition at line 658 of file reader.hpp.

◆ None()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
bool helios::ecs::MessageReaderBase< Derived, T, IterType >::None ( const Pred & predicate) const
inlinenodiscardconstexpr

Checks if no messages match a predicate.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
true if no messages match (vacuously true if empty)

Definition at line 710 of file reader.hpp.

◆ operator=() [1/2]

template<typename Derived, MessageTrait T, typename IterType>
MessageReaderBase & helios::ecs::MessageReaderBase< Derived, T, IterType >::operator= ( const MessageReaderBase< Derived, T, IterType > & )
delete

◆ operator=() [2/2]

template<typename Derived, MessageTrait T, typename IterType>
MessageReaderBase & helios::ecs::MessageReaderBase< Derived, T, IterType >::operator= ( MessageReaderBase< Derived, T, IterType > && )
constexprdefaultnoexcept

◆ Partition()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Partition ( const Pred & predicate) const -> std::pair< std::vector< value_type >, std::vector< value_type > >
inlinenodiscardconstexpr

Partitions wrapped messages into matching and non-matching groups.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicatePredicate function
Returns
Pair of vectors: first contains matching wrappers, second contains non-matching wrappers

Definition at line 632 of file reader.hpp.

◆ ReadInto()

template<typename Derived, MessageTrait T, typename IterType>
requires std::output_iterator<OutIt, T>
template<typename OutIt>
requires std::output_iterator<OutIt, T>
void helios::ecs::MessageReaderBase< Derived, T, IterType >::ReadInto ( OutIt out) const
constexpr

Reads all messages into an output iterator.

Template Parameters
OutItOutput iterator type for T
Parameters
outOutput iterator

Definition at line 1016 of file reader.hpp.

◆ Reverse()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Reverse ( ) const -> utils::ReverseAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields wrappers in reverse order.

Returns
ReverseAdapter over the iterator

Definition at line 522 of file reader.hpp.

◆ Skip()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Skip ( size_t count) const -> utils::SkipAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that skips the first count wrappers.

Parameters
countNumber of elements to skip
Returns
SkipAdapter over the iterator

Definition at line 413 of file reader.hpp.

◆ SkipWhile()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::SkipWhile ( Pred predicate) const -> utils::SkipWhileAdapter< iterator, Pred >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that skips wrappers while predicate is true.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicateSkip condition
Returns
SkipWhileAdapter over the iterator

Definition at line 443 of file reader.hpp.

◆ Slide()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Slide ( size_t window_size) const -> utils::SlideAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields windows of window_size wrappers.

Parameters
window_sizeNumber of wrappers to include in each window
Returns
SlideAdapter over the iterator

Definition at line 534 of file reader.hpp.

◆ StepBy()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::StepBy ( size_t step) const -> utils::StepByAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields every step-th wrapper.

Parameters
stepStep size (must be > 0)
Warning
Triggers assertion if step == 0.
Returns
StepByAdapter over the iterator

Definition at line 481 of file reader.hpp.

◆ Stride()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Stride ( size_t stride) const -> utils::StrideAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields every stride-th wrapper.

Parameters
strideNumber of wrappers to skip between each yield
Returns
StrideAdapter over the iterator

Definition at line 545 of file reader.hpp.

◆ Take()

template<typename Derived, MessageTrait T, typename IterType>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Take ( size_t count) const -> utils::TakeAdapter< iterator >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter yielding at most count wrappers.

Parameters
countMaximum number of elements to yield
Returns
TakeAdapter over the iterator

Definition at line 402 of file reader.hpp.

◆ TakeWhile()

template<typename Derived, MessageTrait T, typename IterType>
template<typename Pred>
requires std::predicate<Pred, const value_type&>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::TakeWhile ( Pred predicate) const -> utils::TakeWhileAdapter< iterator, Pred >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields wrappers while predicate is true.

Template Parameters
PredPredicate type (const value_type&) -> bool
Parameters
predicateStop condition
Returns
TakeWhileAdapter over the iterator

Definition at line 428 of file reader.hpp.

◆ Zip() [1/2]

template<typename Derived, MessageTrait T, typename IterType>
template<typename R>
requires utils::ZipAdapterRequirements<iterator, std::ranges::iterator_t<R>>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Zip ( const R & range) const -> utils::ZipAdapter< iterator, std::ranges::iterator_t< R > >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields pairs of wrappers from two ranges.

Template Parameters
RType of the range for the second range
Parameters
rangeThe range to zip with the first range
Returns
ZipAdapter over the iterator

Definition at line 577 of file reader.hpp.

◆ Zip() [2/2]

template<typename Derived, MessageTrait T, typename IterType>
template<typename Iter>
requires utils::ZipAdapterRequirements<iterator, Iter>
auto helios::ecs::MessageReaderBase< Derived, T, IterType >::Zip ( Iter first,
Iter last ) const -> utils::ZipAdapter< iterator, Iter >
inlinenodiscardconstexprnoexcept

Returns a lazy adapter that yields pairs of wrappers from two ranges.

Template Parameters
IterType of the iterator for the second range
Parameters
firstIterator to the first element of the second range
lastIterator to the end of the second range
Returns
ZipAdapter over the iterator

Definition at line 561 of file reader.hpp.