Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The class which specifies an xml attribute with an int distribution value. More...
#include <Attribute.h>
Public Member Functions | |
IntDistributionAttribute (const std::string &name, bool required, int defValue) | |
Constructor. More... | |
virtual | ~IntDistributionAttribute () |
Destructor. | |
virtual bool | extract (TiXmlElement *node) |
Extracts the values for this attribute from the xml node. More... | |
virtual void | setDefault () |
If defined, sets the default value for the attribute. | |
virtual IntGenerator * | getIntGenerator () |
Retrieve the parsed int generator. More... | |
Public Member Functions inherited from Menge::Attribute | |
Attribute (const std::string &name, bool required) | |
Constructor. More... | |
virtual | ~Attribute () |
Destructor. | |
const std::string & | getName () const |
Returns a const reference to the name of the attribute. More... | |
bool | isRequired () const |
Reports if this attribute is required to be specified. More... | |
bool | isValid () const |
Reports if the attribute is valid. More... | |
void | clear () |
Prepares the attribute for a parse attempt. | |
virtual int | getInt () |
Retrieve the parsed int value. More... | |
virtual bool | getBool () |
Retrieve the parsed boolean value. More... | |
virtual float | getFloat () |
Retrieve the parsed float value. More... | |
virtual std::string | getString () |
Retrieve the parsed string value. More... | |
virtual size_t | getSizeT () |
Retrieve the parsed size_t value. More... | |
virtual FloatGenerator * | getFloatGenerator () |
Retrieve the parsed float generator. More... | |
virtual Vec2DGenerator * | getVec2DGenerator () |
Retrieve the parsed 2D float generator. More... | |
Protected Attributes | |
int | _default |
The default int value. Meaningless if _required is true. | |
IntGenerator * | _generator |
The parsed generator. | |
Protected Attributes inherited from Menge::Attribute | |
std::string | _name |
The name of the xml attribute. | |
bool | _required |
Determines if the XML must specify this attribute. | |
bool | _valid |
Reports if the attribute is valid. An attribute is always valid if it is not required. Otherwise, it is only valid if it was able to be initialized from the XML. | |
The class which specifies an xml attribute with an int distribution value.
|
inline |
Constructor.
name | The attribute name - in this case, interpreted as the the prefix for the distribution values. |
required | Whether or not the attribute is required (true) or not (false). |
defValue | The default value for the attribute if none is provided. This will be interpreted as a const distribution. |
|
virtual |
Extracts the values for this attribute from the xml node.
This is the main parsing work. It must be performed by each attribute sub-class.
node | The XML node containing the attributes. |
Implements Menge::Attribute.
|
inlinevirtual |
Retrieve the parsed int generator.
An | AttributeDefinitionException if the types are wrong. |
Reimplemented from Menge::Attribute.