PopObjectAttributeFactory Class Reference

#include <PopObjectAttributeFactory.h>

Inheritance diagram for PopObjectAttributeFactory:

Inheritance graph
[legend]
Collaboration diagram for PopObjectAttributeFactory:

Collaboration graph
[legend]

List of all members.

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 SimObjectcreate (RandomEngine *rnd)
virtual SimObjectAttributescreateAttributes (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


Detailed Description

Extension of the PopObjectFactory in several ways:

Definition at line 35 of file PopObjectAttributeFactory.h.


Member Typedef Documentation

Definition at line 78 of file PopObjectAttributeFactory.h.

Definition at line 81 of file PopObjectAttributeFactory.h.


Constructor & Destructor Documentation

PopObjectAttributeFactory::PopObjectAttributeFactory ( PopObjectFactory const &  model  ) 

Definition at line 28 of file PopObjectAttributeFactory.cpp.

PopObjectAttributeFactory::~PopObjectAttributeFactory (  )  [virtual]

Definition at line 35 of file PopObjectAttributeFactory.cpp.


Member Function Documentation

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().


Member Data Documentation

Definition at line 82 of file PopObjectAttributeFactory.h.

Referenced by CheckAndRemoveAttrName(), createAttributes(), and set().

Definition at line 84 of file PopObjectAttributeFactory.h.

Referenced by createAttributes(), and set().


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

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