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::NamedStateMemberTargetFactory Class Reference

The factory to generate NamedStateMemberTarget instances. More...

#include <StateMemberTarget.h>

Inheritance diagram for Menge::NamedStateMemberTargetFactory:
Menge::AgentEventTargetFactory Menge::EventTargetFactory Menge::ElementFactory< EventTarget >

Public Member Functions

 NamedStateMemberTargetFactory ()
 Constructor.
 
virtual const char * name () const
 The name of the target. More...
 
virtual const char * description () const
 A description of the target. More...
 
- Public Member Functions inherited from Menge::ElementFactory< EventTarget >
 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...
 
EventTargetcreateInstance (TiXmlElement *node, const std::string &behaveFldr) const
 Parses the xml data. More...
 

Protected Member Functions

EventTargetinstance () const
 Create an instance of this class's target. More...
 
virtual bool setFromXML (EventTarget *target, TiXmlElement *node, const std::string &behaveFldr) const
 Given a pointer to an EventTarget instance, sets the appropriate fields from the provided XML node. More...
 
- Protected Member Functions inherited from Menge::ElementFactory< EventTarget >
virtual ~ElementFactory ()
 Destructor.
 

Protected Attributes

size_t _stateID
 The identifier for the "state" string attribute.
 
size_t _isMemberID
 The identifier for the "is_member" bool attribute.
 
- Protected Attributes inherited from Menge::ElementFactory< EventTarget >
AttributeSet _attrSet
 The attribute set for this factory.
 

Detailed Description

The factory to generate NamedStateMemberTarget instances.

Member Function Documentation

virtual const char* Menge::NamedStateMemberTargetFactory::description ( ) const
inlinevirtual

A description of the target.

Each target factory must override this function.

Returns
A string containing the target description.

Implements Menge::ElementFactory< EventTarget >.

EventTarget* Menge::NamedStateMemberTargetFactory::instance ( ) const
inlineprotectedvirtual

Create an instance of this class's target.

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

Returns
A pointer to a newly instantiated EventTarget class.

Implements Menge::ElementFactory< EventTarget >.

virtual const char* Menge::NamedStateMemberTargetFactory::name ( ) const
inlinevirtual

The name of the target.

The target's name must be unique among all registered targets. Each target factory must override this function.

Returns
A string containing the unique target name.

Implements Menge::ElementFactory< EventTarget >.

bool Menge::NamedStateMemberTargetFactory::setFromXML ( EventTarget target,
TiXmlElement *  node,
const std::string &  behaveFldr 
) const
protectedvirtual

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

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

Parameters
targetA pointer to the target whose attributes are to be set.
nodeThe XML node containing the target attributes.
behaveFldrThe path to the behavior file. If the target 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 from Menge::ElementFactory< EventTarget >.


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