PopObjectValueGeneratorSpecialization< P > Class Template Reference

Class exposed to python where user defined value genrators can be derived. More...

#include <PopObjectValueGenerator.h>

Inheritance diagram for PopObjectValueGeneratorSpecialization< P >:

Inheritance graph
[legend]
Collaboration diagram for PopObjectValueGeneratorSpecialization< P >:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

template<typename P>
class PopObjectValueGeneratorSpecialization< P >

Class exposed to python where user defined value genrators can be derived.

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.


Member Function Documentation

template<typename P>
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.


Member Data Documentation

template<typename P>
size_t PopObjectValueGeneratorSpecialization< P >::m_idx [protected]

template<typename P>
const P* PopObjectValueGeneratorSpecialization< P >::m_pop [protected]


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

Generated on Wed Jul 9 16:34:52 2008 for PCSIM by  doxygen 1.5.5