![]() |
aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
|
Safe iterators for bijectionIterator. More...
#include <agrum/base/core/bijection.h>
Public Types | |
| using | iterator_category = std::forward_iterator_tag |
| types for STL compliance | |
| using | type1_type = T1 |
| types for STL compliance | |
| using | type1_reference = T1& |
| types for STL compliance | |
| using | type1_const_reference = const T1& |
| types for STL compliance | |
| using | type1_pointer = T1* |
| types for STL compliance | |
| using | type1_const_pointer = const T1* |
| types for STL compliance | |
| using | type2_type = T2 |
| types for STL compliance | |
| using | type2_reference = T2& |
| types for STL compliance | |
| using | type2_const_reference = const T2& |
| types for STL compliance | |
| using | type2_pointer = T2* |
| types for STL compliance | |
| using | type2_const_pointer = const T2* |
| types for STL compliance | |
| using | difference_type = std::ptrdiff_t |
| types for STL compliance | |
Public Member Functions | |
Constructors and destructors | |
| BijectionIteratorSafe () noexcept | |
| Default constructor. | |
| BijectionIteratorSafe (const Bijection< T1, T2 > &bijection) | |
| Begin constructor. | |
| BijectionIteratorSafe (const BijectionIteratorSafe< T1, T2 > &from) | |
| Copy constructor. | |
| BijectionIteratorSafe (BijectionIteratorSafe< T1, T2 > &&from) noexcept | |
| Move constructor. | |
| ~BijectionIteratorSafe () noexcept | |
| Class destructor. | |
Operators | |
| BijectionIteratorSafe< T1, T2 > & | operator= (const BijectionIteratorSafe< T1, T2 > &toCopy) |
| Copy operator. | |
| BijectionIteratorSafe< T1, T2 > & | operator= (BijectionIteratorSafe< T1, T2 > &&toMove) noexcept |
| Move operator. | |
| BijectionIteratorSafe< T1, T2 > & | operator++ () noexcept |
| Go to the next association, if it exists. | |
| BijectionIteratorSafe< T1, T2 > & | operator+= (Size nb) noexcept |
| Moves the iterator by nb elements. | |
| BijectionIteratorSafe< T1, T2 > | operator+ (Size nb) noexcept |
| Returns a new iterator. | |
| bool | operator!= (const BijectionIteratorSafe< T1, T2 > &toCompare) const noexcept |
| Inequality operator. | |
| bool | operator== (const BijectionIteratorSafe< T1, T2 > &toCompare) const noexcept |
| Equality operator. | |
Accessors/Modifiers | |
| const T1 & | first () const |
| Returns the first element of the current association. | |
| const T2 & | second () const |
| Returns the second element of the current association. | |
Private Types | |
| using | Getter = BijectionIteratorGet< std::is_scalar< T1 >::value && std::is_scalar< T2 >::value > |
| Dummy classes that will enable discriminate without overhead between scalars and non-scalars functions second in iterators. | |
| using | HashTable12 |
| Alias for one of the internal gum::HashTable of the gum::Bijection. | |
| using | HashIter = typename HashTable12::const_iterator_safe |
| Alias for one of the internal gum::HastTableIterator of the gum::Bijection. | |
Private Member Functions | |
| template<bool Gen> | |
| BijectionIteratorSafe (const BijectionImplementation< T1, T2, Gen > &bijection) | |
| Begin constructor. | |
Private Attributes | |
| HashIter | _iter_ |
| The hashTable iterator that actually does all the job. | |
Friends | |
| template<typename TT1, typename TT2, 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 1240 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::difference_type = std::ptrdiff_t |
types for STL compliance
Definition at line 1258 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 1266 of file bijection.h.
|
private |
Alias for one of the internal gum::HastTableIterator of the gum::Bijection.
Definition at line 1420 of file bijection.h.
|
private |
Alias for one of the internal gum::HashTable of the gum::Bijection.
Definition at line 1413 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::iterator_category = std::forward_iterator_tag |
types for STL compliance
Definition at line 1247 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type1_const_pointer = const T1* |
types for STL compliance
Definition at line 1252 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type1_const_reference = const T1& |
types for STL compliance
Definition at line 1250 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type1_pointer = T1* |
types for STL compliance
Definition at line 1251 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type1_reference = T1& |
types for STL compliance
Definition at line 1249 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type1_type = T1 |
types for STL compliance
Definition at line 1248 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type2_const_pointer = const T2* |
types for STL compliance
Definition at line 1257 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type2_const_reference = const T2& |
types for STL compliance
Definition at line 1255 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type2_pointer = T2* |
types for STL compliance
Definition at line 1256 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type2_reference = T2& |
types for STL compliance
Definition at line 1254 of file bijection.h.
| using gum::BijectionIteratorSafe< T1, T2 >::type2_type = T2 |
types for STL compliance
Definition at line 1253 of file bijection.h.
|
private |
Begin constructor.
Constructor.
By default, the iterator points to the starting point of the gum::Bijection.
| bijection | The gum::Bijection to iterate onto. |
Definition at line 823 of file bijection_tpl.h.
References BijectionIteratorSafe(), _iter_, and BijectionImplementation.
Referenced by BijectionIteratorSafe(), BijectionIteratorSafe(), BijectionIteratorSafe(), BijectionIteratorSafe(), BijectionIteratorSafe(), ~BijectionIteratorSafe(), operator!=(), operator+(), operator++(), operator+=(), operator=(), operator=(), and operator==().
|
explicitnoexcept |
Default constructor.
Definition at line 816 of file bijection_tpl.h.
References BijectionIteratorSafe().
| gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const Bijection< T1, T2 > & | bijection | ) |
Begin constructor.
Constructor.
By default, the iterator points to the starting point of the gum::Bijection.
| bijection | The gum::Bijection to iterate onto. |
Definition at line 831 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
| gum::BijectionIteratorSafe< T1, T2 >::BijectionIteratorSafe | ( | const BijectionIteratorSafe< T1, T2 > & | from | ) |
Copy constructor.
| from | The gum::BijectionIteratorSafe to copy. |
Definition at line 838 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
noexcept |
Move constructor.
move constructor
| from | The gum::BijectionIteratorSafe to move. |
Definition at line 845 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
noexcept |
Class destructor.
Destructor.
Definition at line 852 of file bijection_tpl.h.
References BijectionIteratorSafe().
| 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 906 of file bijection_tpl.h.
References _iter_.
Referenced by operator=().
|
noexcept |
Inequality operator.
Comparison of iterators.
| toCompare | The gum::BijectionIteratorSafe to compare. |
Definition at line 892 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
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 which the iterator moves. |
Definition at line 886 of file bijection_tpl.h.
References BijectionIteratorSafe().
|
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 872 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
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 which the iterator moves. |
Definition at line 879 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
noexcept |
Move operator.
move operator
| toMove | The gum::BijectionIteratorSafe to move. |
Definition at line 864 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
|
default |
Copy operator.
| toCopy | The gum::BijectionIteratorSafe to copy. |
References BijectionIteratorSafe(), first(), and second().
|
noexcept |
Equality operator.
Comparison of iterators.
| toCompare | The gum::BijectionIteratorSafe to compare. |
Definition at line 899 of file bijection_tpl.h.
References BijectionIteratorSafe(), and _iter_.
| 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 912 of file bijection_tpl.h.
References _iter_, and gum::BijectionIteratorGet< gen >::op_second().
Referenced by operator=().
|
friend |
Definition at line 1242 of file bijection.h.
References BijectionImplementation.
Referenced by BijectionIteratorSafe(), and BijectionImplementation.
|
private |
The hashTable iterator that actually does all the job.
Definition at line 1423 of file bijection.h.
Referenced by BijectionIteratorSafe(), BijectionIteratorSafe(), BijectionIteratorSafe(), BijectionIteratorSafe(), first(), operator!=(), operator++(), operator+=(), operator=(), operator==(), and second().