DUNE-FEM (unstable)
A counter only present if NDEBUG is not defined. More...
#include <dune/fem/misc/debug.hh>
Public Types | |
typedef CounterImp | CounterType |
integral type for the actual counting | |
Public Member Functions | |
DebugCounter (const CounterType count=0) | |
constructor More... | |
DebugCounter (const ThisType &other) | |
copy constructor | |
ThisType & | operator++ () |
increment operator More... | |
ThisType & | operator-- () |
decrement operator More... | |
bool | operator== (const ThisType &other) |
comparison for equality More... | |
bool | operator!= (const ThisType &other) |
comparison for inequality More... | |
Detailed Description
class Dune::Fem::DebugCounter< CounterImp >
A counter only present if NDEBUG is not defined.
There are several cases, where we need a counter for debugging purposes that should only be present, if NDEBUG is not defined.
In debug mode, this counter wraps a standard integer type, otherwise its size is zero.
- Note
- The comparison operators always return true, if NDEBUG is defined!
Constructor & Destructor Documentation
◆ DebugCounter()
|
inline |
constructor
- Note
- This constructor implicitly defines a conversion from CounterType to DebugCounter. This is very useful in comparison statements.
- Parameters
-
[in] count value to initialize the counter with (defaults to 0)
Member Function Documentation
◆ operator!=()
|
inline |
comparison for inequality
Compares to DebugCounters for inequality. If USE_DEBUG_CNT is defined, the result will be true.
- Note
- Due to the implicit conversion, the second argument may also be of CounterType.
- Parameters
-
[in] other DebugCounter to compare this one to
- Returns
- true, if the counters differ or USE_DEBUG_CNT is defined
◆ operator++()
|
inline |
increment operator
If USE_DEBUG_CNT is not defined, the counter is incremented by 1. Otherwise nothing happens (and the entire call will be removed during oprimization).
◆ operator--()
|
inline |
decrement operator
If USE_DEBUG_CNT is not defined, the counter is decremented by 1. Otherwise nothing happens (and the entire call will be removed during oprimization).
◆ operator==()
|
inline |
comparison for equality
Compares to DebugCounters for equality. If USE_DEBUG_CNT is defined, the result will be true.
- Note
- Due to the implicit conversion, the second argument may also be of CounterType.
- Parameters
-
[in] other DebugCounter to compare this one to
- Returns
- true, if the counters equal or USE_DEBUG_CNT is defined
The documentation for this class was generated from the following file:
- dune/fem/misc/debug.hh