45 #ifndef __ELEMENT_FACTORY_H__
46 #define __ELEMENT_FACTORY_H__
58 template <
class Element >
59 class ElementFactory {
96 virtual const char *
name()
const = 0;
134 if ( !
setFromXML( element, node, behaveFldr ) ) {
176 virtual bool setFromXML(
Element * element, TiXmlElement * node,
const std::string & specFldr )
const {
188 #endif // __ELEMENT_FACTORY_H__
A set of attributes.
Definition: AttributeSet.h:88
virtual Element * instance() const =0
Create an instance of this class's condition.
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
void clear()
Prepares the set to parse a new instance.
Definition: AttributeSet.cpp:177
ElementFactory()
Default constructor.
Definition: ElementFactory.h:64
virtual ~ElementFactory()
Destructor.
Definition: ElementFactory.h:84
void destroy()
This supplants the destructor.
Definition: ElementFactory.h:76
virtual const char * description() const =0
A description of the action.
virtual const char * name() const =0
The name of the action.
The basic interface of extendible Menge Elements.
Definition: Element.h:67
Element * createInstance(TiXmlElement *node, const std::string &behaveFldr) const
Parses the xml data.
Definition: ElementFactory.h:132
virtual bool setFromXML(Element *element, TiXmlElement *node, const std::string &specFldr) const
Given a pointer to an element instance, sets the appropriate fields from the provided XML node...
Definition: ElementFactory.h:176
void destroy()
This supplants the destructor.
Definition: Element.h:83
Defines the set of element attributes.
AttributeSet _attrSet
The attribute set for this factory.
Definition: ElementFactory.h:184
bool extract(TiXmlElement *node)
Parses the node for the given attributes.
Definition: AttributeSet.cpp:185
bool thisFactory(const std::string &typeName) const
Reports if the xml node defines an element for this factory.
Definition: ElementFactory.h:117