2 * tunableConstant - a constant that might be changed during execution.
4 * $Log: tunableConst.h,v $
5 * Revision 1.1 1994/02/25 00:25:58 hollings
6 * added tunable constants.
10 #ifndef TUNABLE_CONST_H
11 #define TUNABLE_CONST_H
13 #include "util/h/list.h"
15 typedef Boolean (*isValidFunc)(float newVale);
16 typedef void (*changeValCallBackFunc)(float value);
18 class tunableConstant {
20 tunableConstant(float initialValue,
23 changeValCallBackFunc cb,
26 tunableConstant(float initialValue,
28 changeValCallBackFunc cb,
31 float getValue() { return value; }
32 char *getDesc() { return(desc); }
33 char *getName() { return(name); }
34 Boolean setValue(float newVal) {
35 if ((isValidValue) && isValidValue(newVal)) {
36 if (newValueCallBack) newValueCallBack(newVal);
38 } else if (simpleRangeCheck(newVal)) {
39 if (newValueCallBack) newValueCallBack(newVal);
50 isValidFunc isValidValue;
51 Boolean simpleRangeCheck(float val);
52 changeValCallBackFunc newValueCallBack;
53 static List<tunableConstant*> allConstants;