vg
tools for working with variation graphs
Public Member Functions | Public Attributes | List of all members
vg::ChainIterator Struct Reference

#include <snarls.hpp>

Public Member Functions

ChainIteratoroperator++ ()
 Advance the iterator. More...
 
pair< const Snarl *, bool > operator* () const
 Get the snarl we're at and whether it is backward. More...
 
const pair< const Snarl *, bool > * operator-> () const
 Get a pointer to the thing we get when we dereference the iterator. More...
 
bool operator== (const ChainIterator &other) const
 We need to define comparison because C++ doesn't give it to us for free. More...
 
bool operator!= (const ChainIterator &other) const
 

Public Attributes

bool go_left
 Are we a reverse iterator or not? More...
 
Chain::const_iterator pos
 What position in the underlying vector are we in? More...
 
Chain::const_iterator chain_start
 What are the bounds of that underlying vector? More...
 
Chain::const_iterator chain_end
 
bool is_rend
 
bool complement
 
pair< const Snarl *, bool > scratch
 

Detailed Description

We want to be able to loop over a chain and get iterators to pairs of the snarl and its orientation in the chain. So we define some iterators.

Member Function Documentation

◆ operator!=()

bool vg::ChainIterator::operator!= ( const ChainIterator other) const

◆ operator*()

pair< const Snarl *, bool > vg::ChainIterator::operator* ( ) const

Get the snarl we're at and whether it is backward.

◆ operator++()

ChainIterator & vg::ChainIterator::operator++ ( )

Advance the iterator.

◆ operator->()

const pair< const Snarl *, bool > * vg::ChainIterator::operator-> ( ) const

Get a pointer to the thing we get when we dereference the iterator.

◆ operator==()

bool vg::ChainIterator::operator== ( const ChainIterator other) const

We need to define comparison because C++ doesn't give it to us for free.

Member Data Documentation

◆ chain_end

Chain::const_iterator vg::ChainIterator::chain_end

◆ chain_start

Chain::const_iterator vg::ChainIterator::chain_start

What are the bounds of that underlying vector?

◆ complement

bool vg::ChainIterator::complement

When dereferencing, should we flip snarl orientations form the orientations they appear at in the chain when read left to right?

◆ go_left

bool vg::ChainIterator::go_left

Are we a reverse iterator or not?

◆ is_rend

bool vg::ChainIterator::is_rend

Since we're using backing random access itarators to provide reverse iterators, we need a flag to see if we are rend (i.e. before the beginning)

◆ pos

Chain::const_iterator vg::ChainIterator::pos

What position in the underlying vector are we in?

◆ scratch

pair<const Snarl*, bool> vg::ChainIterator::scratch
mutable

In order to dereference to a pair with -> we need a place to put the pair so we can have a pointer to it. Gets lazily set to wherever the iterator is pointing when we do ->


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