|
dune-fem 2.12-git
|
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 | |
| DebugCounter (const ThisType &other) | |
| copy constructor | |
| ThisType & | operator++ () |
| increment operator | |
| ThisType & | operator-- () |
| decrement operator | |
| bool | operator== (const ThisType &other) |
| comparison for equality | |
| bool | operator!= (const ThisType &other) |
| comparison for inequality | |
Protected Attributes | |
| CounterType | count_ |
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!
Member Typedef Documentation
◆ CounterType
| typedef CounterImp Dune::Fem::DebugCounter< CounterImp >::CounterType |
integral type for the actual counting
Constructor & Destructor Documentation
◆ DebugCounter() [1/2]
|
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)
◆ DebugCounter() [2/2]
|
inline |
copy constructor
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
Member Data Documentation
◆ count_
|
protected |
The documentation for this class was generated from the following file:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8