40 myAttribute(attribute),
41 myTagPropertyParent(nullptr),
43 myAttributeProperty(attributeProperty),
44 myDefinition(definition),
45 myDefaultValue(defaultValue),
46 myDefaultActivated(false),
51 if (definition.empty()) {
55 if (!defaultValue.empty() && !(attributeProperty &
DEFAULTVALUE)) {
60 throw FormatException(
"Attribute '" +
toString(attribute) +
"' cannot be flowdefinition and activatable at the same time");
99 throw FormatException(
"Secuential property only is compatible with list properties");
128 throw FormatException(
"AttributeProperty doesn't support discrete values");
138 throw FormatException(
"AttributeProperty doesn't support default activated");
203 throw ProcessError(
"Attribute wasn't found in myTagPropertyParent");
241 pre +=
"non-negative ";
278 type =
"probability";
285 return pre + type + plural + last;
289const std::vector<std::string>&
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double getMaximumRange() const
get maximum range
bool isVClass() const
return true if attribute is a VehicleClass
bool isProbability() const
return true if attribute is a probability
bool isColor() const
return true if attribute 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 attribute 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 attribute 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 attribute is part of a flow definition
bool isPosition() const
return true if attribute is a position
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 attribute 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 attribute is numerical (int or float)
bool isInt() const
return true if attribute is an integer
bool isDiscrete() const
return true if attribute is discrete
void setDefaultActivated(const bool value)
set default activated value
GNEAttributeProperties()
default constructor
bool isCopyable() const
return true if attribute ID is copyable
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
bool isVType() const
return true if attribute is a VType or vTypeDistribution
int myAttributeProperty
Property of attribute.
bool isUnique() const
return true if attribute is unique
double myMaximumRange
maxium Range
bool isString() const
return true if attribute is a string
bool isExtended() const
return true if attribute 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 attribute 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 isSUMOTime() const
return true if attribute is a SUMOTime
std::string myDefaultValue
default value (by default empty)
bool hasDefaultValue() const
return true if attribute owns a default value
~GNEAttributeProperties()
destructor
bool isActivatable() const
return true if attribute is activatable
bool requireUpdateGeometry() const
return true if attribute requires a update geometry in setAttribute(...)
bool isPositive() const
return true if attribute is positive
const std::vector< std::string > & getDiscreteValues() const
get discrete values
bool isFilename() const
return true if attribute is a filename
SumoXMLAttr getAttr() const
get XML Attribute
bool isSecuential() const
return true if attribute 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)