#include <ConnObjectFactory.h>
Public Member Functions | |
ConnObjectFactory (SimObjectFactory const &model) | |
ConnObjectFactory (SimObjectVariationFactory const &model) | |
virtual | ~ConnObjectFactory () |
void | set (string const &fieldname, RandomDistribution const &rd) |
Set the specified RandomDistribution for the given field. | |
void | set (string const &fieldname, ConnObjectValueGenerator const &val_gen) |
Set the specified ConnObjectValueGenerator for the given field. | |
virtual void | init (const SimObjectPopulation &src_pop, size_t src_idx, const SimObjectPopulation &dst_pop, size_t dst_idx) |
Tell the factory about the poulation and the index with the population for which the next object hast to be created. | |
virtual SimObject * | create () const |
Return a pointer to a newly created SimObject using the factory. | |
virtual SimObject * | create (RandomEngine *eng) const |
Return a pointer to a newly created SimObject using the factories number engine (use setRandomEngine to specify). | |
Protected Types | |
typedef map< string, FieldGeneratorPair * > | value_generators_t |
Protected Attributes | |
size_t | m_src_idx |
size_t | m_dst_idx |
value_generators_t | m_value_generators |
Classes | |
struct | FieldGeneratorPair |
Definition at line 20 of file ConnObjectFactory.h.
typedef map< string, FieldGeneratorPair* > ConnObjectFactory::value_generators_t [protected] |
Definition at line 61 of file ConnObjectFactory.h.
ConnObjectFactory::ConnObjectFactory | ( | SimObjectFactory const & | model | ) |
Definition at line 19 of file ConnObjectFactory.cpp.
ConnObjectFactory::ConnObjectFactory | ( | SimObjectVariationFactory const & | model | ) |
Definition at line 24 of file ConnObjectFactory.cpp.
ConnObjectFactory::~ConnObjectFactory | ( | ) | [virtual] |
void ConnObjectFactory::set | ( | string const & | fieldname, | |
RandomDistribution const & | rd | |||
) |
Set the specified RandomDistribution for the given field.
Associates the field named fieldname of the SimObject with the RandomDistribution object, such that values for this parameter are generated from the RandomDistribution.
Reimplemented from SimObjectVariationFactory.
Definition at line 38 of file ConnObjectFactory.cpp.
References SimObjectVariationFactory::set().
void ConnObjectFactory::set | ( | string const & | fieldname, | |
ConnObjectValueGenerator const & | val_gen | |||
) |
Set the specified ConnObjectValueGenerator for the given field.
Definition at line 43 of file ConnObjectFactory.cpp.
References ConnObjectValueGenerator::clone(), SimObject::findField(), SimObjectVariationFactory::m_base, and m_value_generators.
void ConnObjectFactory::init | ( | const SimObjectPopulation & | src_pop, | |
size_t | src_idx, | |||
const SimObjectPopulation & | dst_pop, | |||
size_t | dst_idx | |||
) | [virtual] |
Tell the factory about the poulation and the index with the population for which the next object hast to be created.
Definition at line 61 of file ConnObjectFactory.cpp.
References m_dst_idx, m_src_idx, m_value_generators, and SimObjectVariationFactory::rnd_eng.
Referenced by SimpleAllToAllWiringMethod::connect(), OneToOneWiringMethod::connect(), and DistributedSyncWiringMethod::connect().
SimObject * ConnObjectFactory::create | ( | void | ) | const [virtual] |
Return a pointer to a newly created SimObject using the factory.
Reimplemented from SimObjectVariationFactory.
Definition at line 94 of file ConnObjectFactory.cpp.
References SimObjectVariationFactory::rnd_eng.
SimObject * ConnObjectFactory::create | ( | RandomEngine * | eng | ) | const [virtual] |
Return a pointer to a newly created SimObject using the factories number engine (use setRandomEngine to specify).
Reimplemented from SimObjectVariationFactory.
Definition at line 77 of file ConnObjectFactory.cpp.
References SimObjectVariationFactory::create(), m_dst_idx, m_src_idx, m_value_generators, and SimObject::setScalarField().
size_t ConnObjectFactory::m_src_idx [protected] |
size_t ConnObjectFactory::m_dst_idx [protected] |
Definition at line 62 of file ConnObjectFactory.h.
Referenced by create(), init(), set(), and ~ConnObjectFactory().