Rearranged order of includes for igen-generated code, so that it compiles
[dyninst.git] / common / src / tunableConst.C
1 /*
2  * tunableConst - a system parameter that we might one to change during 
3  *    execution of the system.
4  *
5  * $Log: tunableConst.C,v $
6  * Revision 1.2  1994/02/28 23:58:38  hollings
7  * Changed global list to be a pointer to a list because I couldn't rely on
8  * the order of global constructors.
9  *
10  * Revision 1.1  1994/02/25  00:26:17  hollings
11  * added tuntable constants
12  *
13  *
14  */
15
16 #include "util/h/stringPool.h"
17 #include "util/h/tunableConst.h"
18
19 List<tunableConstant*> *tunableConstant::allConstants;
20 stringPool *tunableConstant::pool;
21
22 Boolean tunableConstant::simpleRangeCheck(float val)
23 {
24     return((val >= min) && (val <= max));
25 }
26
27 tunableConstant::tunableConstant(float initialValue, 
28                                  float low, 
29                                  float high, 
30                                  changeValCallBackFunc cb,
31                                  char *n,
32                                  char *d)
33 {
34     value = initialValue;
35     min = low;
36     max = high;
37     desc = d;
38     if (!pool) pool = new(stringPool);
39     name = pool->findAndAdd(n);
40     newValueCallBack = cb;
41     if (!allConstants) allConstants = new(List<tunableConstant*>);
42     allConstants->add(this, name);
43 }
44
45 tunableConstant::tunableConstant(float initialValue, 
46                                  isValidFunc func, 
47                                  changeValCallBackFunc cb,
48                                  char *n,
49                                  char *d)
50 {
51     desc = d;
52     if (!pool) pool = new(stringPool);
53     name = pool->findAndAdd(n);
54     isValidValue = func;
55     value = initialValue;
56     newValueCallBack = cb;
57     if (!allConstants) allConstants = new(List<tunableConstant*>);
58     allConstants->add(this, name);
59 }