![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Unsafe iterators for the Set class. More...
#include <agrum/tools/core/set.h>
Public Member Functions | |
template<typename Alloc > | |
INLINE | SetIterator (const Set< Key, Alloc > &set, Position pos) |
Constructors / Destructors | |
SetIterator () noexcept | |
Default constructor: the iterator points toward nothing. More... | |
template<typename Alloc > | |
SetIterator (const Set< Key, Alloc > &from, Position pos=BEGIN) | |
Creates an iterator for a given set. More... | |
SetIterator (const SetIterator< Key > &from) noexcept | |
Copy constructor. More... | |
SetIterator (SetIterator< Key > &&from) noexcept | |
Move constructor. More... | |
~SetIterator () noexcept | |
Class destructor. More... | |
Operators | |
SetIterator< Key > & | operator= (const SetIterator< Key > &from) noexcept |
Assignment operator. More... | |
SetIterator< Key > & | operator= (SetIterator< Key > &&from) noexcept |
Assignment operator. More... | |
SetIterator< Key > & | operator++ () noexcept |
Increments the iterator. More... | |
SetIterator< Key > & | operator+= (Size i) noexcept |
Makes the iterator point to i elements further in the set. More... | |
SetIterator< Key > | operator+ (Size i) const noexcept |
Returns a new iterator. More... | |
bool | operator!= (const SetIterator< Key > &from) const noexcept |
Indicates whether two iterators point to different elements or sets. More... | |
bool | operator== (const SetIterator< 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... | |
class | SetIteratorSafe< Key > |
Unsafe iterators for the Set class.
Developers may consider using Set<x>::iterator instead of SetIterator<x>.
Key | The elements type. |
using gum::SetIterator< Key >::const_pointer = const value_type* |
using gum::SetIterator< Key >::const_reference = const value_type& |
using gum::SetIterator< Key >::difference_type = std::ptrdiff_t |
using gum::SetIterator< Key >::iterator_category = std::forward_iterator_tag |
using gum::SetIterator< Key >::pointer = value_type* |
using gum::SetIterator< Key >::reference = value_type& |
using gum::SetIterator< Key >::value_type = Key |
enum gum::SetIterator::Position |
An enumeration to position the iterator at the beginning or the end of the set.
Enumerator | |
---|---|
BEGIN | |
END |
Definition at line 1051 of file set.h.
|
noexcept |
Default constructor: the iterator points toward nothing.
Definition at line 169 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
gum::SetIterator< Key >::SetIterator | ( | const Set< Key, Alloc > & | from, |
Position | pos = BEGIN |
||
) |
|
noexcept |
Copy constructor.
from | The iterator to copy. |
Definition at line 183 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Move constructor.
from | The iterator to move. |
Definition at line 190 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Class destructor.
Definition at line 197 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE gum::SetIterator< Key >::SetIterator | ( | const Set< Key, Alloc > & | set, |
Position | pos | ||
) |
Definition at line 176 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
makes the iterator point toward nothing (in particular, it is not related anymore to its current set).
Definition at line 271 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Indicates whether two iterators point to different elements or sets.
from | The iterator to test for inequality. |
Definition at line 241 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const Key & gum::SetIterator< 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 254 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Returns a new iterator.
i | The number of increments. |
Definition at line 235 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Increments the iterator.
Definition at line 218 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Makes the iterator point to i elements further in the set.
i | The number of increments. |
Definition at line 228 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE const Key * gum::SetIterator< 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 262 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Assignment operator.
from | The iterator to copy. |
Definition at line 204 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Assignment operator.
from | The iterator to copy. |
Definition at line 211 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Indicates whether two iterators point toward the same element of a same set.
from | The iterator to test for equality. |
Definition at line 248 of file set_tpl.h.
References gum::Set< Key, Alloc >::emplace().
|
friend |
|
private |