aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::learning::IdCondSetIterator Class Reference

The iterators for IdSets. More...

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

Public Types

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

Public Member Functions

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

Detailed Description

The iterators for IdSets.

Definition at line 75 of file idCondSet.h.

Member Typedef Documentation

◆ const_pointer

types for STL compliance

Definition at line 84 of file idCondSet.h.

◆ const_reference

types for STL compliance

Definition at line 82 of file idCondSet.h.

◆ difference_type

types for STL compliance

Definition at line 85 of file idCondSet.h.

◆ iterator_category

using gum::learning::IdCondSetIterator::iterator_category = std::forward_iterator_tag

types for STL compliance

Definition at line 79 of file idCondSet.h.

◆ pointer

types for STL compliance

Definition at line 83 of file idCondSet.h.

◆ reference

types for STL compliance

Definition at line 81 of file idCondSet.h.

◆ value_type

types for STL compliance

Definition at line 80 of file idCondSet.h.

Constructor & Destructor Documentation

◆ IdCondSetIterator() [1/4]

gum::learning::IdCondSetIterator::IdCondSetIterator ( )

default constructor

Returns
an iterator pointing toward nothing.

Referenced by IdCondSetIterator(), IdCondSetIterator(), operator!=(), operator+(), operator++(), operator+=(), operator=(), operator=(), and operator==().

Here is the caller graph for this function:

◆ IdCondSetIterator() [2/4]

gum::learning::IdCondSetIterator::IdCondSetIterator ( const IdCondSet & idset)

Constructor for a begin.

Parameters
idsetThe IdCondSet to iterate over.

◆ IdCondSetIterator() [3/4]

gum::learning::IdCondSetIterator::IdCondSetIterator ( const IdCondSetIterator & from)

Copy constructor.

References IdCondSetIterator().

Here is the call graph for this function:

◆ IdCondSetIterator() [4/4]

gum::learning::IdCondSetIterator::IdCondSetIterator ( IdCondSetIterator && from)

move constructor

References IdCondSetIterator().

Here is the call graph for this function:

◆ ~IdCondSetIterator()

virtual gum::learning::IdCondSetIterator::~IdCondSetIterator ( )
virtual

destructor

Member Function Documentation

◆ operator!=()

bool gum::learning::IdCondSetIterator::operator!= ( const IdCondSetIterator & from) const

Checks whether two iterators point toward different elements.

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator*()

NodeId gum::learning::IdCondSetIterator::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+()

IdCondSetIterator gum::learning::IdCondSetIterator::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.

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator++()

IdCondSetIterator & gum::learning::IdCondSetIterator::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.

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator+=()

IdCondSetIterator & gum::learning::IdCondSetIterator::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.

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator=() [1/2]

IdCondSetIterator & gum::learning::IdCondSetIterator::operator= ( const IdCondSetIterator & from)

copy operator

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator=() [2/2]

IdCondSetIterator & gum::learning::IdCondSetIterator::operator= ( IdCondSetIterator && from)

move operator

References IdCondSetIterator().

Here is the call graph for this function:

◆ operator==()

bool gum::learning::IdCondSetIterator::operator== ( const IdCondSetIterator & from) const

Checks whether two iterators point toward the same elements.

References IdCondSetIterator().

Here is the call graph for this function:

◆ pos()

std::size_t gum::learning::IdCondSetIterator::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: