Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
IterQueue< TY > Struct Template Reference

#include "lib/iter-stack.hpp"

Description

template<class TY>
struct lib::IterQueue< TY >

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.

Classes

struct  Builder
 Adapter for use as opaque sequence. More...
 

Public Member Functions

IterQueuefeed (TY const &elm)
 
IterQueuefeed (TY &&elm)
 
IterQueueinsert (TY const &elm)
 
TY pop ()
 
size_t size () const
 
bool empty () const
 
- Public Member Functions inherited from IterStateWrapper< iter::IterDequeStorage< TY > >
 IterStateWrapper (iter::IterDequeStorage< TY > &&initialState)
 
 IterStateWrapper (iter::IterDequeStorage< TY > const &initialState)
 
 IterStateWrapper ()
 
 operator bool () const
 
iter::CoreYield< iter::IterDequeStorage< TY > > operator* () const
 
pointer operator-> () const
 
IterStateWrapperoperator++ ()
 
bool isValid () const
 
bool empty () const
 
 ENABLE_USE_IN_STD_RANGE_FOR_LOOPS (IterStateWrapper)
 

Friends

IterQueue::Builder build (IterQueue &initial)
 Extension point to be picked up by ADL.
 

Additional Inherited Members

- Public Types inherited from IterStateWrapper< iter::IterDequeStorage< TY > >
using value_type = meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Value
 
using reference = meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Reference
 
using pointer = meta::RefTraits< iter::CoreYield< iter::IterDequeStorage< TY > > >::Pointer
 
- Protected Member Functions inherited from IterStateWrapper< iter::IterDequeStorage< TY > >
iter::IterDequeStorage< TY > & stateCore ()
 allow derived classes to access state representation
 
iter::IterDequeStorage< TY > const & stateCore () const
 
void __throw_if_empty () const
 

Member Function Documentation

◆ feed() [1/2]

template<class TY >
IterQueue & feed ( TY const &  elm)
inline

Definition at line 195 of file iter-stack.hpp.

References IterStateWrapper< iter::IterDequeStorage< TY > >::stateCore().

Referenced by lib::elements(), lib::elements(), lib::elements(), lib::elements(), lib::elements(), CommandQueue::feed(), CallQueue::feed(), IterQueue< TY >::insert(), IterQueue_test::run(), IterQueue< TY >::Builder::usingSequence(), and IterQueue< TY >::Builder::wrapping().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ feed() [2/2]

template<class TY >
IterQueue & feed ( TY &&  elm)
inline

Definition at line 202 of file iter-stack.hpp.

References IterStateWrapper< iter::IterDequeStorage< TY > >::stateCore().

+ Here is the call graph for this function:

◆ insert()

template<class TY >
IterQueue & insert ( TY const &  elm)
inline

Definition at line 209 of file iter-stack.hpp.

References IterQueue< TY >::feed().

+ Here is the call graph for this function:

◆ pop()

template<class TY >
TY pop ( )
inline

Definition at line 215 of file iter-stack.hpp.

References IterStateWrapper< iter::IterDequeStorage< TY > >::__throw_if_empty(), and IterStateWrapper< iter::IterDequeStorage< TY > >::stateCore().

Referenced by DispatcherLoop::processCommands(), IterQueue_test::run(), CommandQueue_test::verifyBasics(), and CommandQueue_test::verifyExecutabilityCheck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

template<class TY >
size_t size ( ) const
inline

Definition at line 227 of file iter-stack.hpp.

Referenced by IterQueue< TY >::empty(), CallQueue::size(), DispatcherLoop::size(), CommandQueue_test::verifyBasics(), and CommandQueue_test::verifyExecutabilityCheck().

+ Here is the caller graph for this function:

◆ empty()

template<class TY >
bool empty ( ) const
inline

Definition at line 233 of file iter-stack.hpp.

References IterQueue< TY >::size().

Referenced by DispatcherLoop::DispatcherLoop(), DispatcherLoop::processCommands(), and CommandQueue_test::verifyBasics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ build

template<class TY >
IterQueue::Builder build ( IterQueue< TY > &  initial)
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

Parameters
initialthe 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.

+ Inheritance diagram for IterQueue< TY >:
+ Collaboration diagram for IterQueue< TY >:

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