RTI Connext Traditional C++ API  Version 6.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::flat::SequenceIterator< E, OffsetKind > Class Template Reference

Iterator for collections of Offsets. More...

#include <SequenceIterator.hpp>

Public Types

typedef std::forward_iterator_tag iterator_category
 The iterator category.
 
typedef E value_type
 The element type.
 
typedef value_type reference
 The reference type is the same as the value type, an Offset.
 
typedef value_type pointer
 The pointer type is the same as the value type, an Offset.
 
typedef std::ptrdiff_t difference_type
 The difference type.
 

Public Member Functions

 SequenceIterator ()
 Constructs an invalid iterator.
 
bool is_null () const
 Returns whether the iterator is invalid.
 
value_type operator* () const
 Returns the Offset of the current element.
 
value_type operator-> () const
 Returns the Offset of the current element.
 
bool advance ()
 Advances to the next element, reporting any errors by returning false.
 
SequenceIteratoroperator++ ()
 Advances to the next element.
 
SequenceIterator operator++ (int)
 Advances to the next element.
 

Friends

bool operator< (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 
bool operator> (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 
bool operator<= (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 
bool operator>= (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 
bool operator== (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 
bool operator!= (const SequenceIterator &s1, const SequenceIterator &s2)
 Compares two iterators.
 

Detailed Description

template<typename E, typename OffsetKind>
class rti::flat::SequenceIterator< E, OffsetKind >

Iterator for collections of Offsets.

Template Parameters
EThe Offset type of the elements
OffsetKind(implementation detail)
Note
This type should not be declared directly. For example, for a SequenceOffset, use SequenceOffset::iterator (or simply auto).

A SequenceIterator moves through the Offset to elements of a sequence or array Offset, and provides the functionality of a standard forward_iterator.

Note that a dereferenced SequenceIterator returns by value the Offset to the current element; it doesn't return it by reference.

Since the Traditional C++ API doesn't use exceptions, it is recommended to use the function advance() instead of operator++ to check for errors

Member Typedef Documentation

template<typename E , typename OffsetKind >
typedef std::forward_iterator_tag rti::flat::SequenceIterator< E, OffsetKind >::iterator_category

The iterator category.

template<typename E , typename OffsetKind >
typedef E rti::flat::SequenceIterator< E, OffsetKind >::value_type

The element type.

template<typename E , typename OffsetKind >
typedef value_type rti::flat::SequenceIterator< E, OffsetKind >::reference

The reference type is the same as the value type, an Offset.

template<typename E , typename OffsetKind >
typedef value_type rti::flat::SequenceIterator< E, OffsetKind >::pointer

The pointer type is the same as the value type, an Offset.

template<typename E , typename OffsetKind >
typedef std::ptrdiff_t rti::flat::SequenceIterator< E, OffsetKind >::difference_type

The difference type.

Constructor & Destructor Documentation

template<typename E , typename OffsetKind >
rti::flat::SequenceIterator< E, OffsetKind >::SequenceIterator ( )
inline

Constructs an invalid iterator.

Member Function Documentation

template<typename E , typename OffsetKind >
bool rti::flat::SequenceIterator< E, OffsetKind >::is_null ( ) const
inline

Returns whether the iterator is invalid.

template<typename E , typename OffsetKind >
value_type rti::flat::SequenceIterator< E, OffsetKind >::operator* ( ) const
inline

Returns the Offset of the current element.

Returns
The Offset to the current element. Note that this function returns by value, not by reference. This Offset may be null if the iterator has surpassed the length of the collection. See Offset Error Management.
template<typename E , typename OffsetKind >
value_type rti::flat::SequenceIterator< E, OffsetKind >::operator-> ( ) const
inline

Returns the Offset of the current element.

template<typename E , typename OffsetKind >
bool rti::flat::SequenceIterator< E, OffsetKind >::advance ( )
inline

Advances to the next element, reporting any errors by returning false.

Since the Traditional C++ API doesn't support exceptions, this function is recommended instead of operator++.

Returns
True if the function succeeds, or false if there was an error
template<typename E , typename OffsetKind >
SequenceIterator& rti::flat::SequenceIterator< E, OffsetKind >::operator++ ( )
inline

Advances to the next element.

Warning
Since the Traditional C++ API doesn't use exceptions, use advance() instead of this operator to check for errors.
template<typename E , typename OffsetKind >
SequenceIterator rti::flat::SequenceIterator< E, OffsetKind >::operator++ ( int  )
inline

Advances to the next element.

Warning
Since the Traditional C++ API doesn't use exceptions, use advance() instead of this operator to check for errors.

Friends And Related Function Documentation

template<typename E , typename OffsetKind >
bool operator< ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.

template<typename E , typename OffsetKind >
bool operator> ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.

template<typename E , typename OffsetKind >
bool operator<= ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.

template<typename E , typename OffsetKind >
bool operator>= ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.

template<typename E , typename OffsetKind >
bool operator== ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.

template<typename E , typename OffsetKind >
bool operator!= ( const SequenceIterator< E, OffsetKind > &  s1,
const SequenceIterator< E, OffsetKind > &  s2 
)
friend

Compares two iterators.


RTI Connext Traditional C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc