Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Menge::Agents::HexLatticeGeneratorFactory Class Reference

Factory for HexLatticeGenerator. More...

#include <HexLatticeGenerator.h>

Inheritance diagram for Menge::Agents::HexLatticeGeneratorFactory:
Menge::Agents::AgentGeneratorFactory Menge::ElementFactory< AgentGenerator >

Public Member Functions

 HexLatticeGeneratorFactory ()
 Constructor.
 
virtual const char * name () const
 The name of the generator type. More...
 
virtual const char * description () const
 A description of the agent generator. More...
 
- Public Member Functions inherited from Menge::ElementFactory< AgentGenerator >
 ElementFactory ()
 Default constructor.
 
void destroy ()
 This supplants the destructor. More...
 
bool thisFactory (const std::string &typeName) const
 Reports if the xml node defines an element for this factory. More...
 
AgentGenerator * createInstance (TiXmlElement *node, const std::string &behaveFldr) const
 Parses the xml data. More...
 

Protected Member Functions

AgentGeneratorinstance () const
 Create an instance of this class's agent generator implementation. More...
 
virtual bool setFromXML (AgentGenerator *gen, TiXmlElement *node, const std::string &specFldr) const
 Given a pointer to an AgentGenerator instance, sets the appropriate fields from the provided XML node. More...
 
- Protected Member Functions inherited from Menge::ElementFactory< AgentGenerator >
virtual ~ElementFactory ()
 Destructor.
 
virtual bool setFromXML (AgentGenerator *element, TiXmlElement *node, const std::string &specFldr) const
 Given a pointer to an element instance, sets the appropriate fields from the provided XML node. More...
 

Protected Attributes

size_t _anchorXID
 The identifier for the "anchor_x" float parameter.
 
size_t _anchorYID
 The identifier for the "anchor_y" float parameter.
 
size_t _alignID
 The identifier for the "alignment" string parameter.
 
size_t _rowDirID
 The identifier for the "row_direction" string parameter.
 
size_t _densityID
 The identifier for the "density" float parameter.
 
size_t _widthID
 The identifier for the "width" float parameter.
 
size_t _popID
 The identifier for the "count" size_t parameter.
 
size_t _rotID
 The identifier for the "rotation" float parameter.
 
- Protected Attributes inherited from Menge::ElementFactory< AgentGenerator >
AttributeSet _attrSet
 The attribute set for this factory.
 

Detailed Description

Factory for HexLatticeGenerator.

Member Function Documentation

virtual const char* Menge::Agents::HexLatticeGeneratorFactory::description ( ) const
inlinevirtual

A description of the agent generator.

Each agent generator factory must override this function.

Returns
A string containing the agent generator description.

Implements Menge::ElementFactory< AgentGenerator >.

AgentGenerator* Menge::Agents::HexLatticeGeneratorFactory::instance ( ) const
inlineprotectedvirtual

Create an instance of this class's agent generator implementation.

All AgentGeneratorFactory sub-classes must override this by creating (on the heap) a new instance of its corresponding generator type. The various field values of the instance will be set in a subsequent call to AgentGeneratorFactory::setFromXML. The caller of this function takes ownership of the memory.

Returns
A pointer to a newly instantiated AgentGenerator class.

Implements Menge::ElementFactory< AgentGenerator >.

virtual const char* Menge::Agents::HexLatticeGeneratorFactory::name ( ) const
inlinevirtual

The name of the generator type.

The generator's name must be unique among all registered agent generator components. Each agent generator factory must override this function.

Returns
A string containing the unique elevation name.

Implements Menge::ElementFactory< AgentGenerator >.

bool Menge::Agents::HexLatticeGeneratorFactory::setFromXML ( AgentGenerator gen,
TiXmlElement *  node,
const std::string &  specFldr 
) const
protectedvirtual

Given a pointer to an AgentGenerator instance, sets the appropriate fields from the provided XML node.

It is assumed that the value of the type attribute is this AgentGenerator's type. (i.e. AgentGenerator::thisFactory has already been called and returned true.) If sub-classes of AgentGeneratorFactory introduce new AgentGenerator parameters, then the sub-class should override this method but explicitly call the parent class's version.

Parameters
genA pointer to the agent generator whose attributes are to be set.
nodeThe XML node containing the agent generator attributes.
specFldrThe path to the specification file. If the AgentGenerator references resources in the file system, it should be defined relative to the specification file location. This is the folder containing that path.
Returns
A boolean reporting success (true) or failure (false).

Reimplemented from Menge::Agents::AgentGeneratorFactory.


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