aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::learning::IdCondSetIterator< ALLOC > Class Template Reference

The iterators for IdSets. More...

#include <agrum/BN/learning/scores_and_tests/idSet.h>

Public Member Functions

Constructors / Destructors
 IdCondSetIterator ()
 default constructor More...
 
 IdCondSetIterator (const IdCondSet< ALLOC > &idset)
 Constructor for a begin. More...
 
 IdCondSetIterator (const IdCondSetIterator< ALLOC > &from)
 Copy constructor. More...
 
 IdCondSetIterator (IdCondSetIterator< ALLOC > &&from)
 move constructor More...
 
virtual ~IdCondSetIterator ()
 destructor More...
 
Operators
IdCondSetIterator< ALLOC > & operator= (const IdCondSetIterator< ALLOC > &from)
 copy operator More...
 
IdCondSetIterator< ALLOC > & operator= (IdCondSetIterator< ALLOC > &&from)
 move operator More...
 
NodeId operator* () const
 Gives access to the content of the iterator. More...
 
bool operator!= (const IdCondSetIterator< ALLOC > &from) const
 Checks whether two iterators point toward different elements. More...
 
bool operator== (const IdCondSetIterator< ALLOC > &from) const
 Checks whether two iterators point toward the same elements. More...
 
IdCondSetIterator< ALLOC > & operator++ ()
 Makes the iterator point to the next element in the IdCondSet. More...
 
IdCondSetIterator< ALLOC > & operator+= (const std::size_t i)
 Makes the iterator point to i elements further in the IdCondSet. More...
 
IdCondSetIterator< ALLOC > operator+ (const std::size_t i)
 Returns a new iterator pointing to i further elements in the IdCondSet. More...
 
Accessors / Modifiers
std::size_t pos () const
 Returns the position of the iterator in the IdCondSet. More...
 

Public Types

using iterator_category = std::forward_iterator_tag
 types for STL compliance More...
 
using value_type = NodeId
 types for STL compliance More...
 
using reference = NodeId &
 types for STL compliance More...
 
using const_reference = const NodeId &
 types for STL compliance More...
 
using pointer = NodeId *
 types for STL compliance More...
 
using const_pointer = const NodeId *
 types for STL compliance More...
 
using difference_type = std::ptrdiff_t
 types for STL compliance More...
 

Detailed Description

template<template< typename > class ALLOC = std::allocator>
class gum::learning::IdCondSetIterator< ALLOC >

The iterators for IdSets.

Definition at line 56 of file idCondSet.h.

Member Typedef Documentation

◆ const_pointer

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::const_pointer = const NodeId*

types for STL compliance

Definition at line 65 of file idCondSet.h.

◆ const_reference

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::const_reference = const NodeId&

types for STL compliance

Definition at line 63 of file idCondSet.h.

◆ difference_type

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::difference_type = std::ptrdiff_t

types for STL compliance

Definition at line 66 of file idCondSet.h.

◆ iterator_category

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::iterator_category = std::forward_iterator_tag

types for STL compliance

Definition at line 60 of file idCondSet.h.

◆ pointer

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::pointer = NodeId*

types for STL compliance

Definition at line 64 of file idCondSet.h.

◆ reference

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::reference = NodeId&

types for STL compliance

Definition at line 62 of file idCondSet.h.

◆ value_type

template<template< typename > class ALLOC = std::allocator>
using gum::learning::IdCondSetIterator< ALLOC >::value_type = NodeId

types for STL compliance

Definition at line 61 of file idCondSet.h.

Constructor & Destructor Documentation

◆ IdCondSetIterator() [1/4]

template<template< typename > class ALLOC = std::allocator>
gum::learning::IdCondSetIterator< ALLOC >::IdCondSetIterator ( )

default constructor

Returns
an iterator pointing toward nothing.

◆ IdCondSetIterator() [2/4]

template<template< typename > class ALLOC = std::allocator>
gum::learning::IdCondSetIterator< ALLOC >::IdCondSetIterator ( const IdCondSet< ALLOC > &  idset)

Constructor for a begin.

Parameters
idsetThe IdCondSet to iterate over.

◆ IdCondSetIterator() [3/4]

template<template< typename > class ALLOC = std::allocator>
gum::learning::IdCondSetIterator< ALLOC >::IdCondSetIterator ( const IdCondSetIterator< ALLOC > &  from)

Copy constructor.

◆ IdCondSetIterator() [4/4]

template<template< typename > class ALLOC = std::allocator>
gum::learning::IdCondSetIterator< ALLOC >::IdCondSetIterator ( IdCondSetIterator< ALLOC > &&  from)

move constructor

◆ ~IdCondSetIterator()

template<template< typename > class ALLOC = std::allocator>
virtual gum::learning::IdCondSetIterator< ALLOC >::~IdCondSetIterator ( )
virtual

destructor

Member Function Documentation

◆ operator!=()

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::IdCondSetIterator< ALLOC >::operator!= ( const IdCondSetIterator< ALLOC > &  from) const

Checks whether two iterators point toward different elements.

◆ operator*()

template<template< typename > class ALLOC = std::allocator>
NodeId gum::learning::IdCondSetIterator< ALLOC >::operator* ( ) const

Gives access to the content of the iterator.

Exceptions
UndefinedIteratorValueRaised if the iterator points to nothing.
Returns
Returns the content of the iterator.

◆ operator+()

template<template< typename > class ALLOC = std::allocator>
IdCondSetIterator< ALLOC > gum::learning::IdCondSetIterator< ALLOC >::operator+ ( const std::size_t  i)

Returns a new iterator pointing to i further elements in the IdCondSet.

Parameters
iThe number of steps to move the iterator.
Returns
Returns a new gum::IdCondSetIterator.

◆ operator++()

template<template< typename > class ALLOC = std::allocator>
IdCondSetIterator< ALLOC >& gum::learning::IdCondSetIterator< ALLOC >::operator++ ( )

Makes the iterator point to the next element in the IdCondSet.

for (iter = idset.begin(); iter != idset.end(); ++iter) {}

The above loop is guaranteed to parse the whole IdCondSet as long as no element is added to or deleted from the IdCondSet while being in the loop.

Returns
Returns this gum::IdCondSetIterator.

◆ operator+=()

template<template< typename > class ALLOC = std::allocator>
IdCondSetIterator< ALLOC >& gum::learning::IdCondSetIterator< ALLOC >::operator+= ( const std::size_t  i)

Makes the iterator point to i elements further in the IdCondSet.

Parameters
iThe number of steps to move the iterator.
Returns
Returns this gum::IdCondSetIterator.

◆ operator=() [1/2]

template<template< typename > class ALLOC = std::allocator>
IdCondSetIterator< ALLOC >& gum::learning::IdCondSetIterator< ALLOC >::operator= ( const IdCondSetIterator< ALLOC > &  from)

copy operator

◆ operator=() [2/2]

template<template< typename > class ALLOC = std::allocator>
IdCondSetIterator< ALLOC >& gum::learning::IdCondSetIterator< ALLOC >::operator= ( IdCondSetIterator< ALLOC > &&  from)

move operator

◆ operator==()

template<template< typename > class ALLOC = std::allocator>
bool gum::learning::IdCondSetIterator< ALLOC >::operator== ( const IdCondSetIterator< ALLOC > &  from) const

Checks whether two iterators point toward the same elements.

◆ pos()

template<template< typename > class ALLOC = std::allocator>
std::size_t gum::learning::IdCondSetIterator< ALLOC >::pos ( ) const

Returns the position of the iterator in the IdCondSet.

Returns
Returns the position of the iterator in the IdCondSet.
Exceptions
UndefinedIteratorValueRaised on end()

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