Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/iter-stack.hpp"
A Queue which can be pulled by iterating.
As a variation of the IterStack frontend, here the exposed additional interface works like a queue: New elements can be fed, and the iteration will consume the contents first-in first-out. The implementation is based on std::deque, providing both feed and the iterating operation in amortised constant time, using chunk wise heap allocations. Feeding of new elements into the queue and retrieving old elements by iteration may be mixed freely.
Definition at line 188 of file iter-stack.hpp.
Public Member Functions | |
bool | empty () const |
IterQueue & | feed (TY const &elm) |
IterQueue & | feed (TY &&elm) |
IterQueue & | insert (TY const &elm) |
TY | pop () |
size_t | size () const |
Public Member Functions inherited from IterStateWrapper< iter::IterDequeStorage< TY > > | |
IterStateWrapper (iter::IterDequeStorage< TY > &&initialState) | |
IterStateWrapper (iter::IterDequeStorage< TY > const &initialState) | |
bool | empty () const |
ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper) | |
bool | isValid () const |
operator bool () const | |
iter::CoreYield< iter::IterDequeStorage< TY > > | operator* () const |
IterStateWrapper & | operator++ () |
pointer | operator-> () const |
Classes | |
struct | Builder |
Adapter for use as opaque sequence. More... | |
Friends | |
IterQueue::Builder | build (IterQueue &initial) |
Extension point to be picked up by ADL. More... | |
Additional Inherited Members | |
Public Types inherited from IterStateWrapper< iter::IterDequeStorage< TY > > | |
using | pointer = typename meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Pointer |
using | reference = typename meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Reference |
using | value_type = typename meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Value |
Protected Member Functions inherited from IterStateWrapper< iter::IterDequeStorage< TY > > | |
void | __throw_if_empty () const |
iter::IterDequeStorage< TY > & | stateCore () |
allow derived classes to access state representation | |
iter::IterDequeStorage< TY > const & | stateCore () const |
|
friend |
Extension point to be picked up by ADL.
The exposed Builder object allows client code to prepare and pre-fill the queue, without being tied to the implementation type
initial | the initial contents of the queue to start with, maybe empty. This parameter also acts as type tag to pick this build() function by ADL |
Definition at line 282 of file iter-stack.hpp.