EtherCATFrameIterator Class Reference

The EtherCATFrameIterator class iterates over a set range of EtherCAT frames once. More...

#include <armarx/control/ethercat/bus_io/EtherCATFrame.h>

Public Member Functions

bool atEnd () const
 Check if this iterator has stepped over its range.
 
 EtherCATFrameIterator (EtherCATFrameList *list, size_t startIndex, size_t count)
 Construct a new EtherCATFrameIterator that iterates over the given range of EtherCAT frames.
 
size_t getCurrentIndex () const
 
bool hasCompletedLoop () const
 Check if this iterator points to the first available register frame.
 
std::pair< EtherCATFrame *, EtherCATFrameMetaData * > operator* () const
 Get the EtherCAT frame this iterator is on with metadata.
 
EtherCATFrameIterator & operator++ ()
 Move this iterator to the next EtherCAT frame.
 

Detailed Description

The EtherCATFrameIterator class iterates over a set range of EtherCAT frames once.

Constructor & Destructor Documentation

◆ EtherCATFrameIterator()

EtherCATFrameIterator ( EtherCATFrameList * list,
size_t startIndex,
size_t count )

Construct a new EtherCATFrameIterator that iterates over the given range of EtherCAT frames.

If startIndex + count > list->list.size(), the iterator will wrap around to the start fo the list.

Parameters
listthe list to iterate over
startIndexthe index to start iterating on
countthe number of frames to iterate over (including the first)

Member Function Documentation

◆ atEnd()

bool atEnd ( ) const

Check if this iterator has stepped over its range.

Return values
trueiff this iterator can no longer be dereferenced or advanced
falseiff this iterator can still be dereferenced and advanced

◆ getCurrentIndex()

size_t getCurrentIndex ( ) const

◆ hasCompletedLoop()

bool hasCompletedLoop ( ) const

Check if this iterator points to the first available register frame.

This indicates that all registers have been read by sequential iterators.

Return values
trueiff this iterator points to the first register frame
falseiff this iterator does not point to the first register frame
Exceptions

◆ operator*()

std::pair< EtherCATFrame *, EtherCATFrameMetaData * > operator* ( ) const

Get the EtherCAT frame this iterator is on with metadata.

Returns
an EtherCATFrame along with its metadata

◆ operator++()

EtherCATFrameIterator & operator++ ( )

Move this iterator to the next EtherCAT frame.

Does nothing if this iterator is at the end of its range.

Returns
a reference to this iterator

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