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::BFSM::GoalFactory Class Reference

A class for parsing the xml description of a goal and instantiating particular instances. More...

#include <GoalFactory.h>

Inheritance diagram for Menge::BFSM::GoalFactory:
Menge::ElementFactory< Goal > Menge::BFSM::AABBGoalFactory Menge::BFSM::CircleGoalFactory Menge::BFSM::OBBGoalFactory Menge::BFSM::PointGoalFactory

Public Member Functions

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

Protected Member Functions

virtual bool setFromXML (Goal *goal, TiXmlElement *node, const std::string &behaveFldr) const
 Given a pointer to a Goal instance, sets the appropriate fields from the provided XML node. More...
 
- Protected Member Functions inherited from Menge::ElementFactory< Goal >
virtual ~ElementFactory ()
 Destructor.
 
virtual Goal * instance () const =0
 Create an instance of this class's condition. More...
 
virtual bool setFromXML (Goal *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 _idID
 The identifier for the "id" size_t attribute.
 
size_t _capacityID
 The identifier for the "capacity" size_t attribute.
 
size_t _weightID
 The identifier for the "weight" size_t attribute.
 
- Protected Attributes inherited from Menge::ElementFactory< Goal >
AttributeSet _attrSet
 The attribute set for this factory.
 

Detailed Description

A class for parsing the xml description of a goal and instantiating particular instances.

Member Function Documentation

bool Menge::BFSM::GoalFactory::setFromXML ( Goal goal,
TiXmlElement *  node,
const std::string &  behaveFldr 
) const
protectedvirtual

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

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

Parameters
goalA pointer to the goal whose attributes are to be set.
nodeThe XML node containing the goal attributes.
behaveFldrThe path to the behavior file. If the condition references resources in the file system, it should be defined relative to the behavior file location. This is the folder containing that path.
Returns
A boolean reporting success (true) or failure (false).

Reimplemented in Menge::BFSM::OBBGoalFactory, Menge::BFSM::AABBGoalFactory, Menge::BFSM::CircleGoalFactory, and Menge::BFSM::PointGoalFactory.


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