The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::Queue< DataT >::QueueIterator< is_const_iterator > Class Template Reference

Class that alows queue elements to be accessed like a normal stl iterator. Queue iterator is a bidirectional sequential iterator isValid() method checks the validity of the iterator. This method can be used to check if the data in Queue has not yet been popped out Increment, decrement , dereferencing,less than and greater than operations are provided. More...

#include <Queue.hpp>

Inheritance diagram for sparta::Queue< DataT >::QueueIterator< is_const_iterator >:
Collaboration diagram for sparta::Queue< DataT >::QueueIterator< is_const_iterator >:

Public Member Functions

 QueueIterator ()=default
 Default constructor.
 
 QueueIterator (const QueueIterator< false > &iter)
 
 QueueIterator (const QueueIterator< true > &iter)
 
bool isValid () const
 
QueueIteratoroperator= (const QueueIterator &rhs)=default
 Assignment operator.
 
bool operator< (const QueueIterator &rhs) const
 overload the comparison operator.
 
bool operator> (const QueueIterator &rhs) const
 overload the comparison operator.
 
bool operator== (const QueueIterator &rhs) const
 overload the comparison operator.
 
bool operator!= (const QueueIterator &rhs) const
 overload the comparison operator.
 
QueueIteratoroperator++ ()
 Pre-Increment operator.
 
QueueIterator operator++ (int)
 Post-Increment iterator.
 
QueueIteratoroperator-- ()
 Pre-decrement iterator.
 
QueueIterator operator-- (int)
 Post-decrement iterator.
 
DataReferenceType operator* ()
 Dereferencing operator.
 
value_type * operator-> ()
 support -> operator
 
const value_type * operator-> () const
 
uint32_t getIndex () const
 

Friends

class Queue< DataT >
 Only the Queue can attach itself.
 
class QueueIterator< true >
 

Additional Inherited Members

- Public Types inherited from sparta::utils::IteratorTraits< std::bidirectional_iterator_tag, value_type >
using difference_type = long
 
using value_type = value_type
 
using pointer = const value_type *
 
using reference = const value_type &
 
using iterator_category = std::bidirectional_iterator_tag
 

Detailed Description

template<class DataT>
template<bool is_const_iterator = true>
class sparta::Queue< DataT >::QueueIterator< is_const_iterator >

Class that alows queue elements to be accessed like a normal stl iterator. Queue iterator is a bidirectional sequential iterator isValid() method checks the validity of the iterator. This method can be used to check if the data in Queue has not yet been popped out Increment, decrement , dereferencing,less than and greater than operations are provided.

Definition at line 227 of file Queue.hpp.

Constructor & Destructor Documentation

◆ QueueIterator() [1/2]

template<class DataT >
template<bool is_const_iterator = true>
sparta::Queue< DataT >::QueueIterator< is_const_iterator >::QueueIterator ( const QueueIterator< false > &  iter)
inline

Copy constructor. Allows for implicit conversion from a regular iterator to a const_iterator

Definition at line 265 of file Queue.hpp.

◆ QueueIterator() [2/2]

template<class DataT >
template<bool is_const_iterator = true>
sparta::Queue< DataT >::QueueIterator< is_const_iterator >::QueueIterator ( const QueueIterator< true > &  iter)
inline

Copy constructor. Allows for implicit conversion from a regular iterator to a const_iterator

Definition at line 274 of file Queue.hpp.

Member Function Documentation

◆ getIndex()

template<class DataT >
template<bool is_const_iterator = true>
uint32_t sparta::Queue< DataT >::QueueIterator< is_const_iterator >::getIndex ( ) const
inline

Get the logical index of this entry in the queue. This is expensive and should be avoided. It makes better sense to simply retrieve the object directly from the iterator.

Definition at line 377 of file Queue.hpp.

◆ isValid()

template<class DataT >
template<bool is_const_iterator = true>
bool sparta::Queue< DataT >::QueueIterator< is_const_iterator >::isValid ( ) const
inline

Checks validity of iterator – is it related to a Queue and points to a valid entry in the queue

Returns
Returns true if iterator is valid else false

Definition at line 283 of file Queue.hpp.

◆ operator!=()

template<class DataT >
template<bool is_const_iterator = true>
bool sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator!= ( const QueueIterator< is_const_iterator > &  rhs) const
inline

overload the comparison operator.

Definition at line 318 of file Queue.hpp.

◆ operator*()

template<class DataT >
template<bool is_const_iterator = true>
DataReferenceType sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator* ( )
inline

Dereferencing operator.

Definition at line 354 of file Queue.hpp.

Here is the call graph for this function:

◆ operator++() [1/2]

template<class DataT >
template<bool is_const_iterator = true>
QueueIterator & sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator++ ( )
inline

Pre-Increment operator.

Definition at line 323 of file Queue.hpp.

◆ operator++() [2/2]

template<class DataT >
template<bool is_const_iterator = true>
QueueIterator sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator++ ( int  )
inline

Post-Increment iterator.

Definition at line 331 of file Queue.hpp.

Here is the call graph for this function:

◆ operator--() [1/2]

template<class DataT >
template<bool is_const_iterator = true>
QueueIterator & sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator-- ( )
inline

Pre-decrement iterator.

Definition at line 339 of file Queue.hpp.

◆ operator--() [2/2]

template<class DataT >
template<bool is_const_iterator = true>
QueueIterator sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator-- ( int  )
inline

Post-decrement iterator.

Definition at line 347 of file Queue.hpp.

Here is the call graph for this function:

◆ operator->() [1/2]

template<class DataT >
template<bool is_const_iterator = true>
value_type * sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator-> ( )
inline

support -> operator

Definition at line 361 of file Queue.hpp.

Here is the call graph for this function:

◆ operator->() [2/2]

template<class DataT >
template<bool is_const_iterator = true>
const value_type * sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator-> ( ) const
inline

Definition at line 367 of file Queue.hpp.

◆ operator<()

template<class DataT >
template<bool is_const_iterator = true>
bool sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator< ( const QueueIterator< is_const_iterator > &  rhs) const
inline

overload the comparison operator.

Definition at line 294 of file Queue.hpp.

Here is the call graph for this function:

◆ operator==()

template<class DataT >
template<bool is_const_iterator = true>
bool sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator== ( const QueueIterator< is_const_iterator > &  rhs) const
inline

overload the comparison operator.

Definition at line 310 of file Queue.hpp.

◆ operator>()

template<class DataT >
template<bool is_const_iterator = true>
bool sparta::Queue< DataT >::QueueIterator< is_const_iterator >::operator> ( const QueueIterator< is_const_iterator > &  rhs) const
inline

overload the comparison operator.

Definition at line 302 of file Queue.hpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Queue< DataT >

template<class DataT >
template<bool is_const_iterator = true>
friend class Queue< DataT >
friend

Only the Queue can attach itself.

Definition at line 240 of file Queue.hpp.

◆ QueueIterator< true >

template<class DataT >
template<bool is_const_iterator = true>
friend class QueueIterator< true >
friend

Definition at line 255 of file Queue.hpp.


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