Eclipse SUMO - Simulation of Urban MObility
GNEAttributeProperties Class Reference

#include <GNEAttributeProperties.h>

Collaboration diagram for GNEAttributeProperties:

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 ,
  XMLOPTIONAL = 1 << 16 , DEFAULTVALUESTATIC = 1 << 17 , DEFAULTVALUEMUTABLE = 1 << 18 , VCLASSES = 1 << 19 ,
  SYNONYM = 1 << 20 , RANGE = 1 << 21 , EXTENDED = 1 << 22 , UPDATEGEOMETRY = 1 << 23 ,
  ACTIVATABLE = 1 << 24 , COMPLEX = 1 << 25 , FLOWDEFINITION = 1 << 26
}
 struct with the tag Properties More...
 

Public Member Functions

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 getAttr () const
 get XML Attribute More...
 
const std::string & getAttrStr () const
 get XML Attribute 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...
 
const GNETagPropertiesgetTagPropertyParent () 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 hasMutableDefaultValue () const
 return true if attribute owns a mutable default value More...
 
bool hasStaticDefaultValue () const
 return true if attribute owns a static 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 isComplex () const
 return true if atribute is complex 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 isOptional () const
 return true if atribute is optional (it will be written in XML only if his value is different of default value) 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 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...
 
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...
 
GNETagPropertiesmyTagPropertyParent
 pointer to tagProperty parent More...
 

Detailed Description

Definition at line 41 of file GNEAttributeProperties.h.

Member Enumeration Documentation

◆ AttrProperty

struct with the tag Properties

Enumerator
INT 
FLOAT 
SUMOTIME 
BOOL 
STRING 
POSITION 
COLOR 
VCLASS 
POSITIVE 
UNIQUE 
FILENAME 
DISCRETE 
PROBABILITY 
ANGLE 
LIST 
SECUENCIAL 
XMLOPTIONAL 
DEFAULTVALUESTATIC 
DEFAULTVALUEMUTABLE 
VCLASSES 
SYNONYM 
RANGE 
EXTENDED 
UPDATEGEOMETRY 
ACTIVATABLE 
COMPLEX 
FLOWDEFINITION 

Definition at line 46 of file GNEAttributeProperties.h.

Constructor & Destructor Documentation

◆ GNEAttributeProperties() [1/2]

GNEAttributeProperties::GNEAttributeProperties ( )

default constructor

Definition at line 34 of file GNEAttributeProperties.cpp.

◆ GNEAttributeProperties() [2/2]

GNEAttributeProperties::GNEAttributeProperties ( const SumoXMLAttr  attribute,
const int  attributeProperty,
const std::string &  definition,
std::string  defaultValue = "" 
)

parameter constructor

Definition at line 46 of file GNEAttributeProperties.cpp.

References ACTIVATABLE, DEFAULTVALUEMUTABLE, DEFAULTVALUESTATIC, FLOWDEFINITION, toString(), and XMLOPTIONAL.

◆ ~GNEAttributeProperties()

GNEAttributeProperties::~GNEAttributeProperties ( )

destructor

Definition at line 79 of file GNEAttributeProperties.cpp.

Member Function Documentation

◆ checkAttributeIntegrity()

void GNEAttributeProperties::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 83 of file GNEAttributeProperties.cpp.

References hasAttrRange(), hasAttrSynonym(), hasMutableDefaultValue(), hasStaticDefaultValue(), isFloat(), isInt(), isList(), isOptional(), isPositive(), isSecuential(), isSUMOTime(), myAttrSynonym, myMaximumRange, myMinimumRange, and SUMO_ATTR_NOTHING.

◆ getAttr()

SumoXMLAttr GNEAttributeProperties::getAttr ( ) const

get XML Attribute

Definition at line 159 of file GNEAttributeProperties.cpp.

References myAttribute.

Referenced by GNETagProperties::addAttribute(), and GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow().

Here is the caller graph for this function:

◆ getAttrStr()

const std::string & GNEAttributeProperties::getAttrStr ( ) const

get XML Attribute

Definition at line 165 of file GNEAttributeProperties.cpp.

References myAttrStr.

Referenced by GNETagProperties::addAttribute(), and GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow().

Here is the caller graph for this function:

◆ getAttrSynonym()

SumoXMLAttr GNEAttributeProperties::getAttrSynonym ( ) const

get tag synonym

Definition at line 276 of file GNEAttributeProperties.cpp.

References hasAttrSynonym(), and myAttrSynonym.

◆ getDefaultValue()

const std::string & GNEAttributeProperties::getDefaultValue ( ) const

get default value

Definition at line 194 of file GNEAttributeProperties.cpp.

References myDefaultValue.

Referenced by GNEAttributeCarrier::checkParsedAttribute(), GNEPersonStop::enableAttribute(), and GNEStop::enableAttribute().

Here is the caller graph for this function:

◆ getDefinition()

const std::string & GNEAttributeProperties::getDefinition ( ) const

get default value

Definition at line 188 of file GNEAttributeProperties.cpp.

References myDefinition.

◆ getDescription()

std::string GNEAttributeProperties::getDescription ( ) const

return a description of attribute

Definition at line 200 of file GNEAttributeProperties.cpp.

References ANGLE, BOOL, COLOR, DISCRETE, FILENAME, FLOAT, INT, LIST, myAttributeProperty, POSITION, POSITIVE, PROBABILITY, STRING, SUMOTIME, UNIQUE, VCLASS, VCLASSES, and XMLOPTIONAL.

Referenced by GNEAttributeCarrier::checkParsedAttribute(), and GNEAttributeCarrier::parseMaskedPositionAttribute().

Here is the caller graph for this function:

◆ getDiscreteValues()

const std::vector< std::string > & GNEAttributeProperties::getDiscreteValues ( ) const

get discrete values

Definition at line 270 of file GNEAttributeProperties.cpp.

References myDiscreteValues.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ getMaximumRange()

double GNEAttributeProperties::getMaximumRange ( ) const

get maximum range

Definition at line 296 of file GNEAttributeProperties.cpp.

References hasAttrRange(), and myMaximumRange.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ getMinimumRange()

double GNEAttributeProperties::getMinimumRange ( ) const

get minimum range

Definition at line 286 of file GNEAttributeProperties.cpp.

References hasAttrRange(), and myMinimumRange.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ getPositionListed()

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.

◆ getTagPropertyParent()

const GNETagProperties & GNEAttributeProperties::getTagPropertyParent ( ) const

get reference to tagProperty parent

Definition at line 171 of file GNEAttributeProperties.cpp.

References myTagPropertyParent.

Referenced by GNEFrameAttributesModuls::isSupermodeValid().

Here is the caller graph for this function:

◆ hasAttrRange()

bool GNEAttributeProperties::hasAttrRange ( ) const

return true if Attr correspond to an element that only accept a range of values

Definition at line 323 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and RANGE.

Referenced by checkAttributeIntegrity(), GNEAttributeCarrier::checkParsedAttribute(), getMaximumRange(), getMinimumRange(), and setRange().

Here is the caller graph for this function:

◆ hasAttrSynonym()

bool GNEAttributeProperties::hasAttrSynonym ( ) const

return true if Attr correspond to an element that will be written in XML with another name

Definition at line 318 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and SYNONYM.

Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().

Here is the caller graph for this function:

◆ hasMutableDefaultValue()

bool GNEAttributeProperties::hasMutableDefaultValue ( ) const

return true if attribute owns a mutable default value

Definition at line 312 of file GNEAttributeProperties.cpp.

References DEFAULTVALUEMUTABLE, and myAttributeProperty.

Referenced by checkAttributeIntegrity().

Here is the caller graph for this function:

◆ hasStaticDefaultValue()

bool GNEAttributeProperties::hasStaticDefaultValue ( ) const

return true if attribute owns a static default value

Definition at line 306 of file GNEAttributeProperties.cpp.

References DEFAULTVALUESTATIC, and myAttributeProperty.

Referenced by checkAttributeIntegrity().

Here is the caller graph for this function:

◆ isActivatable()

bool GNEAttributeProperties::isActivatable ( ) const

return true if atribute is activatable

Definition at line 454 of file GNEAttributeProperties.cpp.

References ACTIVATABLE, and myAttributeProperty.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow().

Here is the caller graph for this function:

◆ isBool()

bool GNEAttributeProperties::isBool ( ) const

return true if atribute is boolean

Definition at line 347 of file GNEAttributeProperties.cpp.

References BOOL, and myAttributeProperty.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isColor()

bool GNEAttributeProperties::isColor ( ) const

return true if atribute is a color

Definition at line 383 of file GNEAttributeProperties.cpp.

References COLOR, and myAttributeProperty.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isComplex()

bool GNEAttributeProperties::isComplex ( ) const

return true if atribute is complex

Definition at line 460 of file GNEAttributeProperties.cpp.

References COMPLEX, and myAttributeProperty.

◆ isDiscrete()

bool GNEAttributeProperties::isDiscrete ( ) const

return true if atribute is discrete

Definition at line 430 of file GNEAttributeProperties.cpp.

References DISCRETE, and myAttributeProperty.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(), GNEAttributeCarrier::checkParsedAttribute(), and setDiscreteValues().

Here is the caller graph for this function:

◆ isExtended()

bool GNEAttributeProperties::isExtended ( ) const

return true if atribute is extended

Definition at line 442 of file GNEAttributeProperties.cpp.

References EXTENDED, and myAttributeProperty.

◆ isFilename()

bool GNEAttributeProperties::isFilename ( ) const

return true if atribute is a filename

Definition at line 389 of file GNEAttributeProperties.cpp.

References FILENAME, and myAttributeProperty.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isFloat()

bool GNEAttributeProperties::isFloat ( ) const

return true if atribute is a float

Definition at line 335 of file GNEAttributeProperties.cpp.

References FLOAT, and myAttributeProperty.

Referenced by checkAttributeIntegrity(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isFlowDefinition()

bool GNEAttributeProperties::isFlowDefinition ( ) const

return true if atribute is part of a flow definition

Definition at line 466 of file GNEAttributeProperties.cpp.

References FLOWDEFINITION, and myAttributeProperty.

Referenced by GNEAttributeCarrier::getAlternativeValueForDisabledAttributes().

Here is the caller graph for this function:

◆ isInt()

bool GNEAttributeProperties::isInt ( ) const

return true if atribute is an integer

Definition at line 329 of file GNEAttributeProperties.cpp.

References INT, and myAttributeProperty.

Referenced by checkAttributeIntegrity(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isList()

bool GNEAttributeProperties::isList ( ) const

return true if atribute is a list

Definition at line 407 of file GNEAttributeProperties.cpp.

References LIST, and myAttributeProperty.

Referenced by checkAttributeIntegrity(), GNEAttributeCarrier::checkParsedAttribute(), and GNENet::replaceInListAttribute().

Here is the caller graph for this function:

◆ isNumerical()

bool GNEAttributeProperties::isNumerical ( ) const

return true if atribute is numerical (int or float)

Definition at line 371 of file GNEAttributeProperties.cpp.

References FLOAT, INT, myAttributeProperty, and SUMOTIME.

◆ isOptional()

bool GNEAttributeProperties::isOptional ( ) const

return true if atribute is optional (it will be written in XML only if his value is different of default value)

Definition at line 425 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and XMLOPTIONAL.

Referenced by checkAttributeIntegrity(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isposition()

bool GNEAttributeProperties::isposition ( ) const

return true if atribute is a position

Definition at line 359 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and POSITION.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isPositive()

bool GNEAttributeProperties::isPositive ( ) const

return true if atribute is positive

Definition at line 377 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and POSITIVE.

Referenced by checkAttributeIntegrity(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isProbability()

bool GNEAttributeProperties::isProbability ( ) const

return true if atribute is a probability

Definition at line 365 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and PROBABILITY.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isSecuential()

bool GNEAttributeProperties::isSecuential ( ) const

return true if atribute is sequential

Definition at line 413 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and SECUENCIAL.

Referenced by checkAttributeIntegrity().

Here is the caller graph for this function:

◆ isString()

bool GNEAttributeProperties::isString ( ) const

return true if atribute is a string

Definition at line 353 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and STRING.

◆ isSUMOTime()

bool GNEAttributeProperties::isSUMOTime ( ) const

return true if atribute is a SUMOTime

Definition at line 341 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and SUMOTIME.

Referenced by checkAttributeIntegrity(), and GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isSVCPermission()

bool GNEAttributeProperties::isSVCPermission ( ) const

return true if atribute is a VehicleClass

Definition at line 401 of file GNEAttributeProperties.cpp.

References LIST, myAttributeProperty, and VCLASS.

◆ isUnique()

bool GNEAttributeProperties::isUnique ( ) const

return true if atribute is unique

Definition at line 419 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and UNIQUE.

◆ isVClass()

bool GNEAttributeProperties::isVClass ( ) const

return true if atribute is a VehicleClass

Definition at line 395 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and VCLASS.

Referenced by GNEAttributeCarrier::checkParsedAttribute().

Here is the caller graph for this function:

◆ isVClasses()

bool GNEAttributeProperties::isVClasses ( ) const

return true if atribute is a list of VClasses

Definition at line 436 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and VCLASSES.

Referenced by GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow().

Here is the caller graph for this function:

◆ requireUpdateGeometry()

bool GNEAttributeProperties::requireUpdateGeometry ( ) const

return true if atribute requires a update geometry in setAttribute(...)

Definition at line 448 of file GNEAttributeProperties.cpp.

References myAttributeProperty, and UPDATEGEOMETRY.

Referenced by GNEChange_Attribute::redo(), GNEVehicleType::setAttribute(), and GNEChange_Attribute::undo().

Here is the caller graph for this function:

◆ setDiscreteValues()

void GNEAttributeProperties::setDiscreteValues ( const std::vector< std::string > &  discreteValues)

set discrete values

Definition at line 114 of file GNEAttributeProperties.cpp.

References isDiscrete(), and myDiscreteValues.

Referenced by GNEAttributeCarrier::fillCarFollowingModelAttributes(), GNEAttributeCarrier::fillDemandElements(), and GNEAttributeCarrier::fillNetworkElements().

Here is the caller graph for this function:

◆ setRange()

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::fillAdditionals(), and GNEAttributeCarrier::fillCarFollowingModelAttributes().

Here is the caller graph for this function:

◆ setSynonym()

void GNEAttributeProperties::setSynonym ( const SumoXMLAttr  synonym)

set synonim

Definition at line 124 of file GNEAttributeProperties.cpp.

References hasAttrSynonym(), and myAttrSynonym.

◆ setTagPropertyParent()

void GNEAttributeProperties::setTagPropertyParent ( GNETagProperties tagPropertyParent)

set tag property parent

Definition at line 153 of file GNEAttributeProperties.cpp.

References myTagPropertyParent.

Field Documentation

◆ myAttribute

SumoXMLAttr GNEAttributeProperties::myAttribute
private

XML Attribute.

Definition at line 219 of file GNEAttributeProperties.h.

Referenced by getAttr(), and getPositionListed().

◆ myAttributeProperty

◆ myAttrStr

std::string GNEAttributeProperties::myAttrStr
private

string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls)

Definition at line 225 of file GNEAttributeProperties.h.

Referenced by getAttrStr().

◆ myAttrSynonym

SumoXMLAttr GNEAttributeProperties::myAttrSynonym
private

Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written)

Definition at line 240 of file GNEAttributeProperties.h.

Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().

◆ myDefaultValue

std::string GNEAttributeProperties::myDefaultValue
private

default value (by default empty)

Definition at line 234 of file GNEAttributeProperties.h.

Referenced by getDefaultValue().

◆ myDefinition

std::string GNEAttributeProperties::myDefinition
private

text with a definition of attribute

Definition at line 231 of file GNEAttributeProperties.h.

Referenced by getDefinition().

◆ myDiscreteValues

std::vector<std::string> GNEAttributeProperties::myDiscreteValues
private

discrete values that can take this Attribute (by default empty)

Definition at line 237 of file GNEAttributeProperties.h.

Referenced by getDiscreteValues(), and setDiscreteValues().

◆ myMaximumRange

double GNEAttributeProperties::myMaximumRange
private

maxium Range

Definition at line 246 of file GNEAttributeProperties.h.

Referenced by checkAttributeIntegrity(), getMaximumRange(), and setRange().

◆ myMinimumRange

double GNEAttributeProperties::myMinimumRange
private

minimun Range

Definition at line 243 of file GNEAttributeProperties.h.

Referenced by checkAttributeIntegrity(), getMinimumRange(), and setRange().

◆ myTagPropertyParent

GNETagProperties* GNEAttributeProperties::myTagPropertyParent
private

pointer to tagProperty parent

Definition at line 222 of file GNEAttributeProperties.h.

Referenced by getPositionListed(), getTagPropertyParent(), and setTagPropertyParent().


The documentation for this class was generated from the following files: