Progress indicator: Show number of active items

This commit is contained in:
Eelco Dolstra 2017-08-14 22:42:17 +02:00
parent 0e0dcf2c7e
commit bf1f123b09
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 39 additions and 28 deletions

View file

@ -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; }
};
}