Progress indicator: Show number of active items
This commit is contained in:
parent
0e0dcf2c7e
commit
bf1f123b09
7 changed files with 39 additions and 28 deletions
|
@ -462,4 +462,18 @@ struct ReceiveInterrupts
|
|||
{ }
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* A RAII helper that increments a counter on construction and
|
||||
decrements it on destruction. */
|
||||
template<typename T>
|
||||
struct MaintainCount
|
||||
{
|
||||
T & counter;
|
||||
long delta;
|
||||
MaintainCount(T & counter, long delta = 1) : counter(counter), delta(delta) { counter += delta; }
|
||||
~MaintainCount() { counter -= delta; }
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue