Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Container_of_containers_iterator_base< OuterContainerIterator, InnerContainerIterator > Class Template Reference

Base representation of an iterator over nested containers. More...

#include <Container_of_containers_iterator.hpp>

Public Types

typedef T_Container_of_containers_iterator_base< OuterContainerIterator, InnerContainerIterator > Self
 The class itself. More...
 
typedef SBL::iterator< InnerContainerIterator > Base
 Base iterator declaring only the types. More...
 

Constructors

 T_Container_of_containers_iterator_base (const Self &It)
 Constructs by copy. More...
 
 T_Container_of_containers_iterator_base (const OuterContainerIterator &it, const OuterContainerIterator &it_end)
 Constructs by initializing the start and the end of the outer container. More...
 

Operators

InnerContainerIterator::reference operator* (void)
 Access to the data pointed by the iterator over the inner container. More...
 
const InnerContainerIterator::reference operator* (void) const
 Const access to the data pointed by the iterator over the inner container. More...
 
Selfoperator++ (void)
 Increment the iterator over the inner container. More...
 
Self operator++ (int)
 Post increment the iterator. More...
 
bool operator== (const Self &it) const
 Check that two iterators are equal by comparing the outer and inner iterators. More...
 
bool operator!= (const Self &it) const
 Check that two iterators are different by comparing the outer and inner iterators. More...
 

Detailed Description

template<class OuterContainerIterator, class InnerContainerIterator>
class SBL::CADS::T_Container_of_containers_iterator_base< OuterContainerIterator, InnerContainerIterator >

Base representation of an iterator over nested containers.

It inherits from the SBL::inner_iterator base class that defines all the types required for defining an iterator.

Member Typedef Documentation

◆ Base

typedef SBL::iterator<InnerContainerIterator> Base

Base iterator declaring only the types.

◆ Self

typedef T_Container_of_containers_iterator_base<OuterContainerIterator, InnerContainerIterator> Self

The class itself.

Constructor & Destructor Documentation

◆ T_Container_of_containers_iterator_base() [1/2]

Constructs by copy.

◆ T_Container_of_containers_iterator_base() [2/2]

T_Container_of_containers_iterator_base ( const OuterContainerIterator &  it,
const OuterContainerIterator &  it_end 
)
inline

Constructs by initializing the start and the end of the outer container.

The iterator over the inner containers is automatically set to the beginning of the inner container pointed by it. If it points to the end of the outer container, a default iterator is created instead.

Member Function Documentation

◆ operator!=()

bool operator!= ( const Self it) const
inline

Check that two iterators are different by comparing the outer and inner iterators.

◆ operator*() [1/2]

InnerContainerIterator::reference operator* ( void  )
inline

Access to the data pointed by the iterator over the inner container.

◆ operator*() [2/2]

const InnerContainerIterator::reference operator* ( void  ) const
inline

Const access to the data pointed by the iterator over the inner container.

◆ operator++() [1/2]

T_Container_of_containers_iterator_base< OuterContainerIterator, InnerContainerIterator >::Self operator++ ( int  )
inline

Post increment the iterator.

◆ operator++() [2/2]

T_Container_of_containers_iterator_base< OuterContainerIterator, InnerContainerIterator >::Self & operator++ ( void  )
inline

Increment the iterator over the inner container.

If the end of the inner container is reached, the iterator over the outer container is incremented, and the iterator over the inner container is updated.

◆ operator==()

bool operator== ( const Self it) const
inline

Check that two iterators are equal by comparing the outer and inner iterators.