Bifrost: unitigIterator< Unitig_data_t, Graph_data_t, is_const > Class Template Reference

Bifrost

Public Member Functions
unitigIterator< Unitig_data_t, Graph_data_t, is_const > Class Template Reference

Iterator for the unitigs of a Compacted de Bruijn graph. More...

Inherits iterator< std::input_iterator_tag, UnitigMap< Unitig_data_t, Graph_data_t, is_const >, int >.

## Public Member Functions
| unitigIterator ()
| Constructor. More...
| unitigIterator (CompactedDBG_ptr_t cdbg_)
| Constructor. More...
| unitigIterator (const unitigIterator &o)
| Copy constructor. More...
unitigIterator & | operator++ ()
| Prefix increment, iterate over the next unitig. More...
unitigIterator | operator++ (int)
| Postfix increment, iterate over the next unitig. More...
bool | operator== (const unitigIterator &o) const
| Equality operator: check if two unitigIterator are the same. More...
bool | operator!= (const unitigIterator &o) const
| Inequality operator: check if two unitigIterator are different. More...
const UnitigMap< U, G, is_const > & | operator* () const
| Indirection operator. More...
const UnitigMap< U, G, is_const > * | operator-> () const
| Dereference operator. More...

## Detailed Description

### template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>
class unitigIterator< Unitig_data_t, Graph_data_t, is_const >

Iterator for the unitigs of a Compacted de Bruijn graph.

A unitigIterator object has 3 template parameters: the type of data associated with the unitigs of the graph, the type of data associated with the graph and a boolean indicating if this is a constant iterator or not. Note that you are supposed to use this class as the iterator of the class CompactedDBG (CompactedDBG::iterator and CompactedDBG::const_iterator) so you shouldn't have to instantiate an object unitigIterator and its template parameters yourself. The unitig data and graph data types should be the same as the ones used for the CompactedDBG the iterator is from. No specific order (such as a lexicographic one) is assumed during iteration.

CompactedDBG<> cdbg;
... // Some more code, cdbg construction
for (const auto& unitig : cdbg){
cout << unitig.toString() << endl; // unitig is of type UnitigMap
}
for (CompactedDBG<>::const_iterator it = cdbg.begin(); it != cdbg.end(); ++it){
cout << it.toString() << endl;
}

## Constructor & Destructor Documentation

## ◆ unitigIterator() [1/3]

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

unitigIterator< Unitig_data_t, Graph_data_t, is_const >::unitigIterator | ( |  | ) |

Constructor.

Returns
  an empty unitigIterator.

## ◆ unitigIterator() [2/3]

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

unitigIterator< Unitig_data_t, Graph_data_t, is_const >::unitigIterator | ( | CompactedDBG_ptr_t | cdbg_ | ) |

Constructor.

Parameters

  cdbg_ | is a pointer to a Compacted de Bruijn graph. The unitigIterator will iterate over the unitigs of this graph. If the unitigIterator is a constant, the CompactedDBG pointer is a constant pointer and the accessed unitigs can't be modified.

Returns
  a unitigIterator.

## ◆ unitigIterator() [3/3]

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

unitigIterator< Unitig_data_t, Graph_data_t, is_const >::unitigIterator | ( | const unitigIterator< Unitig_data_t, Graph_data_t, is_const > & | o | ) |

Copy constructor.

Returns
  a copy of a unitigIterator.

## Member Function Documentation

## ◆ operator!=()

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

bool unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator!= | ( | const unitigIterator< Unitig_data_t, Graph_data_t, is_const > & | o | ) | const

Inequality operator: check if two unitigIterator are different.

Parameters

  o | is another unitigIterator.

Returns
  a boolean indicating whether the two unitigIterator are different.

## ◆ operator*()

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

const UnitigMap<U, G, is_const>& unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator* | ( |  | ) | const

Indirection operator.

Returns
  a UnitigMap object reference which contains information about the mapped unitig.

## ◆ operator++() [1/2]

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

unitigIterator& unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator++ | ( |  | ) |

Prefix increment, iterate over the next unitig.

Note that no specific order (such as a lexicographic one) is assumed during iteration.

## ◆ operator++() [2/2]

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

unitigIterator unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator++ | ( | int |  | ) |

Postfix increment, iterate over the next unitig.

Note that no specific order (such as a lexicographic one) is assumed during iteration.

## ◆ operator->()

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

const UnitigMap<U, G, is_const>* unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator-> | ( |  | ) | const

Dereference operator.

Returns
  a UnitigMap object pointer which contains information about the mapped unitig.

## ◆ operator==()

template<typename Unitig_data_t = void, typename Graph_data_t = void, bool is_const = false>

bool unitigIterator< Unitig_data_t, Graph_data_t, is_const >::operator== | ( | const unitigIterator< Unitig_data_t, Graph_data_t, is_const > & | o | ) | const

Equality operator: check if two unitigIterator are the same.

Parameters

  o | is another unitigIterator.

Returns
  a boolean indicating whether the two unitigIterator are the same.

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

- src/UnitigIterator.hpp