![]() |
SUMO - Simulation of Urban MObility
|
struct with the attribute Properties More...
#include <GNEAttributeCarrier.h>
Public Member Functions | |
AttributeProperties () | |
default constructor More... | |
AttributeProperties (int attributeProperty, int positionListed, const std::string &definition, const std::string &defaultValue, const std::vector< std::string > &discreteValues, SumoXMLAttr synonym, double minimum=0, double maximum=0) | |
parameter constructor More... | |
bool | cannotBeZero () const |
return true if atribute cannot be zero More... | |
void | checkAttributeIntegrity () |
check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float) More... | |
SumoXMLAttr | getAttrSynonym () const |
get tag synonym More... | |
const std::string & | getDefaultValue () const |
get default value More... | |
const std::string & | getDefinition () const |
get default value More... | |
std::string | getDescription () const |
return a description of attribute More... | |
const std::vector< std::string > & | getDiscreteValues () const |
get discrete values More... | |
double | getMaximumRange () const |
get maximum range More... | |
double | getMinimumRange () const |
get minimum range More... | |
int | getPositionListed () const |
get position in list (used in frames for listing attributes with certain sort) More... | |
bool | hasAttrRange () const |
return true if Attr correspond to an element that only accept a range of values More... | |
bool | hasAttrSynonym () const |
return true if Attr correspond to an element that will be written in XML with another name More... | |
bool | hasDefaultValue () const |
return true if attribute owns a default value More... | |
bool | isBool () const |
return true if atribute is boolean More... | |
bool | isColor () const |
return true if atribute is a color More... | |
bool | isCombinable () const |
return true if atribute is combinable with other Attribute More... | |
bool | isDiscrete () const |
return true if atribute is discrete More... | |
bool | isFilename () const |
return true if atribute is a filename More... | |
bool | isFloat () const |
return true if atribute is a float More... | |
bool | isInt () const |
return true if atribute is an integer More... | |
bool | isList () const |
return true if atribute is a list More... | |
bool | isNonEditable () const |
return true if atribute isn't editable More... | |
bool | isNumerical () const |
return true if atribute is numerical (int or float) More... | |
bool | isOptional () const |
return true if atribute is optional More... | |
bool | isposition () const |
return true if atribute is a position More... | |
bool | isPositive () const |
return true if atribute is positive More... | |
bool | isProbability () const |
return true if atribute is a probability More... | |
bool | isSecuential () const |
return true if atribute is sequential More... | |
bool | isString () const |
return true if atribute is a string More... | |
bool | isSVCPermission () const |
return true if atribute is a VehicleClass More... | |
bool | isTime () const |
return true if atribute is time More... | |
bool | isUnique () const |
return true if atribute is unique More... | |
bool | isVClass () const |
return true if atribute is a VehicleClass More... | |
~AttributeProperties () | |
destructor More... | |
Private Attributes | |
int | myAttributeProperty |
Property of attribute. More... | |
SumoXMLAttr | myAttrSynonym |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) More... | |
std::string | myDefaultValue |
default value (by default empty) More... | |
std::string | myDefinition |
text with a definition of attribute More... | |
std::vector< std::string > | myDiscreteValues |
discrete values that can take this Attribute (by default empty) More... | |
double | myMaximumRange |
maxium Range More... | |
double | myMinimumRange |
minimun Range More... | |
int | myPositionListed |
listed position More... | |
struct with the attribute Properties
Definition at line 87 of file GNEAttributeCarrier.h.
GNEAttributeCarrier::AttributeProperties::AttributeProperties | ( | ) |
default constructor
Definition at line 55 of file GNEAttributeCarrier.cpp.
GNEAttributeCarrier::AttributeProperties::AttributeProperties | ( | int | attributeProperty, |
int | positionListed, | ||
const std::string & | definition, | ||
const std::string & | defaultValue, | ||
const std::vector< std::string > & | discreteValues, | ||
SumoXMLAttr | synonym, | ||
double | minimum = 0 , |
||
double | maximum = 0 |
||
) |
parameter constructor
Definition at line 65 of file GNEAttributeCarrier.cpp.
GNEAttributeCarrier::AttributeProperties::~AttributeProperties | ( | ) |
destructor
Definition at line 77 of file GNEAttributeCarrier.cpp.
bool GNEAttributeCarrier::AttributeProperties::cannotBeZero | ( | ) | const |
return true if atribute cannot be zero
Definition at line 304 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_NOTZERO, and myAttributeProperty.
void GNEAttributeCarrier::AttributeProperties::checkAttributeIntegrity | ( | ) |
check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float)
Definition at line 81 of file GNEAttributeCarrier.cpp.
References hasAttrRange(), hasAttrSynonym(), isColor(), isList(), isSecuential(), myAttrSynonym, myDefaultValue, myMaximumRange, myMinimumRange, and SUMO_ATTR_NOTHING.
SumoXMLAttr GNEAttributeCarrier::AttributeProperties::getAttrSynonym | ( | ) | const |
get tag synonym
Definition at line 203 of file GNEAttributeCarrier.cpp.
References hasAttrSynonym(), and myAttrSynonym.
const std::string & GNEAttributeCarrier::AttributeProperties::getDefaultValue | ( | ) | const |
get default value
Definition at line 118 of file GNEAttributeCarrier.cpp.
References myDefaultValue.
Referenced by GNEFrame::ACAttributeRow::onCmdSetColorAttribute().
const std::string & GNEAttributeCarrier::AttributeProperties::getDefinition | ( | ) | const |
std::string GNEAttributeCarrier::AttributeProperties::getDescription | ( | ) | const |
return a description of attribute
Definition at line 124 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_ANGLE, GNEAttributeCarrier::ATTRPROPERTY_BOOL, GNEAttributeCarrier::ATTRPROPERTY_COLOR, GNEAttributeCarrier::ATTRPROPERTY_COMBINABLE, GNEAttributeCarrier::ATTRPROPERTY_DISCRETE, GNEAttributeCarrier::ATTRPROPERTY_FILENAME, GNEAttributeCarrier::ATTRPROPERTY_FLOAT, GNEAttributeCarrier::ATTRPROPERTY_INT, GNEAttributeCarrier::ATTRPROPERTY_LIST, GNEAttributeCarrier::ATTRPROPERTY_NONEDITABLE, GNEAttributeCarrier::ATTRPROPERTY_OPTIONAL, GNEAttributeCarrier::ATTRPROPERTY_POSITION, GNEAttributeCarrier::ATTRPROPERTY_POSITIVE, GNEAttributeCarrier::ATTRPROPERTY_PROBABILITY, GNEAttributeCarrier::ATTRPROPERTY_STRING, GNEAttributeCarrier::ATTRPROPERTY_TIME, GNEAttributeCarrier::ATTRPROPERTY_UNIQUE, GNEAttributeCarrier::ATTRPROPERTY_VCLASS, and myAttributeProperty.
const std::vector< std::string > & GNEAttributeCarrier::AttributeProperties::getDiscreteValues | ( | ) | const |
get discrete values
Definition at line 197 of file GNEAttributeCarrier.cpp.
References myDiscreteValues.
double GNEAttributeCarrier::AttributeProperties::getMaximumRange | ( | ) | const |
get maximum range
Definition at line 223 of file GNEAttributeCarrier.cpp.
References hasAttrRange(), and myMaximumRange.
Referenced by GNEFrame::ACAttributeRow::onCmdSetAttribute().
double GNEAttributeCarrier::AttributeProperties::getMinimumRange | ( | ) | const |
get minimum range
Definition at line 213 of file GNEAttributeCarrier.cpp.
References hasAttrRange(), and myMinimumRange.
Referenced by GNEFrame::ACAttributeRow::onCmdSetAttribute().
int GNEAttributeCarrier::AttributeProperties::getPositionListed | ( | ) | const |
get position in list (used in frames for listing attributes with certain sort)
Definition at line 106 of file GNEAttributeCarrier.cpp.
References myPositionListed.
bool GNEAttributeCarrier::AttributeProperties::hasAttrRange | ( | ) | const |
return true if Attr correspond to an element that only accept a range of values
Definition at line 244 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_RANGE, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), getMaximumRange(), getMinimumRange(), and GNEFrame::ACAttributeRow::onCmdSetAttribute().
bool GNEAttributeCarrier::AttributeProperties::hasAttrSynonym | ( | ) | const |
return true if Attr correspond to an element that will be written in XML with another name
Definition at line 239 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_SYNONYM, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), and getAttrSynonym().
bool GNEAttributeCarrier::AttributeProperties::hasDefaultValue | ( | ) | const |
return true if attribute owns a default value
Definition at line 233 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_DEFAULTVALUE, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isBool | ( | ) | const |
return true if atribute is boolean
Definition at line 262 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_BOOL, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::getValue(), and GNEFrame::ACAttributeRow::showParameter().
bool GNEAttributeCarrier::AttributeProperties::isColor | ( | ) | const |
return true if atribute is a color
Definition at line 310 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_COLOR, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), GNEFrame::ACAttributeRow::onCmdSetAttribute(), and GNEFrame::ACAttributeRow::showParameter().
bool GNEAttributeCarrier::AttributeProperties::isCombinable | ( | ) | const |
return true if atribute is combinable with other Attribute
Definition at line 364 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_COMBINABLE, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isDiscrete | ( | ) | const |
return true if atribute is discrete
Definition at line 358 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_DISCRETE, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isFilename | ( | ) | const |
return true if atribute is a filename
Definition at line 316 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_FILENAME, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::onCmdSetAttribute().
bool GNEAttributeCarrier::AttributeProperties::isFloat | ( | ) | const |
return true if atribute is a float
Definition at line 256 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_FLOAT, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::getValue(), GNEFrame::ACAttributeRow::onCmdSetAttribute(), and GNEFrame::ACAttributeRow::showParameter().
bool GNEAttributeCarrier::AttributeProperties::isInt | ( | ) | const |
return true if atribute is an integer
Definition at line 250 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_INT, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::getValue(), GNEFrame::ACAttributeRow::onCmdSetAttribute(), and GNEFrame::ACAttributeRow::showParameter().
bool GNEAttributeCarrier::AttributeProperties::isList | ( | ) | const |
return true if atribute is a list
Definition at line 334 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_LIST, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), and GNENet::replaceInListAttribute().
bool GNEAttributeCarrier::AttributeProperties::isNonEditable | ( | ) | const |
return true if atribute isn't editable
Definition at line 370 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_NONEDITABLE, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isNumerical | ( | ) | const |
return true if atribute is numerical (int or float)
Definition at line 286 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_FLOAT, GNEAttributeCarrier::ATTRPROPERTY_INT, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isOptional | ( | ) | const |
return true if atribute is optional
Definition at line 352 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_OPTIONAL, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isposition | ( | ) | const |
return true if atribute is a position
Definition at line 274 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_POSITION, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isPositive | ( | ) | const |
return true if atribute is positive
Definition at line 298 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_POSITIVE, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::onCmdSetAttribute().
bool GNEAttributeCarrier::AttributeProperties::isProbability | ( | ) | const |
return true if atribute is a probability
Definition at line 280 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_PROBABILITY, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::onCmdSetAttribute().
bool GNEAttributeCarrier::AttributeProperties::isSecuential | ( | ) | const |
return true if atribute is sequential
Definition at line 340 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_SECUENCIAL, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeCarrier::AttributeProperties::isString | ( | ) | const |
return true if atribute is a string
Definition at line 268 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_STRING, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isSVCPermission | ( | ) | const |
return true if atribute is a VehicleClass
Definition at line 328 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_LIST, GNEAttributeCarrier::ATTRPROPERTY_VCLASS, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isTime | ( | ) | const |
return true if atribute is time
Definition at line 292 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_TIME, and myAttributeProperty.
Referenced by GNEFrame::ACAttributeRow::getValue(), and GNEFrame::ACAttributeRow::onCmdSetAttribute().
bool GNEAttributeCarrier::AttributeProperties::isUnique | ( | ) | const |
return true if atribute is unique
Definition at line 346 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_UNIQUE, and myAttributeProperty.
bool GNEAttributeCarrier::AttributeProperties::isVClass | ( | ) | const |
return true if atribute is a VehicleClass
Definition at line 322 of file GNEAttributeCarrier.cpp.
References GNEAttributeCarrier::ATTRPROPERTY_VCLASS, and myAttributeProperty.
|
private |
Property of attribute.
Definition at line 199 of file GNEAttributeCarrier.h.
Referenced by cannotBeZero(), getDescription(), hasAttrRange(), hasAttrSynonym(), hasDefaultValue(), isBool(), isColor(), isCombinable(), isDiscrete(), isFilename(), isFloat(), isInt(), isList(), isNonEditable(), isNumerical(), isOptional(), isposition(), isPositive(), isProbability(), isSecuential(), isString(), isSVCPermission(), isTime(), isUnique(), and isVClass().
|
private |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written)
Definition at line 214 of file GNEAttributeCarrier.h.
Referenced by checkAttributeIntegrity(), and getAttrSynonym().
|
private |
default value (by default empty)
Definition at line 208 of file GNEAttributeCarrier.h.
Referenced by checkAttributeIntegrity(), and getDefaultValue().
|
private |
text with a definition of attribute
Definition at line 205 of file GNEAttributeCarrier.h.
Referenced by getDefinition().
|
private |
discrete values that can take this Attribute (by default empty)
Definition at line 211 of file GNEAttributeCarrier.h.
Referenced by getDiscreteValues().
|
private |
maxium Range
Definition at line 220 of file GNEAttributeCarrier.h.
Referenced by checkAttributeIntegrity(), and getMaximumRange().
|
private |
minimun Range
Definition at line 217 of file GNEAttributeCarrier.h.
Referenced by checkAttributeIntegrity(), and getMinimumRange().
|
private |
listed position
Definition at line 202 of file GNEAttributeCarrier.h.
Referenced by getPositionListed().