Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Union_find_base< T, VertexDS, InternalVertexTag >::Descendants_iterator Class Reference

Iterator over the descendants of a given vertex. More...

#include <Union_find.hpp>

Public Types

typedef Descendants_iterator Self
 
typedef std::iterator< std::input_iterator_tag, Vertex * > Base
 

Constructors

 Descendants_iterator (void)
 
 Descendants_iterator (Vertex *father, Vertex_list_iterator begin, Vertex_list_iterator end, const T_Union_find_base< T, VertexDS, InternalVertexTag > *engine)
 Constructs the iterator by initalizing the father, the engine and the range of children of father. More...
 

Operators


const Vertexoperator* (void) const
 Value returned when the iterator is dereferenced. More...
 
Vertexoperator* (void)
 Value returned when the iterator is dereferenced. More...
 
Descendants_iterator operator++ (int)
 Postfix increment of the iterator.
More...
 

Detailed Description

template<class T, class VertexDS, bool InternalVertexTag>
class SBL::CADS::T_Union_find_base< T, VertexDS, InternalVertexTag >::Descendants_iterator

Iterator over the descendants of a given vertex.

Recursive iterator over all the vertices having the given vertex as father. It inherits from the stl iterator base class instantiated with the input iterator tag, and the Vertex as value type.

Member Typedef Documentation

◆ Base

typedef std::iterator<std::input_iterator_tag, Vertex*> Base

◆ Self

Constructor & Destructor Documentation

◆ Descendants_iterator() [1/2]

Descendants_iterator ( void  )
inline

◆ Descendants_iterator() [2/2]

Descendants_iterator ( Vertex father,
Vertex_list_iterator  begin,
Vertex_list_iterator  end,
const T_Union_find_base< T, VertexDS, InternalVertexTag > *  engine 
)
inline

Constructs the iterator by initalizing the father, the engine and the range of children of father.

Member Function Documentation

◆ operator*() [1/2]

Vertex* operator* ( void  )
inline

Value returned when the iterator is dereferenced.

It is the current value of the iterator over the children of m_vh.

◆ operator*() [2/2]

const Vertex* operator* ( void  ) const
inline

Value returned when the iterator is dereferenced.

It is the current value of the iterator over the children of m_vh.

◆ operator++()

Descendants_iterator operator++ ( int  )
inline

Postfix increment of the iterator.

If the current vertex has children, we first visit the children. When it is finished, we continue to the next vertex. If there is no more vertex, we return to the father.

if there is a child pointed by m_begin, i.e another child of m_vh

if m_begin is at the end of children of m_vh, we return the father. If there is no more father, it is finished.