clipp::group::depth_first_traverser Class Reference

recursively iterates over all nodes More...

#include <clipp.h>

Classes

struct  context
 
class  memento
 

Public Types

using context_list = std::vector< context >
 

Public Member Functions

 depth_first_traverser ()=default
 
 depth_first_traverser (const group &cur)
 
 operator bool () const noexcept
 
int level () const noexcept
 
bool is_first_in_group () const noexcept
 
bool is_last_in_group () const noexcept
 
bool is_last_in_path () const noexcept
 
bool is_alternative (int minlevel=0) const noexcept
 inside a group of alternatives >= minlevel More...
 
bool is_repeatable (int minlevel=0) const noexcept
 repeatable or inside a repeatable group >= minlevel More...
 
bool joinable () const noexcept
 inside group with joinable flags More...
 
const context_liststack () const
 
const grouprepeat_group () const noexcept
 innermost repeat group More...
 
const groupjoin_group () const noexcept
 outermost join group More...
 
const grouproot () const noexcept
 
arg_string common_flag_prefix () const noexcept
 common flag prefix of all flags in current group More...
 
const childoperator* () const noexcept
 
const childoperator-> () const noexcept
 
const groupparent () const noexcept
 
depth_first_traverseroperator++ ()
 go to next element of depth first search More...
 
depth_first_traversernext_sibling ()
 go to next sibling of current More...
 
depth_first_traversernext_after_siblings ()
 go to next position after siblings of current More...
 
depth_first_traversernext_alternative ()
 skips to next alternative in innermost group More...
 
depth_first_traverserback_to_parent ()
 
depth_first_traverserskip_siblings ()
 don't visit next siblings, go back to parent on next ++ note: renders siblings unreachable for *this More...
 
depth_first_traverserskip_alternatives ()
 skips all other alternatives in surrounding exclusive groups on next ++ note: renders alternatives unreachable for *this More...
 
void invalidate ()
 
memento undo_point () const
 
void undo (const memento &m)
 

Friends

bool operator== (const depth_first_traverser &a, const depth_first_traverser &b)
 
bool operator!= (const depth_first_traverser &a, const depth_first_traverser &b)
 

Detailed Description

recursively iterates over all nodes

Definition at line 2661 of file clipp.h.

Member Typedef Documentation

◆ context_list

Definition at line 2674 of file clipp.h.

Constructor & Destructor Documentation

◆ depth_first_traverser() [1/2]

clipp::group::depth_first_traverser::depth_first_traverser ( )
default

◆ depth_first_traverser() [2/2]

clipp::group::depth_first_traverser::depth_first_traverser ( const group cur)
inlineexplicit

Definition at line 2689 of file clipp.h.

Member Function Documentation

◆ back_to_parent()

depth_first_traverser& clipp::group::depth_first_traverser::back_to_parent ( )
inline

Definition at line 2855 of file clipp.h.

◆ common_flag_prefix()

arg_string clipp::group::depth_first_traverser::common_flag_prefix ( ) const
inlinenoexcept

common flag prefix of all flags in current group

Definition at line 2774 of file clipp.h.

◆ invalidate()

void clipp::group::depth_first_traverser::invalidate ( )
inline

Definition at line 2890 of file clipp.h.

◆ is_alternative()

bool clipp::group::depth_first_traverser::is_alternative ( int  minlevel = 0) const
inlinenoexcept

inside a group of alternatives >= minlevel

Definition at line 2723 of file clipp.h.

◆ is_first_in_group()

bool clipp::group::depth_first_traverser::is_first_in_group ( ) const
inlinenoexcept

Definition at line 2701 of file clipp.h.

◆ is_last_in_group()

bool clipp::group::depth_first_traverser::is_last_in_group ( ) const
inlinenoexcept

Definition at line 2706 of file clipp.h.

◆ is_last_in_path()

bool clipp::group::depth_first_traverser::is_last_in_path ( ) const
inlinenoexcept

Definition at line 2711 of file clipp.h.

◆ is_repeatable()

bool clipp::group::depth_first_traverser::is_repeatable ( int  minlevel = 0) const
inlinenoexcept

repeatable or inside a repeatable group >= minlevel

Definition at line 2732 of file clipp.h.

◆ join_group()

const group* clipp::group::depth_first_traverser::join_group ( ) const
inlinenoexcept

outermost join group

Definition at line 2763 of file clipp.h.

◆ joinable()

bool clipp::group::depth_first_traverser::joinable ( ) const
inlinenoexcept

inside group with joinable flags

Definition at line 2741 of file clipp.h.

◆ level()

int clipp::group::depth_first_traverser::level ( ) const
inlinenoexcept

Definition at line 2697 of file clipp.h.

◆ next_after_siblings()

depth_first_traverser& clipp::group::depth_first_traverser::next_after_siblings ( )
inline

go to next position after siblings of current

Definition at line 2828 of file clipp.h.

◆ next_alternative()

depth_first_traverser& clipp::group::depth_first_traverser::next_alternative ( )
inline

skips to next alternative in innermost group

Definition at line 2838 of file clipp.h.

◆ next_sibling()

depth_first_traverser& clipp::group::depth_first_traverser::next_sibling ( )
inline

go to next sibling of current

Definition at line 2812 of file clipp.h.

◆ operator bool()

clipp::group::depth_first_traverser::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 2693 of file clipp.h.

◆ operator*()

const child& clipp::group::depth_first_traverser::operator* ( ) const
inlinenoexcept

Definition at line 2781 of file clipp.h.

◆ operator++()

depth_first_traverser& clipp::group::depth_first_traverser::operator++ ( )
inline

go to next element of depth first search

Definition at line 2798 of file clipp.h.

◆ operator->()

const child* clipp::group::depth_first_traverser::operator-> ( ) const
inlinenoexcept

Definition at line 2786 of file clipp.h.

◆ parent()

const group& clipp::group::depth_first_traverser::parent ( ) const
inlinenoexcept

Definition at line 2791 of file clipp.h.

◆ repeat_group()

const group* clipp::group::depth_first_traverser::repeat_group ( ) const
inlinenoexcept

innermost repeat group

Definition at line 2754 of file clipp.h.

◆ root()

const group* clipp::group::depth_first_traverser::root ( ) const
inlinenoexcept

Definition at line 2769 of file clipp.h.

◆ skip_alternatives()

depth_first_traverser& clipp::group::depth_first_traverser::skip_alternatives ( )
inline

skips all other alternatives in surrounding exclusive groups on next ++ note: renders alternatives unreachable for *this

Definition at line 2877 of file clipp.h.

◆ skip_siblings()

depth_first_traverser& clipp::group::depth_first_traverser::skip_siblings ( )
inline

don't visit next siblings, go back to parent on next ++ note: renders siblings unreachable for *this

Definition at line 2865 of file clipp.h.

◆ stack()

const context_list& clipp::group::depth_first_traverser::stack ( ) const
inline

Definition at line 2748 of file clipp.h.

◆ undo()

void clipp::group::depth_first_traverser::undo ( const memento m)
inline

Definition at line 2925 of file clipp.h.

◆ undo_point()

memento clipp::group::depth_first_traverser::undo_point ( ) const
inline

Definition at line 2918 of file clipp.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const depth_first_traverser a,
const depth_first_traverser b 
)
friend

Definition at line 2911 of file clipp.h.

◆ operator==

bool operator== ( const depth_first_traverser a,
const depth_first_traverser b 
)
friend

Definition at line 2894 of file clipp.h.


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