36 myTagPropertyParent(nullptr),
38 myAttributeProperty(STRING),
41 myDefaultActivated(false),
48 myAttribute(attribute),
49 myTagPropertyParent(nullptr),
51 myAttributeProperty(attributeProperty),
52 myDefinition(definition),
53 myDefaultValue(defaultValue),
54 myDefaultActivated(false),
59 if (definition.empty()) {
63 if (!defaultValue.empty() && !(attributeProperty &
DEFAULTVALUE)) {
68 throw FormatException(
"Attribute '" +
toString(attribute) +
"' cannot be flowdefinition and activatable at the same time");
84 throw FormatException(
"Secuential property only is compatible with list properties");
108 throw FormatException(
"AttributeProperty doesn't support discrete values");
118 throw FormatException(
"AttributeProperty doesn't support default activated");
183 throw ProcessError(
"Attribute wasn't found in myTagPropertyParent");
261 type =
"probability";
268 return pre + type + plural + last;
272 const std::vector<std::string>&
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_NOTHING
invalid attribute
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double getMaximumRange() const
get maximum range
bool isVClass() const
return true if atribute is a VehicleClass
bool isProbability() const
return true if atribute is a probability
bool isColor() const
return true if atribute is a color
void setTagPropertyParent(GNETagProperties *tagPropertyParent)
set tag property parent
void setDiscreteValues(const std::vector< std::string > &discreteValues)
set discrete values
void setSynonym(const SumoXMLAttr synonym)
set synonim
double myMinimumRange
minimun Range
bool isSVCPermission() const
return true if atribute is a VehicleClass
int getPositionListed() const
get position in list (used in frames for listing attributes with certain sort)
bool isBool() const
return true if atribute is boolean
const std::string & getAttrStr() const
get XML Attribute
std::string getDescription() const
return a description of attribute
bool myDefaultActivated
default activated (by default false)
bool isFlowDefinition() const
return true if atribute is part of a flow definition
bool hasAttrRange() const
return true if Attr correspond to an element that only accept a range of values
bool getDefaultActivated() const
get default active value
bool isList() const
return true if atribute is a list
SumoXMLAttr myAttrSynonym
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written)
bool isNumerical() const
return true if atribute is numerical (int or float)
bool isInt() const
return true if atribute is an integer
bool isDiscrete() const
return true if atribute is discrete
void setDefaultActivated(const bool value)
set default activated value
GNEAttributeProperties()
default constructor
const std::string & getDefaultValue() const
get default value
const std::string & getDefinition() const
get default value
double getMinimumRange() const
get minimum range
bool hasAttrSynonym() const
return true if Attr correspond to an element that will be written in XML with another name
int myAttributeProperty
Property of attribute.
bool isUnique() const
return true if atribute is unique
double myMaximumRange
maxium Range
bool isString() const
return true if atribute is a string
bool isExtended() const
return true if atribute is extended
std::vector< std::string > myDiscreteValues
discrete values that can take this Attribute (by default empty)
SumoXMLAttr getAttrSynonym() const
get tag synonym
bool isFloat() const
return true if atribute is a float
void checkAttributeIntegrity() const
check Attribute integrity (For example, throw an exception if tag has a Float default value,...
void setRange(const double minimum, const double maximum)
set range
GNETagProperties * myTagPropertyParent
pointer to tagProperty parent
SumoXMLAttr myAttribute
XML Attribute.
std::string myDefinition
text with a definition of attribute
bool isVClasses() const
return true if atribute is a list of VClasses
bool isSUMOTime() const
return true if atribute is a SUMOTime
std::string myDefaultValue
default value (by default empty)
bool isposition() const
return true if atribute is a position
bool hasDefaultValue() const
return true if attribute owns a default value
~GNEAttributeProperties()
destructor
bool isActivatable() const
return true if atribute is activatable
bool requireUpdateGeometry() const
return true if atribute requires a update geometry in setAttribute(...)
bool isPositive() const
return true if atribute is positive
const std::vector< std::string > & getDiscreteValues() const
get discrete values
bool isFilename() const
return true if atribute is a filename
SumoXMLAttr getAttr() const
get XML Attribute
bool isSecuential() const
return true if atribute is sequential
const GNETagProperties & getTagPropertyParent() const
get reference to tagProperty parent
std::string myAttrStr
string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls)
bool hasAutomaticID() const
return true if attribute ID can generate an automatic ID
std::vector< GNEAttributeProperties >::const_iterator end() const
get end of attribute values (used for iterate)
std::vector< GNEAttributeProperties >::const_iterator begin() const
get begin of attribute values (used for iterate)