#include <PopObjectValueGenerator.h>
Public Member Functions | |
virtual void | prepare (SimObjectPopulation const &pop, size_t idx, RandomEngine *rnd=NULL) |
This function will be called to tell the value generator about the population. | |
Protected Attributes | |
size_t | m_idx |
const P * | m_pop |
The reason why this class exists is a performance issue: If one would set up the python interface such that one could base python classes directly on PopObjectValueGenerator then C++ classes based on PopObjectValueGenerator instatiated in python will have a lot of overhead when PopObjectValueGenerator::generate is called. Since this method is called in the inner loop of constructing values this is not feasable. Template for type safe PopObjectValueGenerator's for different types of SimObjectPopulations.
Definition at line 82 of file PopObjectValueGenerator.h.
virtual void PopObjectValueGeneratorSpecialization< P >::prepare | ( | SimObjectPopulation const & | pop, | |
size_t | idx, | |||
RandomEngine * | rnd = NULL | |||
) | [inline, virtual] |
This function will be called to tell the value generator about the population.
An implementation of this function will check the actual type of the population and may store reference to the population. which will be used later on in the implementation of generate since this function just gets the indices within the population.
Implements PopObjectValueGenerator.
Definition at line 87 of file PopObjectValueGenerator.h.
size_t PopObjectValueGeneratorSpecialization< P >::m_idx [protected] |
Definition at line 97 of file PopObjectValueGenerator.h.
Referenced by PopObjectValueGeneratorSpecialization< AugmentedSpatialPopulation >::prepare().
const P* PopObjectValueGeneratorSpecialization< P >::m_pop [protected] |
Definition at line 98 of file PopObjectValueGenerator.h.
Referenced by PopObjectValueGeneratorSpecialization< AugmentedSpatialPopulation >::prepare().