| 1 |
#ifndef AVIFILE_STATISTIC_H |
| 2 |
#define AVIFILE_STATISTIC_H |
| 3 |
|
| 4 |
#include "avm_stl.h" |
| 5 |
|
| 6 |
AVM_BEGIN_NAMESPACE; |
| 7 |
|
| 8 |
class Statistic |
| 9 |
{ |
| 10 |
static const int STAT_SIZE = 25; |
| 11 |
avm::string m_pName; |
| 12 |
float* m_pValues; |
| 13 |
uint_t m_uiSize; |
| 14 |
uint_t m_uiPos; |
| 15 |
double m_dSum; |
| 16 |
|
| 17 |
public: |
| 18 |
explicit Statistic(const char* name, uint_t msize = STAT_SIZE); |
| 19 |
Statistic(const Statistic& s); |
| 20 |
~Statistic(); |
| 21 |
|
| 22 |
float average() const { return (float)(m_dSum / m_uiSize); } |
| 23 |
void clear(); |
| 24 |
void insert(float v); |
| 25 |
const char* getName() const { return m_pName.c_str(); } |
| 26 |
}; |
| 27 |
|
| 28 |
AVM_END_NAMESPACE; |
| 29 |
|
| 30 |
#endif // AVIFILE_STATISTIC_H |