Nemo  2.3.46
TraitStatHandler< TP, SH > Class Template Reference

Template class for the trait's StatHandler. More...

#include <stathandler.h>

+ Inheritance diagram for TraitStatHandler< TP, SH >:
+ Collaboration diagram for TraitStatHandler< TP, SH >:

Public Member Functions

 TraitStatHandler (TP *trait_proto)
 
virtual ~TraitStatHandler ()
 
- Public Member Functions inherited from StatHandler< SH >
 StatHandler ()
 
virtual ~StatHandler ()
 
virtual void clear ()
 Empties the _recorders list, they are destroyed in StatHandlerBase::reset(). More...
 
virtual StatRecorder< SH > * add (std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(SH::*getStatNoArg)(void), double(SH::*getStatOneArg)(unsigned int), double(SH::*getStatTwoArg)(unsigned int, unsigned int), void(SH::*setStat)(void))
 Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list. More...
 
- Public Member Functions inherited from StatHandlerBase
 StatHandlerBase ()
 
virtual ~StatHandlerBase ()
 
virtual void reset ()
 Empties the _stats list and calls clear() (defined in the derived class). More...
 
Metapopget_pop_ptr ()
 
void set_service (StatServices *srv)
 
StatServicesget_service ()
 
unsigned int getOccurrence ()
 
unsigned int getNumOccurrences ()
 
unsigned int getCurrentOccurrence ()
 
unsigned int getNbRecorders ()
 
std::list< StatRecBase * > & getStats ()
 
virtual void add (StatRecBase *rec)
 
virtual void init ()
 
virtual void update ()
 This function is left empty as the StatServices calls StatRecorder::setVal directly. More...
 
virtual bool setStatRecorders (std::string &token)=0
 
- Public Member Functions inherited from Handler
virtual ~Handler ()
 

Protected Attributes

TP * _SHLinkedTrait
 Pointer to a TraitProtoype object. More...
 
int _SHLinkedTraitIndex
 Index of the trait in the Individual::Traits table. More...
 
- Protected Attributes inherited from StatHandler< SH >
std::list< StatRecorder< SH > * > _recorders
 The list of stat recorders. More...
 
- Protected Attributes inherited from StatHandlerBase
Metapop_pop
 Link to the current population, set through the link to the StatService. More...
 

Additional Inherited Members

- Protected Types inherited from StatHandler< SH >
typedef std::list
< StatRecorder< SH >
* >::iterator 
REC_IT
 

Detailed Description

template<class TP, class SH>
class TraitStatHandler< TP, SH >

Template class for the trait's StatHandler.

Constructor links to a given trait prototype. The pointer and index of the trait prototype are stored in the class. They can be accessd through the _SHLinkedTrait and _SHLinkedTraitIndex members to get the stats.

Constructor & Destructor Documentation

template<class TP, class SH >
TraitStatHandler< TP, SH >::TraitStatHandler ( TP *  trait_proto)
180 {
181  _SHLinkedTrait = trait_proto;
182  _SHLinkedTraitIndex = trait_proto->get_index();
183 }
TP * _SHLinkedTrait
Pointer to a TraitProtoype object.
Definition: stathandler.h:171
int _SHLinkedTraitIndex
Index of the trait in the Individual::Traits table.
Definition: stathandler.h:173
template<class TP, class SH>
virtual TraitStatHandler< TP, SH >::~TraitStatHandler ( )
inlinevirtual
176 { }

Member Data Documentation

template<class TP, class SH>
TP* TraitStatHandler< TP, SH >::_SHLinkedTrait
protected

Pointer to a TraitProtoype object.

template<class TP, class SH>
int TraitStatHandler< TP, SH >::_SHLinkedTraitIndex
protected

Index of the trait in the Individual::Traits table.


The documentation for this class was generated from the following file:

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR