#include <PopObjectAttributeFactory.h>
Public Member Functions | |
PopObjectAttributeFactory (PopObjectFactory const &model) | |
virtual | ~PopObjectAttributeFactory () |
virtual void | announce (SimObjectPopulation &pop, size_t idx) |
Tell the factory about the population and the index with the population for which the next object hast to be created. | |
void | set (string const &attrname, string const &value) |
void | set (string const &attrname, RandomDistribution &rd) |
void | set (string const &attr, PopObjectValueGenerator &valgen) |
virtual SimObject * | create (RandomEngine *rnd) |
virtual SimObjectAttributes * | createAttributes (RandomEngine *rnd) |
Protected Types | |
typedef map< string, PopObjectValueGenerator * > | attr_generators_t |
typedef map< string, RandomDistribution * > | attr_distributions_t |
Protected Member Functions | |
bool | CheckAndRemoveAttrName (string const &attrname) |
Protected Attributes | |
attr_generators_t | m_attr_generators |
attr_distributions_t | m_attr_distributions |
shared_ptr < SimObjectAttributesDefinition > | m_attr_def |
Definition at line 35 of file PopObjectAttributeFactory.h.
typedef map< string, PopObjectValueGenerator* > PopObjectAttributeFactory::attr_generators_t [protected] |
Definition at line 78 of file PopObjectAttributeFactory.h.
typedef map< string, RandomDistribution* > PopObjectAttributeFactory::attr_distributions_t [protected] |
Definition at line 81 of file PopObjectAttributeFactory.h.
PopObjectAttributeFactory::PopObjectAttributeFactory | ( | PopObjectFactory const & | model | ) |
Definition at line 28 of file PopObjectAttributeFactory.cpp.
PopObjectAttributeFactory::~PopObjectAttributeFactory | ( | ) | [virtual] |
Definition at line 35 of file PopObjectAttributeFactory.cpp.
void PopObjectAttributeFactory::announce | ( | SimObjectPopulation & | pop, | |
size_t | idx | |||
) | [virtual] |
Tell the factory about the population and the index with the population for which the next object hast to be created.
Reimplemented from PopObjectFactory.
Definition at line 110 of file PopObjectAttributeFactory.cpp.
References PopObjectFactory::announce(), and m_attr_generators.
void PopObjectAttributeFactory::set | ( | string const & | attrname, | |
string const & | value | |||
) |
Associates the attribute named attr of the SimObjectAttribute with a constant value of the appropriate type.
Definition at line 49 of file PopObjectAttributeFactory.cpp.
void PopObjectAttributeFactory::set | ( | string const & | attrname, | |
RandomDistribution & | rd | |||
) |
Associates the attribute named attr of the SimObjectAttribute with the RandomDistribution object, such that values for this attribute are generated from the RandomDistribution.
Definition at line 40 of file PopObjectAttributeFactory.cpp.
References CheckAndRemoveAttrName(), RandomDistribution::clone(), m_attr_def, and m_attr_distributions.
void PopObjectAttributeFactory::set | ( | string const & | attr, | |
PopObjectValueGenerator & | valgen | |||
) |
Associate the attribute attr with a AttributeValueGenerator instance. Effect: Set the value of attr to the value returned by valgen( location, familiyid, this )
Definition at line 55 of file PopObjectAttributeFactory.cpp.
References CheckAndRemoveAttrName(), PopObjectValueGenerator::clone(), m_attr_def, and m_attr_generators.
SimObject * PopObjectAttributeFactory::create | ( | RandomEngine * | rnd | ) | [virtual] |
After all fields are associated with some value generators the following methods generates one tuple of SimObjectAttributes and the corresponding SimObject
Definition at line 64 of file PopObjectAttributeFactory.cpp.
References PopObjectFactory::create().
SimObjectAttributes * PopObjectAttributeFactory::createAttributes | ( | RandomEngine * | rnd | ) | [virtual] |
Definition at line 70 of file PopObjectAttributeFactory.cpp.
References m_attr_def, m_attr_distributions, m_attr_generators, and SimObjectAttributes::set().
bool PopObjectAttributeFactory::CheckAndRemoveAttrName | ( | string const & | attrname | ) | [protected] |
Definition at line 92 of file PopObjectAttributeFactory.cpp.
References m_attr_distributions, and m_attr_generators.
Referenced by set().
Definition at line 79 of file PopObjectAttributeFactory.h.
Referenced by announce(), CheckAndRemoveAttrName(), createAttributes(), and set().
Definition at line 82 of file PopObjectAttributeFactory.h.
Referenced by CheckAndRemoveAttrName(), createAttributes(), and set().
shared_ptr<SimObjectAttributesDefinition> PopObjectAttributeFactory::m_attr_def [protected] |
Definition at line 84 of file PopObjectAttributeFactory.h.
Referenced by createAttributes(), and set().