aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::SequenceIteratorSafe< Key > Class Template Reference

Safe iterators for Sequence. More...

#include <agrum/tools/core/sequence.h>

+ Collaboration diagram for gum::SequenceIteratorSafe< Key >:

Public Member Functions

template<typename Alloc , bool Gen>
INLINE SequenceIteratorSafe (const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos) noexcept
 
template<typename Alloc >
INLINE SequenceIteratorSafe (const Sequence< Key, Alloc > &seq, Idx pos) noexcept
 
Constructors / Destructors
template<typename Alloc >
 SequenceIteratorSafe (const Sequence< Key, Alloc > &seq, Idx pos=0) noexcept
 Constructor, always give a valid iterator (even if pos too large). More...
 
 SequenceIteratorSafe (const SequenceIteratorSafe< Key > &source) noexcept
 Copy constructor. More...
 
 SequenceIteratorSafe (SequenceIteratorSafe< Key > &&source) noexcept
 Move constructor. More...
 
 ~SequenceIteratorSafe () noexcept
 Class destructor. More...
 
Operators
SequenceIteratorSafe< Key > & operator= (const SequenceIteratorSafe< Key > &source) noexcept
 Copy operator. More...
 
SequenceIteratorSafe< Key > & operator= (SequenceIteratorSafe< Key > &&source) noexcept
 Move operator. More...
 
SequenceIteratorSafe< Key > & operator++ () noexcept
 Point the iterator to the next value in the sequence. More...
 
SequenceIteratorSafe< Key > & operator-- () noexcept
 Point the iterator to the preceding value in the sequence. More...
 
SequenceIteratorSafe< Key > & operator+= (Size nb) noexcept
 Makes the iterator point to i elements further in the sequence. More...
 
SequenceIteratorSafe< Key > & operator-= (Size nb) noexcept
 Makes the iterator point to i elements further in the sequence. More...
 
SequenceIteratorSafe< Key > operator+ (Size nb) noexcept
 Returns a new iterator. More...
 
SequenceIteratorSafe< Key > operator- (Size nb) noexcept
 Returns a new iterator. More...
 
bool operator!= (const SequenceIteratorSafe< Key > &source) const noexcept
 Checks whether two iterators are pointing to different elements. More...
 
bool operator== (const SequenceIteratorSafe< Key > &source) const noexcept
 Checks whether two iterators are pointing to the same elements. More...
 
const Key & operator* () const
 Returns the value pointed to by the iterator. More...
 
const Key * operator-> () const
 Returns the value pointed to by the iterator (works only for non-scalars). More...
 
Accessors / Modifiers
Idx pos () const
 Returns the position of the iterator in the sequence. More...
 

Public Types

using iterator_category = std::bidirectional_iterator_tag
 types for STL compliance More...
 
using value_type = Key
 types for STL compliance More...
 
using reference = Key &
 types for STL compliance More...
 
using const_reference = const Key &
 types for STL compliance More...
 
using pointer = Key *
 types for STL compliance More...
 
using const_pointer = const Key *
 types for STL compliance More...
 
using difference_type = std::ptrdiff_t
 types for STL compliance More...
 

Friends

template<typename K , typename A , bool >
class SequenceImplementation
 Friend to speed up access. More...
 

Detailed Description

template<typename Key>
class gum::SequenceIteratorSafe< Key >

Safe iterators for Sequence.

This iterator enables to parse the elements in the sequence. Note that this is similar to a const safe iterator because the elements that can be accessed in the sequence are constant.

Usage example:
// creation of a sequence
Sequence<int> seq { 1, 2, 3, 4 };
Sequence<string> seq2;
// creation of iterators
auto iter1 = seq.beginSafe (); // points to 1
auto iiter2 = iter1;
auto iiter3 = std::move ( iter1 );
// parsing the sequence
for ( auto iter = seq.beginSafe (); iter != seq.endSafe (); ++iter )
std::cout << *iter << std::endl;
for ( auto iter = seq.rbeginSafe (); iter != seq.rend (); --iter )
std::cout << *iter << std::endl;
for ( auto iter = seq.beginSafe (); iter != seq.end (); ++iter )
std::cout << iter->size () << std::endl;
Template Parameters
KeyThe type of elements stored in the gum::Sequence.

Definition at line 1199 of file sequence.h.

Member Typedef Documentation

◆ const_pointer

template<typename Key>
using gum::SequenceIteratorSafe< Key >::const_pointer = const Key*

types for STL compliance

Definition at line 1212 of file sequence.h.

◆ const_reference

template<typename Key>
using gum::SequenceIteratorSafe< Key >::const_reference = const Key&

types for STL compliance

Definition at line 1210 of file sequence.h.

◆ difference_type

template<typename Key>
using gum::SequenceIteratorSafe< Key >::difference_type = std::ptrdiff_t

types for STL compliance

Definition at line 1213 of file sequence.h.

◆ Getter

template<typename Key>
using gum::SequenceIteratorSafe< Key >::Getter = SequenceIteratorGet< std::is_scalar< Key >::value >
private

The Getter used by this iterator.

Definition at line 1218 of file sequence.h.

◆ iterator_category

template<typename Key>
using gum::SequenceIteratorSafe< Key >::iterator_category = std::bidirectional_iterator_tag

types for STL compliance

Definition at line 1207 of file sequence.h.

◆ pointer

template<typename Key>
using gum::SequenceIteratorSafe< Key >::pointer = Key*

types for STL compliance

Definition at line 1211 of file sequence.h.

◆ reference

template<typename Key>
using gum::SequenceIteratorSafe< Key >::reference = Key&

types for STL compliance

Definition at line 1209 of file sequence.h.

◆ value_type

template<typename Key>
using gum::SequenceIteratorSafe< Key >::value_type = Key

types for STL compliance

Definition at line 1208 of file sequence.h.

Constructor & Destructor Documentation

◆ SequenceIteratorSafe() [1/6]

template<typename Key>
template<typename Alloc , bool Gen>
gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( const SequenceImplementation< Key, Alloc, Gen > &  seq,
Idx  pos = 0 
)
privatenoexcept

Constructor, always give a valid iterator (even if pos too large).

Warning
if pos is greater than the size of the sequence, the iterator is made pointing to end().
Template Parameters
AllocThe sequence allocator.
GenUsed for meta-programation.
Parameters
seqThe sequence.
posIndicates to which position of the sequence the iterator should be pointing. By default, the iterator points to begin().

◆ SequenceIteratorSafe() [2/6]

template<typename Key>
template<typename Alloc >
gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( const Sequence< Key, Alloc > &  seq,
Idx  pos = 0 
)
noexcept

Constructor, always give a valid iterator (even if pos too large).

Warning
if pos is greater than the size of the sequence, the iterator is made pointing to end().
Parameters
seqthe sequence
posindicates to which position of the sequence the iterator should be pointing. By default, the iterator points to begin()
Template Parameters
AllocThe sequence allocator.

◆ SequenceIteratorSafe() [3/6]

template<typename Key>
INLINE gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( const SequenceIteratorSafe< Key > &  source)
noexcept

Copy constructor.

Parameters
sourceThe iterator to copy.

Definition at line 100 of file sequence_tpl.h.

101  :
102  _iterator_{source._iterator_},
103  _seq_{source._seq_} {
104  GUM_CONS_CPY(SequenceIteratorSafe);
105  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
SequenceIteratorSafe(const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos=0) noexcept
Constructor, always give a valid iterator (even if pos too large).

◆ SequenceIteratorSafe() [4/6]

template<typename Key>
INLINE gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( SequenceIteratorSafe< Key > &&  source)
noexcept

Move constructor.

Parameters
sourceThe iterator to move.

Definition at line 109 of file sequence_tpl.h.

110  :
111  _iterator_{source._iterator_},
112  _seq_{source._seq_} {
113  GUM_CONS_MOV(SequenceIteratorSafe);
114  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
SequenceIteratorSafe(const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos=0) noexcept
Constructor, always give a valid iterator (even if pos too large).

◆ ~SequenceIteratorSafe()

template<typename Key >
INLINE gum::SequenceIteratorSafe< Key >::~SequenceIteratorSafe ( )
noexcept

Class destructor.

Definition at line 118 of file sequence_tpl.h.

118  {
119  GUM_DESTRUCTOR(SequenceIteratorSafe);
120  }
SequenceIteratorSafe(const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos=0) noexcept
Constructor, always give a valid iterator (even if pos too large).

◆ SequenceIteratorSafe() [5/6]

template<typename Key>
template<typename Alloc , bool Gen>
INLINE gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( const SequenceImplementation< Key, Alloc, Gen > &  seq,
Idx  pos 
)
noexcept

Definition at line 66 of file sequence_tpl.h.

68  :
69  _seq_{
70  reinterpret_cast< const SequenceImplementation< Key,
71  std::allocator< Key >,
72  std::is_scalar< Key >::value >* >(&seq)} {
73  GUM_CONSTRUCTOR(SequenceIteratorSafe);
74 
75  if (pos > _seq_->size())
76  _iterator_ = _seq_->size(); // make the iterator point to end
77  else
78  _iterator_ = pos;
79  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx pos() const
Returns the position of the iterator in the sequence.
Definition: sequence_tpl.h:211
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
friend class SequenceImplementation
Friend to speed up access.
Definition: sequence.h:1202
SequenceIteratorSafe(const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos=0) noexcept
Constructor, always give a valid iterator (even if pos too large).

◆ SequenceIteratorSafe() [6/6]

template<typename Key>
template<typename Alloc >
INLINE gum::SequenceIteratorSafe< Key >::SequenceIteratorSafe ( const Sequence< Key, Alloc > &  seq,
Idx  pos 
)
noexcept

Definition at line 84 of file sequence_tpl.h.

85  :
86  _seq_{
87  reinterpret_cast< const SequenceImplementation< Key,
88  std::allocator< Key >,
89  std::is_scalar< Key >::value >* >(&seq)} {
90  GUM_CONSTRUCTOR(SequenceIteratorSafe);
91 
92  if (pos > _seq_->size())
93  _iterator_ = _seq_->size(); // make the iterator point to end
94  else
95  _iterator_ = pos;
96  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx pos() const
Returns the position of the iterator in the sequence.
Definition: sequence_tpl.h:211
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
friend class SequenceImplementation
Friend to speed up access.
Definition: sequence.h:1202
SequenceIteratorSafe(const SequenceImplementation< Key, Alloc, Gen > &seq, Idx pos=0) noexcept
Constructor, always give a valid iterator (even if pos too large).

Member Function Documentation

◆ _setAtEnd_()

template<typename Key >
INLINE void gum::SequenceIteratorSafe< Key >::_setAtEnd_ ( )
privatenoexcept

The iterator points to the end (which is pos size()-1).

Definition at line 236 of file sequence_tpl.h.

236  {
237  _iterator_ = _seq_->size();
238  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ _setAtRend_()

template<typename Key >
INLINE void gum::SequenceIteratorSafe< Key >::_setAtRend_ ( )
privatenoexcept

The iterator points to rend.

Definition at line 230 of file sequence_tpl.h.

230  {
231  _iterator_ = std::numeric_limits< Idx >::max();
232  }
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ _setPos_()

template<typename Key >
INLINE void gum::SequenceIteratorSafe< Key >::_setPos_ ( Idx  pos)
privatenoexcept

The iterator points to the posth element (0 = beginning of the sequence).

Definition at line 221 of file sequence_tpl.h.

221  {
222  if (pos > _seq_->size())
223  _iterator_ = _seq_->size();
224  else
225  _iterator_ = pos;
226  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx pos() const
Returns the position of the iterator in the sequence.
Definition: sequence_tpl.h:211
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator!=()

template<typename Key>
INLINE bool gum::SequenceIteratorSafe< Key >::operator!= ( const SequenceIteratorSafe< Key > &  source) const
noexcept

Checks whether two iterators are pointing to different elements.

Parameters
sourceThe iterator to test for inequality.
Returns
Returns true if both iterators are not equal.

Definition at line 204 of file sequence_tpl.h.

205  {
206  return !operator==(source);
207  }
bool operator==(const SequenceIteratorSafe< Key > &source) const noexcept
Checks whether two iterators are pointing to the same elements.
Definition: sequence_tpl.h:193

◆ operator*()

template<typename Key >
INLINE const Key & gum::SequenceIteratorSafe< Key >::operator* ( ) const

Returns the value pointed to by the iterator.

Returns
Returns the value pointed to by the iterator.
Exceptions
UndefinedIteratorValueRaised on end() or rend().

Definition at line 242 of file sequence_tpl.h.

242  {
243  return Getter::op_star(_seq_->_v_[pos()]);
244  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
std::vector< Key *, typename Alloc::template rebind< Key *>::other > _v_
The set of the elements stored into the sequence.
Definition: sequence.h:501
Idx pos() const
Returns the position of the iterator in the sequence.
Definition: sequence_tpl.h:211

◆ operator+()

template<typename Key >
INLINE SequenceIteratorSafe< Key > gum::SequenceIteratorSafe< Key >::operator+ ( Size  nb)
noexcept

Returns a new iterator.

Warning
The created iterator should point outside the Sequence, then it is set either to end or rend, depending on the sign of nb.
Parameters
nbThe number of steps the created iterator is ahead of this.
Returns
Returns a new iterator.

Definition at line 181 of file sequence_tpl.h.

181  {
182  return SequenceIteratorSafe< Key >{*this} += nb;
183  }

◆ operator++()

template<typename Key >
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator++ ( )
noexcept

Point the iterator to the next value in the sequence.

Warning
if the iterator already points to end(), it is unaltered.
Returns
Returns this iterator.

Definition at line 142 of file sequence_tpl.h.

142  {
143  if (_iterator_ < _seq_->size())
144  ++_iterator_;
145  else
146  _iterator_ = _seq_->size();
147 
148  return *this;
149  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator+=()

template<typename Key >
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator+= ( Size  nb)
noexcept

Makes the iterator point to i elements further in the sequence.

Warning
If moving the iterator nb would make it point outside the Sequence, then iterator is moved to end or rend, depending on the sign of nb.
Parameters
nbThe number of steps to move the iterator.
Returns
Returns this iterator.

Definition at line 161 of file sequence_tpl.h.

161  {
162  if (_iterator_ == std::numeric_limits< Idx >::max()) return *this;
163  _iterator_ += nb;
164  if (_iterator_ > _seq_->size()) _iterator_ = _seq_->size();
165 
166  return *this;
167  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator-()

template<typename Key >
INLINE SequenceIteratorSafe< Key > gum::SequenceIteratorSafe< Key >::operator- ( Size  nb)
noexcept

Returns a new iterator.

Warning
The created iterator should point outside the Sequence, then it is set either to end or rend, depending on the sign of nb.
Parameters
nbThe number of steps the created iterator is behind of this. Returns a new iterator.

Definition at line 187 of file sequence_tpl.h.

187  {
188  return SequenceIteratorSafe< Key >{*this} -= nb;
189  }

◆ operator--()

template<typename Key >
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator-- ( )
noexcept

Point the iterator to the preceding value in the sequence.

Warning
If the iterator already points to rend(), it is unaltered.
Returns
Returns this iterator.

Definition at line 153 of file sequence_tpl.h.

153  {
154  if (_iterator_ != std::numeric_limits< Idx >::max()) --_iterator_;
155 
156  return *this;
157  }
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator-=()

template<typename Key >
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator-= ( Size  nb)
noexcept

Makes the iterator point to i elements further in the sequence.

Warning
If moving the iterator nb would make it point outside the Sequence, then iterator is moved to end or rend, depending on the sign of nb.
Parameters
nbThe number of steps to move the iterator.
Returns
Returns this iterator.

Definition at line 171 of file sequence_tpl.h.

171  {
172  if (_iterator_ == std::numeric_limits< Idx >::max()) return *this;
173  _iterator_ -= nb;
174  if (_iterator_ > _seq_->size()) _iterator_ = std::numeric_limits< Idx >::max();
175 
176  return *this;
177  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator->()

template<typename Key >
INLINE const Key * gum::SequenceIteratorSafe< Key >::operator-> ( ) const

Returns the value pointed to by the iterator (works only for non-scalars).

Returns
Returns the value pointed to by the iterator (works only for non-scalars).

Definition at line 248 of file sequence_tpl.h.

248  {
249  return Getter::op_arrow(_seq_->_v_[pos()]);
250  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
std::vector< Key *, typename Alloc::template rebind< Key *>::other > _v_
The set of the elements stored into the sequence.
Definition: sequence.h:501
Idx pos() const
Returns the position of the iterator in the sequence.
Definition: sequence_tpl.h:211

◆ operator=() [1/2]

template<typename Key>
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator= ( const SequenceIteratorSafe< Key > &  source)
noexcept

Copy operator.

Parameters
sourceThe iterator to copy.
Returns
Returns this iterator.

Definition at line 125 of file sequence_tpl.h.

125  {
126  _iterator_ = source._iterator_;
127  _seq_ = source._seq_;
128  return *this;
129  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator=() [2/2]

template<typename Key>
INLINE SequenceIteratorSafe< Key > & gum::SequenceIteratorSafe< Key >::operator= ( SequenceIteratorSafe< Key > &&  source)
noexcept

Move operator.

Parameters
sourceThe iterator to move.
Returns
Returns this iterator.

Definition at line 134 of file sequence_tpl.h.

134  {
135  _iterator_ = source._iterator_;
136  _seq_ = source._seq_;
137  return *this;
138  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408

◆ operator==()

template<typename Key>
INLINE bool gum::SequenceIteratorSafe< Key >::operator== ( const SequenceIteratorSafe< Key > &  source) const
noexcept

Checks whether two iterators are pointing to the same elements.

Parameters
sourceThe iterator to test for equality.
Returns
Returns true if both iterators are equal.

Definition at line 193 of file sequence_tpl.h.

194  {
195  if (_seq_->empty()) return true; // all iterators are the same if seq is empty
196 
197  if ((_iterator_ != source._iterator_) || (_seq_ != source._seq_)) return false;
198 
199  return true;
200  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
bool empty() const noexcept
Return true if empty.
Definition: sequence_tpl.h:43

◆ pos()

template<typename Key >
INLINE Idx gum::SequenceIteratorSafe< Key >::pos ( ) const

Returns the position of the iterator in the sequence.

Returns
Returns the position of the iterator in the sequence.
Exceptions
UndefinedIteratorValueRaised on end() or rend().

Definition at line 211 of file sequence_tpl.h.

211  {
212  if (_iterator_ >= _seq_->size()) {
213  GUM_ERROR(UndefinedIteratorValue, "iterator is end() or rend()")
214  }
215 
216  return _iterator_;
217  }
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value > * _seq_
The sequence pointed to by the iterator (by default, key is a scalar).
Definition: sequence.h:1411
Size size() const noexcept
Returns the size of the sequence.
Definition: sequence_tpl.h:37
Idx _iterator_
The index in the sequence&#39;s vector where the iterator is pointing.
Definition: sequence.h:1408
#define GUM_ERROR(type, msg)
Definition: exceptions.h:51

Friends And Related Function Documentation

◆ SequenceImplementation

template<typename Key>
template<typename K , typename A , bool >
friend class SequenceImplementation
friend

Friend to speed up access.

Definition at line 1202 of file sequence.h.

Member Data Documentation

◆ _iterator_

template<typename Key>
Idx gum::SequenceIteratorSafe< Key >::_iterator_
private

The index in the sequence's vector where the iterator is pointing.

Definition at line 1408 of file sequence.h.

◆ _seq_

template<typename Key>
const SequenceImplementation< Key, std::allocator< Key >, std::is_scalar< Key >::value >* gum::SequenceIteratorSafe< Key >::_seq_
private

The sequence pointed to by the iterator (by default, key is a scalar).

Definition at line 1411 of file sequence.h.


The documentation for this class was generated from the following files: