Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/iter-explorer.hpp"
Decorator for IterExplorer to group consecutive elements into fixed sized chunks. One group of elements is always prepared eagerly, and then the next one on iteration. The group is packaged into a std::array, returning a reference into the internal buffer. If there are leftover elements at the end of the source sequence, which are not sufficient to fill a full group, these can be retrieved through the special API getRestElms(), which returns an iterator.
Definition at line 892 of file iter-explorer.hpp.
Public Types | |
using | pointer = Group * |
using | reference = Group & |
using | value_type = Group |
Public Member Functions | |
Grouping (SRC &&dataSrc) | |
bool | checkPoint () const |
void | expandChildren () |
refresh state when other layers manipulate the source sequence. More... | |
auto | getGroupedElms () |
Iterate over the Elements in the current group. More... | |
auto | getRestElms () |
Retrieve the tail elements produced by the source, which did not suffice to fill a full group. More... | |
void | iterNext () |
reference | yield () const |
Classes | |
struct | Buffer |
Protected Types | |
using | Group = std::array< RES, grp > |
using | Iter = typename Group::iterator |
Protected Member Functions | |
void | pullGroup () |
SRC & | srcIter () const |
Protected Attributes | |
Buffer | buff_ |
uint | pos_ {0} |
|
inline |
Iterate over the Elements in the current group.
Definition at line 931 of file iter-explorer.hpp.
|
inline |
Retrieve the tail elements produced by the source, which did not suffice to fill a full group.
Definition at line 945 of file iter-explorer.hpp.
|
inline |
refresh state when other layers manipulate the source sequence.
Definition at line 954 of file iter-explorer.hpp.
|
inlineprotected |
Definition at line 991 of file iter-explorer.hpp.