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

Detailed Description

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

Definition at line 134 of file EtherCATFrame.h.

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)

Definition at line 5 of file EtherCATFrame.cpp.

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

Definition at line 36 of file EtherCATFrame.cpp.

◆ getCurrentIndex()

size_t getCurrentIndex ( ) const

Definition at line 42 of file EtherCATFrame.cpp.

+ Here is the call graph for this function:

◆ 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

Definition at line 19 of file EtherCATFrame.cpp.

+ Here is the caller graph for this function:

◆ operator*()

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

Get the EtherCAT frame this iterator is on with metadata.

Returns
an EtherCATFrame along with its metadata

Definition at line 13 of file EtherCATFrame.cpp.

◆ 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

Definition at line 25 of file EtherCATFrame.cpp.


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