Rev | Line | |
---|
[176] | 1 | #ifndef _STATISTICS_H_ |
---|
| 2 | #define _STATISTICS_H_ |
---|
| 3 | |
---|
| 4 | #include <assert.h> |
---|
| 5 | |
---|
| 6 | namespace Hoard { |
---|
| 7 | |
---|
| 8 | class Statistics { |
---|
| 9 | public: |
---|
| 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 | |
---|
| 20 | private: |
---|
| 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.