65 void set (std::string T, std::string N,
age_t AGE,
66 unsigned int ARG1,
unsigned int ARG2)
124 void set(std::string T, std::string N,
age_t AGE,
unsigned int ARG1,
unsigned int ARG2,
125 double (S::* getNoArg)(
void),
double(S::* getOneArg)(
unsigned int),
126 double(S::* getTwoArg)(
unsigned int,
unsigned int),
void(S::* setStat)(
void));
148 double (S::* getNoArg) (
void),
149 double (S::* getOneArg)(
unsigned int),
150 double (S::* getTwoArg)(
unsigned int,
unsigned int),
151 void (S::* setStat) (
void) )
156 _getStatOneArg = getOneArg;
157 _getStatTwoArg = getTwoArg;
165 double statValue = 0;
169 message(
" %s",getName().c_str());
172 if(_setStat != 0) (_myHandler->*_setStat)();
177 statValue = (_myHandler->*_getStat)();
179 else if(_getStatOneArg != 0)
181 statValue = (_myHandler->*_getStatOneArg)(getArg1());
183 else if(_getStatTwoArg != 0)
185 statValue = (_myHandler->*_getStatTwoArg)(getArg1(), getArg2());
189 fatal(
"StatRecorder \"%s\" has no _getStat funct ptr !!\n", getName().c_str());
Base class for the StatRecorder's, declares the interface to record stat values.
Definition: statrecorder.h:38
unsigned int _arg2
Definition: statrecorder.h:47
virtual ~StatRecBase()
Definition: statrecorder.h:56
age_t getAge()
Definition: statrecorder.h:80
void set(std::string T, std::string N, age_t AGE, unsigned int ARG1, unsigned int ARG2)
Sets the recorder attributes.
Definition: statrecorder.h:65
age_t _age
The age class for which this stat applies.
Definition: statrecorder.h:49
unsigned int getArg2()
Definition: statrecorder.h:82
unsigned int getArg1()
Definition: statrecorder.h:81
std::string _title
The title of the stat recorder, longer and more explicite than the name.
Definition: statrecorder.h:42
std::string getName()
Definition: statrecorder.h:79
void setName(std::string N)
Definition: statrecorder.h:77
virtual double setVal(age_t AGE)=0
Stores the value in the vector following the ordering option.
std::string getTitle()
Definition: statrecorder.h:78
std::string _name
Name of the stat, should be short (20 char) and R compliant (no '-', '+', ' ')
Definition: statrecorder.h:44
StatRecBase()
Definition: statrecorder.h:53
unsigned int _arg1
A argument to be passed to one of the function variable stored in the StatRecorder structure.
Definition: statrecorder.h:46
Stores the pointers to the StatHandler's stat functions.
Definition: statrecorder.h:93
StatRecorder()
Definition: statrecorder.h:110
void setHandler(S *theHandler)
Sets the pointer to the StatHandler that owns this recorder.
Definition: statrecorder.h:129
double(S::* _getStat)(void)
Pointer to a 'stat getter' function of S using no argument.
Definition: statrecorder.h:96
double(S::* _getStatOneArg)(unsigned int)
Pointer to a 'stat getter' function of S using a single unsigned int argument.
Definition: statrecorder.h:98
void(S::* _setStat)(void)
Pointer to a 'stat setter' function of S using no argument.
Definition: statrecorder.h:104
void set(std::string T, std::string N, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(S::*getNoArg)(void), double(S::*getOneArg)(unsigned int), double(S::*getTwoArg)(unsigned int, unsigned int), void(S::*setStat)(void))
Sets the recorder attributes.
Definition: statrecorder.h:145
virtual double setVal(age_t AGE)
Calls the linked stat function and returns the result.
Definition: statrecorder.h:163
double(S::* _getStatTwoArg)(unsigned int, unsigned int)
Pointer to a 'stat getter' function of S using two unsigned int arguments.
Definition: statrecorder.h:100
S * _myHandler
Pointer to the owner of this recorder.
Definition: statrecorder.h:106
void fatal(const char *str,...)
Definition: output.cc:96
void message(const char *message,...)
Definition: output.cc:40
#define ALL
All ages age class flag.
Definition: types.h:56
unsigned int age_t
Age class flags.
Definition: types.h:46