GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::execution::Chunk< Resource, Projection > Class Template Reference

Subrange of a resource, corresponding to one of a fixed number of chunks that the resource has been divded into. More...

#include <GREM/execution/Chunk.hpp>

Public Types

using resource_type = std::remove_const_t<Resource>
using iterator = decltype(std::begin(std::invoke(Projection, std::declval<Resource&>())))
using size_type = decltype(std::size(std::invoke(Projection, std::declval<Resource&>())))
using difference_type = iter_difference_t<iterator>

Public Member Functions

constexpr Chunk (Resource &resource, size_t chunkIndex, size_t chunkCount)
 Construct a resource chunk.
constexpr iterator begin () const noexcept
constexpr iterator end () const noexcept
constexpr bool empty () const noexcept
constexpr size_type size () const noexcept
constexpr auto data () const
constexpr decltype(auto) front () const
constexpr decltype(auto) back () const
constexpr decltype(auto) operator[] (size_type pos) const

Detailed Description

template<typename Resource, auto Projection = std::identity{}>
class grem::execution::Chunk< Resource, Projection >

Subrange of a resource, corresponding to one of a fixed number of chunks that the resource has been divded into.

Template Parameters
Resourceresource type that the chunk is a subrange of, potentially const-qualified to indicate read-only access.
Projectionfunction object that gets the full range of elements from the resource that is to be chunked. The default projection assumes that the range is the resource itself.

Member Typedef Documentation

◆ resource_type

template<typename Resource, auto Projection = std::identity{}>
using grem::execution::Chunk< Resource, Projection >::resource_type = std::remove_const_t<Resource>

◆ iterator

template<typename Resource, auto Projection = std::identity{}>
using grem::execution::Chunk< Resource, Projection >::iterator = decltype(std::begin(std::invoke(Projection, std::declval<Resource&>())))

◆ size_type

template<typename Resource, auto Projection = std::identity{}>
using grem::execution::Chunk< Resource, Projection >::size_type = decltype(std::size(std::invoke(Projection, std::declval<Resource&>())))

◆ difference_type

template<typename Resource, auto Projection = std::identity{}>
using grem::execution::Chunk< Resource, Projection >::difference_type = iter_difference_t<iterator>

Constructor & Destructor Documentation

◆ Chunk()

template<typename Resource, auto Projection = std::identity{}>
grem::execution::Chunk< Resource, Projection >::Chunk ( Resource & resource,
size_t chunkIndex,
size_t chunkCount )
inlineconstexpr

Construct a resource chunk.

Parameters
resourcereference to the resource to chunk. Must outlive the chunk's use.
chunkIndexindex of the specific chunk that this subrange references. Must be less than chunkCount.
chunkCountnumber of chunks that the resource has been divided into. Must be positive, and greater than chunkIndex.

Member Function Documentation

◆ begin()

template<typename Resource, auto Projection = std::identity{}>
iterator grem::execution::Chunk< Resource, Projection >::begin ( ) const
inlinenodiscardconstexprnoexcept

◆ end()

template<typename Resource, auto Projection = std::identity{}>
iterator grem::execution::Chunk< Resource, Projection >::end ( ) const
inlinenodiscardconstexprnoexcept

◆ empty()

template<typename Resource, auto Projection = std::identity{}>
bool grem::execution::Chunk< Resource, Projection >::empty ( ) const
inlinenodiscardconstexprnoexcept

◆ size()

template<typename Resource, auto Projection = std::identity{}>
size_type grem::execution::Chunk< Resource, Projection >::size ( ) const
inlinenodiscardconstexprnoexcept

◆ data()

template<typename Resource, auto Projection = std::identity{}>
auto grem::execution::Chunk< Resource, Projection >::data ( ) const
inlineconstexpr

◆ front()

template<typename Resource, auto Projection = std::identity{}>
decltype(auto) grem::execution::Chunk< Resource, Projection >::front ( ) const
inlineconstexpr

◆ back()

template<typename Resource, auto Projection = std::identity{}>
decltype(auto) grem::execution::Chunk< Resource, Projection >::back ( ) const
inlineconstexpr

◆ operator[]()

template<typename Resource, auto Projection = std::identity{}>
decltype(auto) grem::execution::Chunk< Resource, Projection >::operator[] ( size_type pos) const
inlineconstexpr

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