source: proiecte/swift/trunk/lib/hoard-371/src/statistics.h @ 176

Last change on this file since 176 was 176, checked in by (none), 14 years ago
  • imported repo from "guagal"
File size: 668 bytes
Line 
1#ifndef _STATISTICS_H_
2#define _STATISTICS_H_
3
4#include <assert.h>
5
6namespace Hoard {
7
8class Statistics {
9public:
10  Statistics (void)
11    : _inUse (0),
12      _allocated (0)
13  {}
14 
15  inline int getInUse (void) const { assert (_inUse >= 0); return _inUse; }
16  inline int getAllocated (void) const { assert (_allocated >= 0); return _allocated; }
17  inline void setInUse (int u) { assert (u >= 0); assert (_inUse >= 0); _inUse = u; }
18  inline void setAllocated (int a) { assert (a >= 0); assert (_allocated >= 0); _allocated = a; }
19 
20private:
21 
22  /// The number of objects in use.
23  int _inUse;
24 
25  /// The number of objects allocated.
26  int _allocated;
27};
28
29}
30
31#endif
Note: See TracBrowser for help on using the repository browser.