Juggler
Juggling algorithms and event processing using gaudi framework
|
#include <GroupBy.hpp>
Classes | |
class | GroupIterator |
Iterator type representing a group of elements. More... | |
Public Types | |
using | Key = std::decay_t< decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group. More... | |
using | Group = std::pair< Key, Range< Iterator > > |
A Group is an iterator range with the associated key. More... | |
using | GroupEndIterator = Iterator |
using | Key = std::decay_t< decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group. More... | |
using | Group = std::pair< Key, Range< Iterator > > |
A Group is an iterator range with the associated key. More... | |
using | GroupEndIterator = Iterator |
using | Key = std::decay_t< decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group. More... | |
using | Group = std::pair< Key, Range< Iterator > > |
A Group is an iterator range with the associated key. More... | |
using | GroupEndIterator = Iterator |
Public Member Functions | |
constexpr | GroupBy (Iterator begin, Iterator end, KeyGetter keyGetter=KeyGetter()) |
Construct the group-by proxy for an iterator range. More... | |
constexpr GroupIterator | begin () const |
constexpr GroupEndIterator | end () const |
constexpr bool | empty () const |
constexpr | GroupBy (Iterator begin, Iterator end, KeyGetter keyGetter=KeyGetter()) |
Construct the group-by proxy for an iterator range. More... | |
constexpr GroupIterator | begin () const |
constexpr GroupEndIterator | end () const |
constexpr bool | empty () const |
constexpr | GroupBy (Iterator begin, Iterator end, KeyGetter keyGetter=KeyGetter()) |
Construct the group-by proxy for an iterator range. More... | |
constexpr GroupIterator | begin () const |
constexpr GroupEndIterator | end () const |
constexpr bool | empty () const |
Proxy for iterating over groups of elements within a container.
Consecutive elements with the same key (as defined by the KeyGetter) are placed in one group. The proxy should always be used as part of a range-based for loop. In combination with structured bindings to reduce the boilerplate, the group iteration can be written as
for (auto&& [key, elements] : GroupBy<...>(...)) { // do something with just the key ... // iterate over the group elements for (const auto& element : elements) { ... } }
using Jug::GroupBy< Iterator, KeyGetter >::Group = std::pair<Key, Range<Iterator> > |
A Group is an iterator range with the associated key.
using Jug::GroupBy< Iterator, KeyGetter >::Group = std::pair<Key, Range<Iterator> > |
A Group is an iterator range with the associated key.
using Jug::GroupBy< Iterator, KeyGetter >::Group = std::pair<Key, Range<Iterator> > |
A Group is an iterator range with the associated key.
using Jug::GroupBy< Iterator, KeyGetter >::GroupEndIterator = Iterator |
Iterator type representing the end of the groups.
The end iterator will not be dereferenced in C++17 range-based loops. It can thus be a simpler type without the overhead of the full group iterator below.
using Jug::GroupBy< Iterator, KeyGetter >::GroupEndIterator = Iterator |
Iterator type representing the end of the groups.
The end iterator will not be dereferenced in C++17 range-based loops. It can thus be a simpler type without the overhead of the full group iterator below.
using Jug::GroupBy< Iterator, KeyGetter >::GroupEndIterator = Iterator |
Iterator type representing the end of the groups.
The end iterator will not be dereferenced in C++17 range-based loops. It can thus be a simpler type without the overhead of the full group iterator below.
using Jug::GroupBy< Iterator, KeyGetter >::Key = std::decay_t<decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group.
using Jug::GroupBy< Iterator, KeyGetter >::Key = std::decay_t<decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group.
using Jug::GroupBy< Iterator, KeyGetter >::Key = std::decay_t<decltype(KeyGetter()(*Iterator()))> |
The key type that identifies elements within a group.
|
inlineconstexpr |
Construct the group-by proxy for an iterator range.
|
inlineconstexpr |
Construct the group-by proxy for an iterator range.
|
inlineconstexpr |
Construct the group-by proxy for an iterator range.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |