LIBINT 2.7.2
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
libint2::SubIteratorBase< T, Tr > Class Template Reference

SubIteratorBase<T> provides a base class for a sub-iterator class for T. More...

#include <iter.h>

Inheritance diagram for libint2::SubIteratorBase< T, Tr >:
Inheritance graph
[legend]
Collaboration diagram for libint2::SubIteratorBase< T, Tr >:
Collaboration graph
[legend]

Public Types

typedef T::iter_type iter_type
 
typedef Tr< T > TPolicy
 
typedef TPolicy::obj_stype tref
 
typedef TPolicy::subobj_stype iref
 
typedef const ConstructablePolymorphicallycp_rettype
 Return reference to ConstructablePolymorphically as object of this type.
 

Public Member Functions

 SubIteratorBase (const tref &)
 
const iref & elem () const
 Returns current element.
 
cp_rettype pelem () const override
 Returns current element. Implements SubIterator's pelem(). More...
 
unsigned int num_iter () const override
 Returns a number of iterations (number of elements in a set over which to iterate). More...
 
void init () override
 Initializes the iterator. More...
 
SubIteratoroperator++ () override
 Iterates to the next element. Only prefix form is provided. More...
 
 operator int () const override
 This is used to check whether current element exists. Returns 1 if it does. More...
 
virtual unsigned int num_iter () const =0
 Returns a number of iterations (number of elements in a set over which to iterate). More...
 
virtual void init ()=0
 Initializes the iterator. More...
 
virtual SubIteratoroperator++ ()=0
 Iterates to the next element. Only prefix form is provided. More...
 
virtual operator int () const =0
 This is used to check whether next element exists. Returns 1 if it does. More...
 
virtual const ConstructablePolymorphicallypelem () const
 Return current element via base class. More...
 

Protected Attributes

const tref obj_
 
std::vector< iref > subobj_
 

Detailed Description

template<class T, template< class > class Tr = Policy>
class libint2::SubIteratorBase< T, Tr >

SubIteratorBase<T> provides a base class for a sub-iterator class for T.

It iterates through T as if it were a set of some data of type T::iter_type. Traits of class T (ordering of T::iter_type, etc.) are provided by Tr<T>.

Member Function Documentation

◆ init()

template<class T , template< class > class P>
void libint2::SubIteratorBase< T, P >::init
overridevirtual

Initializes the iterator.

Implements libint2::SubIterator.

◆ num_iter()

template<class T , template< class > class P>
unsigned int libint2::SubIteratorBase< T, P >::num_iter
overridevirtual

Returns a number of iterations (number of elements in a set over which to iterate).

Implements libint2::SubIterator.

◆ operator int()

template<class T , template< class > class P>
libint2::SubIteratorBase< T, P >::operator int
overridevirtual

This is used to check whether current element exists. Returns 1 if it does.

Implements libint2::SubIterator.

◆ operator++()

template<class T , template< class > class P>
SubIterator & libint2::SubIteratorBase< T, P >::operator++
overridevirtual

Iterates to the next element. Only prefix form is provided.

Implements libint2::SubIterator.

◆ pelem()

template<class T , template< class > class P>
const SafePtr< ConstructablePolymorphically > libint2::SubIteratorBase< T, P >::pelem
overridevirtual

Returns current element. Implements SubIterator's pelem().

Reimplemented from libint2::SubIterator.


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