![]() |
aGrUM
0.16.0
|
Safe iterators for bijectionIterator. More...
#include <agrum/core/bijection.h>
Public Member Functions | |
template<typename Alloc , bool Gen> | |
INLINE | BijectionIteratorSafe (const BijectionImplementation< T1, T2, Alloc, Gen > &bijection) |
Constructor. More... | |
template<typename Alloc > | |
INLINE | BijectionIteratorSafe (const Bijection< T1, T2, Alloc > &bijection) |
Constructor. More... | |
Constructors and destructors | |
BijectionIteratorSafe () noexcept | |
Default constructor. More... | |
template<typename Alloc > | |
BijectionIteratorSafe (const Bijection< T1, T2, Alloc > &bijection) | |
Genereliazed default constructor. More... | |
BijectionIteratorSafe (const BijectionIteratorSafe< T1, T2 > &from) | |
Copy constructor. More... | |
BijectionIteratorSafe (BijectionIteratorSafe< T1, T2 > &&from) noexcept | |
Move constructor. More... | |
~BijectionIteratorSafe () noexcept | |
Class destructor. More... | |
Operators | |
BijectionIteratorSafe< T1, T2 > & | operator= (const BijectionIteratorSafe< T1, T2 > &toCopy) |
Copy operator. More... | |
BijectionIteratorSafe< T1, T2 > & | operator= (BijectionIteratorSafe< T1, T2 > &&toMove) noexcept |
Move operator. More... | |
BijectionIteratorSafe< T1, T2 > & | operator++ () noexcept |
Go to the next association, if it exists. More... | |
BijectionIteratorSafe< T1, T2 > & | operator+= (Size nb) noexcept |
Moves the iterator by nb elements. More... | |
BijectionIteratorSafe< T1, T2 > | operator+ (Size nb) noexcept |
Returns a new iterator. More... | |
bool | operator!= (const BijectionIteratorSafe< T1, T2 > &toCompare) const noexcept |
Inequality operator. More... | |
bool | operator== (const BijectionIteratorSafe< T1, T2 > &toCompare) const noexcept |
Equality operator. More... | |
Accessors/Modifiers | |
const T1 & | first () const |
Returns the first element of the current association. More... | |
const T2 & | second () const |
Returns the second element of the current association. More... | |
Public Types | |
using | iterator_category = std::forward_iterator_tag |
types for STL compliance More... | |
using | type1_type = T1 |
types for STL compliance More... | |
using | type1_reference = T1 & |
types for STL compliance More... | |
using | type1_const_reference = const T1 & |
types for STL compliance More... | |
using | type1_pointer = T1 * |
types for STL compliance More... | |
using | type1_const_pointer = const T1 * |
types for STL compliance More... | |
using | type2_type = T2 |
types for STL compliance More... | |
using | type2_reference = T2 & |
types for STL compliance More... | |
using | type2_const_reference = const T2 & |
types for STL compliance More... | |
using | type2_pointer = T2 * |
types for STL compliance More... | |
using | type2_const_pointer = const T2 * |
types for STL compliance More... | |
using | difference_type = std::ptrdiff_t |
types for STL compliance More... | |
Friends | |
template<typename TT1 , typename TT2 , typename Alloc , bool > | |
class | BijectionImplementation |
Safe iterators for bijectionIterator.
T1 | The first type of elements in the gum::Bjection. |
T2 | The second type of elements in the gum::Bjection. |
Definition at line 1411 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::difference_type = std::ptrdiff_t |
types for STL compliance
Definition at line 1429 of file bijection.h.
|
private |
Dummy classes that will enable discriminate without overhead between scalars and non-scalars functions second in iterators.
Definition at line 1438 of file bijection.h.
|
private |
Alias for one of the internal gum::HastTableIterator of the gum::Bijection.
Definition at line 1590 of file bijection.h.
|
private |
Alias for one of the internal gum::HashTable of the gum::Bijection.
Definition at line 1586 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::iterator_category = std::forward_iterator_tag |
types for STL compliance
Definition at line 1418 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type1_const_pointer = const T1* |
types for STL compliance
Definition at line 1423 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type1_const_reference = const T1& |
types for STL compliance
Definition at line 1421 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type1_pointer = T1* |
types for STL compliance
Definition at line 1422 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type1_reference = T1& |
types for STL compliance
Definition at line 1420 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type1_type = T1 |
types for STL compliance
Definition at line 1419 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type2_const_pointer = const T2* |
types for STL compliance
Definition at line 1428 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type2_const_reference = const T2& |
types for STL compliance
Definition at line 1426 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type2_pointer = T2* |
types for STL compliance
Definition at line 1427 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type2_reference = T2& |
types for STL compliance
Definition at line 1425 of file bijection.h.
using gum::BijectionIteratorSafe< T1, T2 >::type2_type = T2 |
types for STL compliance
Definition at line 1424 of file bijection.h.
|
private |
Begin constructor.
By default, the iterator points to the starting point of the gum::Bijection.
bijection | The gum::Bijection to iterate onto. |
|
noexcept |
Default constructor.
Definition at line 923 of file bijection_tpl.h.
gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const Bijection< T1, T2, Alloc > & | bijection | ) |
Genereliazed default constructor.
Alloc | The gum::Bijection allocator's type. |
INLINE gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const BijectionIteratorSafe< T1, T2 > & | from | ) |
Copy constructor.
from | The gum::BijectionIteratorSafe to copy. |
Definition at line 947 of file bijection_tpl.h.
|
noexcept |
Move constructor.
move constructor
from | The gum::BijectionIteratorSafe to move. |
Definition at line 955 of file bijection_tpl.h.
|
noexcept |
Class destructor.
Destructor.
Definition at line 963 of file bijection_tpl.h.
INLINE gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const BijectionImplementation< T1, T2, Alloc, Gen > & | bijection | ) |
Constructor.
Definition at line 930 of file bijection_tpl.h.
INLINE gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const Bijection< T1, T2, Alloc > & | bijection | ) |
Constructor.
Definition at line 939 of file bijection_tpl.h.
INLINE const T1 & gum::BijectionIteratorSafe< T1, T2 >::first | ( | ) | const |
Returns the first element of the current association.
return the first element of the current association
UndefinedIteratorValue | Raised when the iterator does not point to a valid element of the bijection. |
Definition at line 1022 of file bijection_tpl.h.
Referenced by gum::MultiDimBucket< GUM_SCALAR >::_replace(), and gum::ExactTerminalNodePolicy< GUM_SCALAR >::id().
|
noexcept |
Inequality operator.
Comparison of iterators.
toCompare | The gum::BijectionIteratorSafe to compare. |
Definition at line 1009 of file bijection_tpl.h.
|
noexcept |
Returns a new iterator.
returns a new iterator
If the iterator points to end(), the resulting iterator also points to end (). If there are nb or fewer elements to parse to reach the end of the bijection, then the resulting iterator points to gum::BijectionIteratorSafe::end().
nb | The number of steps by wich the iterator moves. |
Definition at line 1002 of file bijection_tpl.h.
|
noexcept |
Go to the next association, if it exists.
Go to the next association (if exists)
If the iterator points to end(), nothing happens.
Definition at line 986 of file bijection_tpl.h.
|
noexcept |
Moves the iterator by nb elements.
moves the iterator by nb elements
If the iterator points to end(), nothing is done. If there are nb or fewer elements to parse to reach the end of the bijection, then this method makes the iterator point to gum::BijectionIteratorSafe::end().
nb | The number of steps by wich the iterator moves. |
Definition at line 994 of file bijection_tpl.h.
INLINE BijectionIteratorSafe< T1, T2 > & gum::BijectionIteratorSafe< T1, T2 >::operator= | ( | const BijectionIteratorSafe< T1, T2 > & | toCopy | ) |
Copy operator.
toCopy | The gum::BijectionIteratorSafe to copy. |
Definition at line 970 of file bijection_tpl.h.
|
noexcept |
Move operator.
move operator
toMove | The gum::BijectionIteratorSafe to move. |
Definition at line 978 of file bijection_tpl.h.
|
noexcept |
Equality operator.
Comparison of iterators.
toCompare | The gum::BijectionIteratorSafe to compare. |
Definition at line 1016 of file bijection_tpl.h.
INLINE const T2 & gum::BijectionIteratorSafe< T1, T2 >::second | ( | ) | const |
Returns the second element of the current association.
return the second element of the current association
UndefinedIteratorValue | Raised when the iterator does not point to a valid element of the bijection. |
Definition at line 1028 of file bijection_tpl.h.
Referenced by gum::MultiDimBucket< GUM_SCALAR >::__eraseBuffer(), gum::MultiDimBucket< GUM_SCALAR >::__initializeBuffer(), gum::ExactTerminalNodePolicy< GUM_SCALAR >::value(), and gum::MultiDimBucket< GUM_SCALAR >::~MultiDimBucket().
|
friend |
Definition at line 1413 of file bijection.h.
|
private |
The hashTable iterator that actually does all the job.
Definition at line 1593 of file bijection.h.
Referenced by gum::BijectionIteratorSafe< NodeId, GUM_SCALAR >::BijectionIteratorSafe(), and gum::BijectionIteratorSafe< NodeId, GUM_SCALAR >::operator=().