-
Notifications
You must be signed in to change notification settings - Fork 2
/
AtlasStats.h
65 lines (52 loc) · 1.57 KB
/
AtlasStats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <list>
#include <string>
#include "AtlasTypes.h"
using namespace std;
class InsertionStatistics
{
public:
InsertionStatistics();
void AddStats(InsertionStatistics& Stats);
void ClearStats();
void Init(unsigned int StartPos, unsigned int UpperBound, unsigned int LineStart, const string& BlockName);
void AddCmd(unsigned int CmdNum);
bool HasCommands();
InsertionStatistics& operator=(const InsertionStatistics& rhs);
string Name;
unsigned int StartPos;
unsigned int ScriptSize;
unsigned int ScriptOverflowed;
unsigned int SpaceRemaining;
unsigned int MaxBound;
unsigned int LineStart;
unsigned int LineEnd;
unsigned int PointerWrites;
unsigned int EmbPointerWrites;
unsigned int AutoPointerWrites;
unsigned int FailedListWrites;
unsigned int ExtPointerWrites;
unsigned int ExecCount[CommandCount];
};
class StatisticsHandler
{
public:
StatisticsHandler();
~StatisticsHandler();
std::list<InsertionStatistics> Stats;
void NewStatsBlock(unsigned int StartPos, unsigned int UpperBound, unsigned int LineStart, const string& BlockName);
void AddCmd(unsigned int CmdNum);
void AddScriptBytes(unsigned int Count);
void End(unsigned int EndLine);
void GenerateTotalStats(InsertionStatistics& Total);
void IncGenPointerWrites();
void IncEmbPointerWrites();
void IncAutoPointerWrites();
void IncFailedListWrites();
void IncExtPointerWrites();
private:
InsertionStatistics CurBlock;
};
typedef std::list<InsertionStatistics>::iterator ListStatsIt;
typedef std::list<InsertionStatistics>::reverse_iterator ListStatsRevIt;
extern StatisticsHandler Stats;