msl 1.3.0
Loading...
Searching...
No Matches
msl::Counter Class Reference

Detailed Description

Counter from 0 (included) to end (excluded).

#include <Counter.h>

Public Member Functions

 Counter (std::size_t end)
 Initialize index to 0.
 
std::size_t index () const
 Return the current index.
 
std::size_t end () const
 Return the end value.
 
CountersetEnd (std::size_t end)
 Set the end value.
 
Counterreset ()
 Set the index to 0.
 
Counteroperator++ ()
 Increment the index.
 
bool first () const
 Test if the index is 0.
 
bool last () const
 Test if the index is equal to end-1.
 
bool done () const
 Test if the index is equal to end.
 

Constructor & Destructor Documentation

◆ Counter()

msl::Counter::Counter ( std::size_t  end)

Initialize index to 0.

Member Function Documentation

◆ index()

std::size_t msl::Counter::index ( ) const

Return the current index.

◆ end()

std::size_t msl::Counter::end ( ) const

Return the end value.

◆ setEnd()

Counter & msl::Counter::setEnd ( std::size_t  end)

Set the end value.

◆ reset()

Counter & msl::Counter::reset ( )

Set the index to 0.

◆ operator++()

Counter & msl::Counter::operator++ ( )

Increment the index.

Attention
No bound control is performed.

◆ first()

bool msl::Counter::first ( ) const

Test if the index is 0.

◆ last()

bool msl::Counter::last ( ) const

Test if the index is equal to end-1.

◆ done()

bool msl::Counter::done ( ) const

Test if the index is equal to end.


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