![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Safe iterators for the Set classDevelopers may consider using Set<x>::iterator_safe instead of SetIteratorSafe<x>. More...
#include <agrum/tools/core/set.h>
Public Member Functions | |
template<typename Alloc > | |
INLINE | SetIteratorSafe (const Set< Key, Alloc > &set, Position pos) |
Constructors / Destructors | |
SetIteratorSafe () | |
Default constructor: the iterator points toward nothing. More... | |
template<typename Alloc > | |
SetIteratorSafe (const Set< Key, Alloc > &from, Position pos=BEGIN) | |
Creates an iterator for a given set. More... | |
SetIteratorSafe (const SetIteratorSafe< Key > &from) | |
Copy constructor. More... | |
SetIteratorSafe (const SetIterator< Key > &from) | |
Copy constructor. More... | |
SetIteratorSafe (SetIteratorSafe< Key > &&from) | |
Move constructor. More... | |
~SetIteratorSafe () noexcept | |
Class destructor. More... | |
Operators | |
SetIteratorSafe< Key > & | operator= (const SetIteratorSafe< Key > &from) |
Assignment operator. More... | |
SetIteratorSafe< Key > & | operator= (const SetIterator< Key > &from) |
Assignment operator. More... | |
SetIteratorSafe< Key > & | operator= (SetIteratorSafe< Key > &&from) noexcept |
Assignment operator. More... | |
SetIteratorSafe< Key > & | operator++ () noexcept |
Increments the iterator. More... | |
SetIteratorSafe< Key > & | operator+= (Size i) noexcept |
Makes the iterator point to i elements further in the set. More... | |
SetIteratorSafe< Key > | operator+ (Size i) const |
Returns a new iterator. More... | |
bool | operator!= (const SetIteratorSafe< Key > &from) const noexcept |
Indicates whether two iterators point to different elements or sets. More... | |
bool | operator== (const SetIteratorSafe< Key > &from) const noexcept |
Indicates whether two iterators point toward the same element of a same set. More... | |
const Key & | operator* () const |
Returns the element pointed to by the iterator. More... | |
const Key * | operator-> () const |
Returns a pointer to the element pointed to by the iterator. More... | |
Accessors / Modifiers | |
void | clear () noexcept |
makes the iterator point toward nothing (in particular, it is not related anymore to its current set). More... | |
Public Types | |
enum | Position { BEGIN, END } |
An enumeration to position the iterator at the beginning or the end of the set. More... | |
using | iterator_category = std::forward_iterator_tag |
Types for STL compliance. More... | |
using | value_type = Key |
Types for STL compliance. More... | |
using | reference = value_type & |
Types for STL compliance. More... | |
using | const_reference = const value_type & |
Types for STL compliance. More... | |
using | pointer = value_type * |
Types for STL compliance. More... | |
using | const_pointer = const value_type * |
Types for STL compliance. More... | |
using | difference_type = std::ptrdiff_t |
Types for STL compliance. More... | |
Friends | |
template<typename K , typename A > | |
class | Set |
For efficiency, Set should be able to modify the hash table iterator. More... | |
Safe iterators for the Set class
Developers may consider using Set<x>::iterator_safe instead of SetIteratorSafe<x>.
Key | The elements type. |
using gum::SetIteratorSafe< Key >::const_pointer = const value_type* |
using gum::SetIteratorSafe< Key >::const_reference = const value_type& |
using gum::SetIteratorSafe< Key >::difference_type = std::ptrdiff_t |
using gum::SetIteratorSafe< Key >::iterator_category = std::forward_iterator_tag |
using gum::SetIteratorSafe< Key >::pointer = value_type* |
using gum::SetIteratorSafe< Key >::reference = value_type& |
using gum::SetIteratorSafe< Key >::value_type = Key |
enum gum::SetIteratorSafe::Position |
INLINE gum::SetIteratorSafe< Key >::SetIteratorSafe | ( | ) |
Default constructor: the iterator points toward nothing.
Definition at line 39 of file set_tpl.h.
gum::SetIteratorSafe< Key >::SetIteratorSafe | ( | const Set< Key, Alloc > & | from, |
Position | pos = BEGIN |
||
) |
INLINE gum::SetIteratorSafe< Key >::SetIteratorSafe | ( | const SetIteratorSafe< Key > & | from | ) |
Copy constructor.
from | The iterator to copy. |
Definition at line 54 of file set_tpl.h.
|
explicit |
Copy constructor.
from | The iterator to copy. |
Definition at line 61 of file set_tpl.h.
INLINE gum::SetIteratorSafe< Key >::SetIteratorSafe | ( | SetIteratorSafe< Key > && | from | ) |
Move constructor.
from | The iterator to move. |
Definition at line 68 of file set_tpl.h.
|
noexcept |
Class destructor.
Definition at line 75 of file set_tpl.h.
INLINE gum::SetIteratorSafe< Key >::SetIteratorSafe | ( | const Set< Key, Alloc > & | set, |
Position | pos | ||
) |
Definition at line 46 of file set_tpl.h.
|
noexcept |
makes the iterator point toward nothing (in particular, it is not related anymore to its current set).
Definition at line 159 of file set_tpl.h.
|
noexcept |
Indicates whether two iterators point to different elements or sets.
from | The iterator to test for inequality. |
Definition at line 128 of file set_tpl.h.
INLINE const Key & gum::SetIteratorSafe< Key >::operator* | ( | ) | const |
Returns the element pointed to by the iterator.
UndefinedIteratorValue | Raised if the iterator does not point to an element of the set (for instance if the set or the element previously pointed to by the iterator have been deleted). |
Definition at line 142 of file set_tpl.h.
INLINE SetIteratorSafe< Key > gum::SetIteratorSafe< Key >::operator+ | ( | Size | i | ) | const |
|
noexcept |
|
noexcept |
Makes the iterator point to i elements further in the set.
i | The number of increments. |
Definition at line 114 of file set_tpl.h.
INLINE const Key * gum::SetIteratorSafe< Key >::operator-> | ( | ) | const |
Returns a pointer to the element pointed to by the iterator.
UndefinedIteratorValue | Raised if the iterator does not point to an element of the set (for instance if the set or the element previously pointed to by the iterator have been deleted). |
Definition at line 150 of file set_tpl.h.
INLINE SetIteratorSafe< Key > & gum::SetIteratorSafe< Key >::operator= | ( | const SetIteratorSafe< Key > & | from | ) |
INLINE SetIteratorSafe< Key > & gum::SetIteratorSafe< Key >::operator= | ( | const SetIterator< Key > & | from | ) |
|
noexcept |
|
noexcept |
Indicates whether two iterators point toward the same element of a same set.
from | The iterator to test for equality. |
Definition at line 136 of file set_tpl.h.
|
private |