vg
tools for working with variation graphs
Public Member Functions | Private Attributes | List of all members
vg::ZipCodeTree::iterator Class Reference

#include <zip_code_tree.hpp>

Public Member Functions

 iterator (vector< tree_item_t >::const_iterator begin, vector< tree_item_t >::const_iterator end)
 Make an iterator wrapping the given iterator, until the given end. More...
 
 iterator (const iterator &other)=default
 
 iterator (iterator &&other)=default
 
iteratoroperator= (const iterator &other)=default
 
iteratoroperator= (iterator &&other)=default
 
iteratoroperator++ ()
 Advance right. More...
 
bool operator== (const iterator &other) const
 Compare for equality to see if we hit end. More...
 
bool operator!= (const iterator &other) const
 Compare for inequality. More...
 
oriented_seed_t operator* () const
 Get the index and orientation of the seed we are currently at. More...
 
size_t remaining_tree () const
 

Private Attributes

vector< tree_item_t >::const_iterator it
 Where we are in the stored tree. More...
 
vector< tree_item_t >::const_iterator end
 Where the stored tree ends. We keep this to avoid needing a reference back to the ZipCodeTree. More...
 

Detailed Description

Iterator that visits all seeds right to left in the tree's in-order traversal.

Constructor & Destructor Documentation

◆ iterator() [1/3]

vg::ZipCodeTree::iterator::iterator ( vector< tree_item_t >::const_iterator  begin,
vector< tree_item_t >::const_iterator  end 
)

Make an iterator wrapping the given iterator, until the given end.

◆ iterator() [2/3]

vg::ZipCodeTree::iterator::iterator ( const iterator other)
default

◆ iterator() [3/3]

vg::ZipCodeTree::iterator::iterator ( iterator &&  other)
default

Member Function Documentation

◆ operator!=()

bool vg::ZipCodeTree::iterator::operator!= ( const iterator other) const
inline

Compare for inequality.

◆ operator*()

auto vg::ZipCodeTree::iterator::operator* ( ) const

Get the index and orientation of the seed we are currently at.

◆ operator++()

auto vg::ZipCodeTree::iterator::operator++ ( )

Advance right.

◆ operator=() [1/2]

iterator& vg::ZipCodeTree::iterator::operator= ( const iterator other)
default

◆ operator=() [2/2]

iterator& vg::ZipCodeTree::iterator::operator= ( iterator &&  other)
default

◆ operator==()

auto vg::ZipCodeTree::iterator::operator== ( const iterator other) const

Compare for equality to see if we hit end.

◆ remaining_tree()

auto vg::ZipCodeTree::iterator::remaining_tree ( ) const

Get the number of tree storage slots left in the iterator. We need this to make reverse iterators from forward ones.

Member Data Documentation

◆ end

vector<tree_item_t>::const_iterator vg::ZipCodeTree::iterator::end
private

Where the stored tree ends. We keep this to avoid needing a reference back to the ZipCodeTree.

◆ it

vector<tree_item_t>::const_iterator vg::ZipCodeTree::iterator::it
private

Where we are in the stored tree.


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