![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEAttributeProperties.h>
Public Types | |
enum | AttrProperty { INT = 1 << 0 , FLOAT = 1 << 1 , SUMOTIME = 1 << 2 , BOOL = 1 << 3 , STRING = 1 << 4 , POSITION = 1 << 5 , COLOR = 1 << 6 , VCLASS = 1 << 7 , POSITIVE = 1 << 8 , UNIQUE = 1 << 9 , FILENAME = 1 << 10 , DISCRETE = 1 << 11 , PROBABILITY = 1 << 12 , ANGLE = 1 << 13 , LIST = 1 << 14 , SECUENCIAL = 1 << 15 , DEFAULTVALUE = 1 << 16 , VCLASSES = 1 << 17 , SYNONYM = 1 << 18 , RANGE = 1 << 19 , EXTENDED = 1 << 20 , UPDATEGEOMETRY = 1 << 21 , ACTIVATABLE = 1 << 22 , FLOWDEFINITION = 1 << 23 , AUTOMATICID = 1 << 24 } |
struct with the tag Properties More... | |
Public Member Functions | |
void | checkAttributeIntegrity () const |
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 | getAttr () const |
get XML Attribute More... | |
const std::string & | getAttrStr () const |
get XML Attribute More... | |
SumoXMLAttr | getAttrSynonym () const |
get tag synonym More... | |
bool | getDefaultActivated () const |
get default active value 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... | |
const GNETagProperties & | getTagPropertyParent () const |
get reference to tagProperty parent More... | |
GNEAttributeProperties () | |
default constructor More... | |
GNEAttributeProperties (const SumoXMLAttr attribute, const int attributeProperty, const std::string &definition, std::string defaultValue="") | |
parameter constructor 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 | hasAutomaticID () const |
return true if attribute ID can generate an automatic ID More... | |
bool | hasDefaultValue () const |
return true if attribute owns a default value More... | |
bool | isActivatable () const |
return true if atribute is activatable More... | |
bool | isBool () const |
return true if atribute is boolean More... | |
bool | isColor () const |
return true if atribute is a color More... | |
bool | isDiscrete () const |
return true if atribute is discrete More... | |
bool | isExtended () const |
return true if atribute is extended More... | |
bool | isFilename () const |
return true if atribute is a filename More... | |
bool | isFloat () const |
return true if atribute is a float More... | |
bool | isFlowDefinition () const |
return true if atribute is part of a flow definition More... | |
bool | isInt () const |
return true if atribute is an integer More... | |
bool | isList () const |
return true if atribute is a list More... | |
bool | isNumerical () const |
return true if atribute is numerical (int or float) 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 | isSUMOTime () const |
return true if atribute is a SUMOTime More... | |
bool | isSVCPermission () const |
return true if atribute is a VehicleClass More... | |
bool | isUnique () const |
return true if atribute is unique More... | |
bool | isVClass () const |
return true if atribute is a VehicleClass More... | |
bool | isVClasses () const |
return true if atribute is a list of VClasses More... | |
bool | requireUpdateGeometry () const |
return true if atribute requires a update geometry in setAttribute(...) More... | |
void | setDefaultActivated (const bool value) |
set default activated value More... | |
void | setDiscreteValues (const std::vector< std::string > &discreteValues) |
set discrete values More... | |
void | setRange (const double minimum, const double maximum) |
set range More... | |
void | setSynonym (const SumoXMLAttr synonym) |
set synonim More... | |
void | setTagPropertyParent (GNETagProperties *tagPropertyParent) |
set tag property parent More... | |
~GNEAttributeProperties () | |
destructor More... | |
Private Attributes | |
SumoXMLAttr | myAttribute |
XML Attribute. More... | |
int | myAttributeProperty |
Property of attribute. More... | |
std::string | myAttrStr |
string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls) More... | |
SumoXMLAttr | myAttrSynonym |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) More... | |
bool | myDefaultActivated |
default activated (by default false) 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... | |
GNETagProperties * | myTagPropertyParent |
pointer to tagProperty parent More... | |
Definition at line 42 of file GNEAttributeProperties.h.
struct with the tag Properties
Definition at line 47 of file GNEAttributeProperties.h.
GNEAttributeProperties::GNEAttributeProperties | ( | ) |
default constructor
Definition at line 34 of file GNEAttributeProperties.cpp.
GNEAttributeProperties::GNEAttributeProperties | ( | const SumoXMLAttr | attribute, |
const int | attributeProperty, | ||
const std::string & | definition, | ||
std::string | defaultValue = "" |
||
) |
parameter constructor
Definition at line 47 of file GNEAttributeProperties.cpp.
References ACTIVATABLE, DEFAULTVALUE, FLOWDEFINITION, and toString().
GNEAttributeProperties::~GNEAttributeProperties | ( | ) |
destructor
Definition at line 73 of file GNEAttributeProperties.cpp.
void GNEAttributeProperties::checkAttributeIntegrity | ( | ) | const |
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 77 of file GNEAttributeProperties.cpp.
References hasAttrRange(), hasAttrSynonym(), isFloat(), isInt(), isList(), isPositive(), isSecuential(), isSUMOTime(), myAttrSynonym, myMaximumRange, myMinimumRange, and SUMO_ATTR_NOTHING.
SumoXMLAttr GNEAttributeProperties::getAttr | ( | ) | const |
get XML Attribute
Definition at line 159 of file GNEAttributeProperties.cpp.
References myAttribute.
Referenced by GNETagProperties::addAttribute(), and GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
const std::string & GNEAttributeProperties::getAttrStr | ( | ) | const |
get XML Attribute
Definition at line 165 of file GNEAttributeProperties.cpp.
References myAttrStr.
Referenced by GNETagProperties::addAttribute(), and GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
SumoXMLAttr GNEAttributeProperties::getAttrSynonym | ( | ) | const |
get tag synonym
Definition at line 279 of file GNEAttributeProperties.cpp.
References hasAttrSynonym(), and myAttrSynonym.
bool GNEAttributeProperties::getDefaultActivated | ( | ) | const |
get default active value
Definition at line 200 of file GNEAttributeProperties.cpp.
References myDefaultActivated.
const std::string & GNEAttributeProperties::getDefaultValue | ( | ) | const |
get default value
Definition at line 194 of file GNEAttributeProperties.cpp.
References myDefaultValue.
const std::string & GNEAttributeProperties::getDefinition | ( | ) | const |
get default value
Definition at line 188 of file GNEAttributeProperties.cpp.
References myDefinition.
std::string GNEAttributeProperties::getDescription | ( | ) | const |
const std::vector< std::string > & GNEAttributeProperties::getDiscreteValues | ( | ) | const |
get discrete values
Definition at line 273 of file GNEAttributeProperties.cpp.
References myDiscreteValues.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
double GNEAttributeProperties::getMaximumRange | ( | ) | const |
get maximum range
Definition at line 299 of file GNEAttributeProperties.cpp.
References hasAttrRange(), and myMaximumRange.
double GNEAttributeProperties::getMinimumRange | ( | ) | const |
get minimum range
Definition at line 289 of file GNEAttributeProperties.cpp.
References hasAttrRange(), and myMinimumRange.
int GNEAttributeProperties::getPositionListed | ( | ) | const |
get position in list (used in frames for listing attributes with certain sort)
Definition at line 177 of file GNEAttributeProperties.cpp.
References GNETagProperties::begin(), GNETagProperties::end(), myAttribute, and myTagPropertyParent.
const GNETagProperties & GNEAttributeProperties::getTagPropertyParent | ( | ) | const |
get reference to tagProperty parent
Definition at line 171 of file GNEAttributeProperties.cpp.
References myTagPropertyParent.
Referenced by GNEFrameAttributeModules::isSupermodeValid().
bool GNEAttributeProperties::hasAttrRange | ( | ) | const |
return true if Attr correspond to an element that only accept a range of values
Definition at line 320 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and RANGE.
Referenced by checkAttributeIntegrity(), getMaximumRange(), getMinimumRange(), and setRange().
bool GNEAttributeProperties::hasAttrSynonym | ( | ) | const |
return true if Attr correspond to an element that will be written in XML with another name
Definition at line 315 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SYNONYM.
Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().
bool GNEAttributeProperties::hasAutomaticID | ( | ) | const |
return true if attribute ID can generate an automatic ID
Definition at line 458 of file GNEAttributeProperties.cpp.
References AUTOMATICID, and myAttributeProperty.
bool GNEAttributeProperties::hasDefaultValue | ( | ) | const |
return true if attribute owns a default value
Definition at line 309 of file GNEAttributeProperties.cpp.
References DEFAULTVALUE, and myAttributeProperty.
bool GNEAttributeProperties::isActivatable | ( | ) | const |
return true if atribute is activatable
Definition at line 446 of file GNEAttributeProperties.cpp.
References ACTIVATABLE, and myAttributeProperty.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow(), and setDefaultActivated().
bool GNEAttributeProperties::isBool | ( | ) | const |
return true if atribute is boolean
Definition at line 344 of file GNEAttributeProperties.cpp.
References BOOL, and myAttributeProperty.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
bool GNEAttributeProperties::isColor | ( | ) | const |
return true if atribute is a color
Definition at line 380 of file GNEAttributeProperties.cpp.
References COLOR, and myAttributeProperty.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
bool GNEAttributeProperties::isDiscrete | ( | ) | const |
return true if atribute is discrete
Definition at line 422 of file GNEAttributeProperties.cpp.
References DISCRETE, and myAttributeProperty.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow(), and setDiscreteValues().
bool GNEAttributeProperties::isExtended | ( | ) | const |
return true if atribute is extended
Definition at line 434 of file GNEAttributeProperties.cpp.
References EXTENDED, and myAttributeProperty.
bool GNEAttributeProperties::isFilename | ( | ) | const |
return true if atribute is a filename
Definition at line 386 of file GNEAttributeProperties.cpp.
References FILENAME, and myAttributeProperty.
bool GNEAttributeProperties::isFloat | ( | ) | const |
return true if atribute is a float
Definition at line 332 of file GNEAttributeProperties.cpp.
References FLOAT, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isFlowDefinition | ( | ) | const |
return true if atribute is part of a flow definition
Definition at line 452 of file GNEAttributeProperties.cpp.
References FLOWDEFINITION, and myAttributeProperty.
Referenced by GNEAttributeCarrier::getAlternativeValueForDisabledAttributes().
bool GNEAttributeProperties::isInt | ( | ) | const |
return true if atribute is an integer
Definition at line 326 of file GNEAttributeProperties.cpp.
References INT, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isList | ( | ) | const |
return true if atribute is a list
Definition at line 404 of file GNEAttributeProperties.cpp.
References LIST, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), and GNENet::replaceInListAttribute().
bool GNEAttributeProperties::isNumerical | ( | ) | const |
return true if atribute is numerical (int or float)
Definition at line 368 of file GNEAttributeProperties.cpp.
References FLOAT, INT, myAttributeProperty, and SUMOTIME.
bool GNEAttributeProperties::isposition | ( | ) | const |
return true if atribute is a position
Definition at line 356 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and POSITION.
bool GNEAttributeProperties::isPositive | ( | ) | const |
return true if atribute is positive
Definition at line 374 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and POSITIVE.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isProbability | ( | ) | const |
return true if atribute is a probability
Definition at line 362 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and PROBABILITY.
bool GNEAttributeProperties::isSecuential | ( | ) | const |
return true if atribute is sequential
Definition at line 410 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SECUENCIAL.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isString | ( | ) | const |
return true if atribute is a string
Definition at line 350 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and STRING.
bool GNEAttributeProperties::isSUMOTime | ( | ) | const |
return true if atribute is a SUMOTime
Definition at line 338 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SUMOTIME.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isSVCPermission | ( | ) | const |
return true if atribute is a VehicleClass
Definition at line 398 of file GNEAttributeProperties.cpp.
References LIST, myAttributeProperty, and VCLASS.
bool GNEAttributeProperties::isUnique | ( | ) | const |
return true if atribute is unique
Definition at line 416 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and UNIQUE.
bool GNEAttributeProperties::isVClass | ( | ) | const |
return true if atribute is a VehicleClass
Definition at line 392 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and VCLASS.
bool GNEAttributeProperties::isVClasses | ( | ) | const |
return true if atribute is a list of VClasses
Definition at line 428 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and VCLASSES.
Referenced by GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow().
bool GNEAttributeProperties::requireUpdateGeometry | ( | ) | const |
return true if atribute requires a update geometry in setAttribute(...)
Definition at line 440 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and UPDATEGEOMETRY.
Referenced by GNEChange_Attribute::redo(), GNEVType::setAttribute(), and GNEChange_Attribute::undo().
void GNEAttributeProperties::setDefaultActivated | ( | const bool | value | ) |
set default activated value
Definition at line 114 of file GNEAttributeProperties.cpp.
References isActivatable(), and myDefaultActivated.
Referenced by GNEAttributeCarrier::fillCommonStopAttributes().
void GNEAttributeProperties::setDiscreteValues | ( | const std::vector< std::string > & | discreteValues | ) |
set discrete values
Definition at line 104 of file GNEAttributeProperties.cpp.
References isDiscrete(), and myDiscreteValues.
Referenced by GNEAttributeCarrier::fillCarFollowingModelAttributes(), GNEAttributeCarrier::fillCommonStopAttributes(), GNEAttributeCarrier::fillDemandElements(), and GNEAttributeCarrier::fillNetworkElements().
void GNEAttributeProperties::setRange | ( | const double | minimum, |
const double | maximum | ||
) |
set range
Definition at line 134 of file GNEAttributeProperties.cpp.
References hasAttrRange(), myMaximumRange, and myMinimumRange.
Referenced by GNEAttributeCarrier::fillCarFollowingModelAttributes().
void GNEAttributeProperties::setSynonym | ( | const SumoXMLAttr | synonym | ) |
set synonim
Definition at line 124 of file GNEAttributeProperties.cpp.
References hasAttrSynonym(), and myAttrSynonym.
void GNEAttributeProperties::setTagPropertyParent | ( | GNETagProperties * | tagPropertyParent | ) |
set tag property parent
Definition at line 153 of file GNEAttributeProperties.cpp.
References myTagPropertyParent.
|
private |
XML Attribute.
Definition at line 218 of file GNEAttributeProperties.h.
Referenced by getAttr(), and getPositionListed().
|
private |
Property of attribute.
Definition at line 227 of file GNEAttributeProperties.h.
Referenced by getDescription(), hasAttrRange(), hasAttrSynonym(), hasAutomaticID(), hasDefaultValue(), isActivatable(), isBool(), isColor(), isDiscrete(), isExtended(), isFilename(), isFloat(), isFlowDefinition(), isInt(), isList(), isNumerical(), isposition(), isPositive(), isProbability(), isSecuential(), isString(), isSUMOTime(), isSVCPermission(), isUnique(), isVClass(), isVClasses(), and requireUpdateGeometry().
|
private |
string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls)
Definition at line 224 of file GNEAttributeProperties.h.
Referenced by getAttrStr().
|
private |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written)
Definition at line 242 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().
|
private |
default activated (by default false)
Definition at line 236 of file GNEAttributeProperties.h.
Referenced by getDefaultActivated(), and setDefaultActivated().
|
private |
default value (by default empty)
Definition at line 233 of file GNEAttributeProperties.h.
Referenced by getDefaultValue().
|
private |
text with a definition of attribute
Definition at line 230 of file GNEAttributeProperties.h.
Referenced by getDefinition().
|
private |
discrete values that can take this Attribute (by default empty)
Definition at line 239 of file GNEAttributeProperties.h.
Referenced by getDiscreteValues(), and setDiscreteValues().
|
private |
maxium Range
Definition at line 248 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getMaximumRange(), and setRange().
|
private |
minimun Range
Definition at line 245 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getMinimumRange(), and setRange().
|
private |
pointer to tagProperty parent
Definition at line 221 of file GNEAttributeProperties.h.
Referenced by getPositionListed(), getTagPropertyParent(), and setTagPropertyParent().