rodbus (C++ API) 1.3.1
Loading...
Searching...
No Matches
rodbus::BitValueIterator Class Referencefinal

Iterator over BitValue instances. More...

#include <rodbus.hpp>

Public Member Functions

 BitValueIterator (BitValueIterator &&)=default
 move constructor for the iterator More...
 
bool next ()
 move the iterator to the next value More...
 
BitValue get ()
 retrieve the current value More...
 

Friends

class CppBitValueIteratorFriend
 

Detailed Description

Iterator over BitValue instances.

Warning

Always use this pattern to extract values from the iterator:

while(iter.next()) { BitValue value = iter.get(); }

Calling get() when no value is available will throw std::logic_error

Constructor & Destructor Documentation

◆ BitValueIterator()

rodbus::BitValueIterator::BitValueIterator ( BitValueIterator &&  )
default

move constructor for the iterator

Member Function Documentation

◆ get()

BitValue rodbus::BitValueIterator::get ( )

retrieve the current value

Returns
current value of the iterator
Exceptions
std::logic_errorif the last call to next() returns false or next() has never been called

◆ next()

bool rodbus::BitValueIterator::next ( )

move the iterator to the next value

Returns
true if another value is available

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