#include <stathandler.h>


Public Member Functions | |
| StatHandler () | |
| virtual | ~StatHandler () |
| virtual void | clear () |
| Empties the _recorders list, they are destroyed in StatHandlerBase::reset(). | |
| virtual void | execute () |
| Computes the stats by executing the function variables stored in the StatRecorder's. | |
| virtual void | add (std::string Title, std::string Name, st_order Order, age_t AGE, unsigned int ARG, double(SH::*getStat)(void), double(SH::*getStatBoolArg)(bool), double(SH::*getStatUintArg)(unsigned int), void(SH::*setStat)(void)) |
| Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list. | |
Protected Types | |
| typedef std::list < StatRecorder< SH > * >::iterator | REC_IT |
Protected Attributes | |
| std::list< StatRecorder< SH > * > | _recorders |
| The list of stat recorders. | |
The template type must be the type of the class that declares the methods linked into the StatRecorder elements.
Definition at line 132 of file stathandler.h.
typedef std::list< StatRecorder<SH>* >::iterator StatHandler< SH >::REC_IT [protected] |
Definition at line 138 of file stathandler.h.
| StatHandler< SH >::StatHandler | ( | ) | [inline] |
| virtual StatHandler< SH >::~StatHandler | ( | ) | [inline, virtual] |
| virtual void StatHandler< SH >::add | ( | std::string | Title, | |
| std::string | Name, | |||
| st_order | Order, | |||
| age_t | AGE, | |||
| unsigned int | ARG, | |||
| double(SH::*)(void) | getStat, | |||
| double(SH::*)(bool) | getStatBoolArg, | |||
| double(SH::*)(unsigned int) | getStatUintArg, | |||
| void(SH::*)(void) | setStat | |||
| ) | [inline, virtual] |
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list.
Two types of function variables are passed to this function. The "getter" and "setter". A "getter" returns a double value that will be stored in the StatRecorder structure. It may or may not take an argument. Only one getter should be passed to the stat recorder. The setter is used to set variables in the SH class which are then read by the getter. A setter and a getter may be given together but a setter alone will issue an error at runtime as no getter is present in the stat recorder.
| Title | the stat title (as shown in the R frontend fro eg.) | |
| Name | the stat name (headers in the stat output file) | |
| Order | stat table ordering flag | |
| AGE | the age class for which the stat will be recorded | |
| ARG | the argument to pass to the SH function | |
| getStat | function ptr to a SH getter | |
| getStatBoolArg | function ptr to a SH getter with boolean argument | |
| getStatUintArg | function ptr to a SH getter with unsigned int argument | |
| setStat | function ptr to a SH setter |
Definition at line 166 of file stathandler.h.
Referenced by StatHandler< TTDeletMutBitstrSH >::add().
00169 { 00170 StatRecorder<SH>* new_rec = new StatRecorder<SH>(this->get_nrows(),this->get_ncols()); 00171 00172 new_rec->set(Title,Name,Order,AGE,ARG,getStat,getStatBoolArg,getStatUintArg,setStat); 00173 00174 _recorders.push_back(new_rec); 00175 00176 StatHandlerBase::add(new_rec); 00177 }
| virtual void StatHandler< SH >::clear | ( | ) | [inline, virtual] |
Empties the _recorders list, they are destroyed in StatHandlerBase::reset().
Implements StatHandlerBase.
Definition at line 146 of file stathandler.h.
00146 {_recorders.clear();}
| virtual void StatHandler< SH >::execute | ( | ) | [virtual] |
Computes the stats by executing the function variables stored in the StatRecorder's.
Implements StatHandlerBase.
std::list<StatRecorder<SH>*> StatHandler< SH >::_recorders [protected] |
The list of stat recorders.
Definition at line 136 of file stathandler.h.
Referenced by StatHandler< TTDeletMutBitstrSH >::add(), StatHandler< TTDeletMutBitstrSH >::clear(), and StatHandler< SH >::execute().
1.5.8 -- Nemo is hosted by