dnp3 (C++ API) 1.1.0
dnp3::CounterIterator Class Referencefinal

Iterator over Counter instances. More...

#include <dnp3.hpp>

Public Member Functions

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

Friends

class CppCounterIteratorFriend
 

Detailed Description

Iterator over Counter instances.

Warning

Always use this pattern to extract values from the iterator:

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

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

Constructor & Destructor Documentation

◆ CounterIterator()

dnp3::CounterIterator::CounterIterator ( CounterIterator &&  )
default

move constructor for the iterator

Member Function Documentation

◆ get()

Counter dnp3::CounterIterator::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 dnp3::CounterIterator::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: