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

#include "lib/iter-stack.hpp"

Description

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

A Stack which can be popped by iterating.

This is a simple helper built by wrapping up STL's double ended queue (deque). Thus, each instance holds the full state, which is actually kept in heap allocated storage. Pushing of new elements and iterator use may be mixed.

Contrary to just using std::stack

  • the iteration is compliant to the Lumiera Forward Iterator concept
  • there is a simplified pop() function which removes and returns at once

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

Public Member Functions

IterStackpush (TY const &elm)
 
IterStackpush (TY &&elm)
 
IterStackinsert (TY const &elm)
 
TY pop ()
 
void clear ()
 
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)
 

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

◆ push() [1/2]

template<class TY >
IterStack & push ( TY const &  elm)
inline

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

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

Referenced by Expander< SRC, RES >::expandChildren(), IterStack< TY >::insert(), and BusTerm_test::pushDiff().

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

◆ push() [2/2]

template<class TY >
IterStack & push ( TY &&  elm)
inline

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

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

+ Here is the call graph for this function:

◆ insert()

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

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

References IterStack< TY >::push().

+ Here is the call graph for this function:

◆ pop()

template<class TY >
TY pop ( )
inline

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

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

+ Here is the call graph for this function:

◆ clear()

template<class TY >
void clear ( )
inline

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

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

Referenced by Expander< SRC, RES >::rootCurrent().

+ 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 159 of file iter-stack.hpp.

Referenced by Expander< SRC, RES >::depth(), and IterStack< TY >::empty().

+ Here is the caller graph for this function:

◆ empty()

template<class TY >
bool empty ( ) const
inline

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

References IterStack< TY >::size().

+ Here is the call graph for this function:
+ Inheritance diagram for IterStack< TY >:
+ Collaboration diagram for IterStack< TY >:

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