-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevaldeb.h
143 lines (107 loc) · 3.02 KB
/
evaldeb.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*******************************************************************
*
* DESCRIPTION: CLASS EvalDebug
*
* AUTHOR: Daniel Rodriguez.
* VERSION 2: Gabriel Wainer.
*
* EMAIL: mailto://[email protected]
* EMAIL: mailto://[email protected]
*
* DATE: 20/10/2000
* DATE: 15/08/2000
* strat in-class inicialization removed to make code ANSI C++
* compatible
*
*******************************************************************/
#ifndef __EVAL_PARAMS_H
#define __EVAL_PARAMS_H
/** definitions **/
#include <ostream>
#include <cstdlib>
class clsEvalParam
{
public:
clsEvalParam() //Default constructor
:evalParamOut(NULL)
,evalParamActive(false)
,strat(false)
{}
std::ostream &Stream()
{return *evalParamOut;}
void Stream( std::ostream *evalParamStr )
{ evalParamOut = evalParamStr; }
const bool Active()
{return evalParamActive;}
void Active( bool mode )
{ evalParamActive = mode; }
const bool Strat() //GW. Strategy 1: false. 2: true.
{return strat;}
void Strat ( bool mode ) //GW. Strategy 1: false. 2: true.
{ strat = mode; }
double Value( void )
{ return value; }
void Value( double valor )
{ value = valor; }
double Ratio ( void ) // GW. Returns the ratio used with dyn. q
{ return ratio; }
void Ratio( double percent )
{ ratio = percent; }
protected:
// ** Instance variables ** //
std::ostream *evalParamOut ;
bool evalParamActive ;
double value ;
double ratio;
bool strat;
}; // class EvalParam
extern clsEvalParam *evalDebugInstance;
extern clsEvalParam *flatDebugInstance;
extern clsEvalParam *rulesDebugInstance;
extern clsEvalParam *parserDebugInstance;
extern clsEvalParam *showVirtualTimeDebugInstance;
extern clsEvalParam *useQuantumInstance;
extern clsEvalParam *useDynQuantumInstance;
inline clsEvalParam &ShowVirtualTimeWhenFinish()
{
if (showVirtualTimeDebugInstance == NULL)
showVirtualTimeDebugInstance = new clsEvalParam;
return *showVirtualTimeDebugInstance;
}
inline clsEvalParam &EvalDebug()
{
if (evalDebugInstance == NULL)
evalDebugInstance = new clsEvalParam;
return *evalDebugInstance;
}
inline clsEvalParam &FlatDebug()
{
if (flatDebugInstance == NULL)
flatDebugInstance = new clsEvalParam;
return *flatDebugInstance;
}
inline clsEvalParam &DebugCellRules()
{
if (rulesDebugInstance == NULL)
rulesDebugInstance = new clsEvalParam;
return *rulesDebugInstance;
}
inline clsEvalParam &ParserDebug()
{
if (parserDebugInstance == NULL)
parserDebugInstance = new clsEvalParam;
return *parserDebugInstance;
}
inline clsEvalParam &UseQuantum()
{
if (useQuantumInstance == NULL)
useQuantumInstance = new clsEvalParam;
return *useQuantumInstance;
}
inline clsEvalParam &UseDynQuantum() // Dynamic Quantizer
{
if (useDynQuantumInstance == NULL)
useDynQuantumInstance = new clsEvalParam;
return *useDynQuantumInstance;
}
#endif //__EVAL_PARAMS_H