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.
typedef SBL::iterator< InnerContainerIterator > Base
 Base iterator declaring only the types.

Constructors

 T_Container_of_containers_iterator_base (const Self &It)
 Constructs by copy.
 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.

Operators

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

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

template<class OuterContainerIterator, class InnerContainerIterator>
typedef SBL::iterator<InnerContainerIterator> Base

Base iterator declaring only the types.

◆ Self

template<class OuterContainerIterator, class InnerContainerIterator>
typedef T_Container_of_containers_iterator_base<OuterContainerIterator, InnerContainerIterator> Self

The class itself.

Constructor & Destructor Documentation

◆ T_Container_of_containers_iterator_base() [1/2]

template<class OuterContainerIterator, class InnerContainerIterator>
T_Container_of_containers_iterator_base ( const Self & It)
inline

Constructs by copy.

◆ T_Container_of_containers_iterator_base() [2/2]

template<class OuterContainerIterator, class InnerContainerIterator>
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!=()

template<class OuterContainerIterator, class InnerContainerIterator>
bool operator!= ( const Self & it) const
inline

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

◆ operator*() [1/2]

template<class OuterContainerIterator, class InnerContainerIterator>
InnerContainerIterator::reference operator* ( void )
inline

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

◆ operator*() [2/2]

template<class OuterContainerIterator, class InnerContainerIterator>
const InnerContainerIterator::reference operator* ( void ) const
inline

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

◆ operator++() [1/2]

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

Post increment the iterator.

◆ operator++() [2/2]

template<class OuterContainerIterator, class InnerContainerIterator>
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==()

template<class OuterContainerIterator, class InnerContainerIterator>
bool operator== ( const Self & it) const
inline

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