SUMO - Simulation of Urban MObility
GNEAttributeCarrier::AttributeProperties Class Reference

struct with the attribute Properties More...

#include <GNEAttributeCarrier.h>

Collaboration diagram for GNEAttributeCarrier::AttributeProperties:
Collaboration graph

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...
 

Detailed Description

struct with the attribute Properties

Definition at line 87 of file GNEAttributeCarrier.h.

Constructor & Destructor Documentation

◆ AttributeProperties() [1/2]

GNEAttributeCarrier::AttributeProperties::AttributeProperties ( )

default constructor

Definition at line 55 of file GNEAttributeCarrier.cpp.

◆ AttributeProperties() [2/2]

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.

◆ ~AttributeProperties()

GNEAttributeCarrier::AttributeProperties::~AttributeProperties ( )

destructor

Definition at line 77 of file GNEAttributeCarrier.cpp.

Member Function Documentation

◆ cannotBeZero()

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.

◆ checkAttributeIntegrity()

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.

◆ getAttrSynonym()

SumoXMLAttr GNEAttributeCarrier::AttributeProperties::getAttrSynonym ( ) const

get tag synonym

Definition at line 203 of file GNEAttributeCarrier.cpp.

References hasAttrSynonym(), and myAttrSynonym.

◆ getDefaultValue()

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().

◆ getDefinition()

const std::string & GNEAttributeCarrier::AttributeProperties::getDefinition ( ) const

get default value

Definition at line 112 of file GNEAttributeCarrier.cpp.

References myDefinition.

◆ getDescription()

◆ getDiscreteValues()

const std::vector< std::string > & GNEAttributeCarrier::AttributeProperties::getDiscreteValues ( ) const

get discrete values

Definition at line 197 of file GNEAttributeCarrier.cpp.

References myDiscreteValues.

◆ getMaximumRange()

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().

◆ getMinimumRange()

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().

◆ getPositionListed()

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.

◆ hasAttrRange()

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().

◆ hasAttrSynonym()

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().

◆ hasDefaultValue()

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.

◆ isBool()

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().

◆ isColor()

bool GNEAttributeCarrier::AttributeProperties::isColor ( ) const

◆ isCombinable()

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.

◆ isDiscrete()

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.

◆ isFilename()

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().

◆ isFloat()

bool GNEAttributeCarrier::AttributeProperties::isFloat ( ) const

◆ isInt()

bool GNEAttributeCarrier::AttributeProperties::isInt ( ) const

◆ isList()

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().

◆ isNonEditable()

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.

◆ isNumerical()

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.

◆ isOptional()

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.

◆ isposition()

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.

◆ isPositive()

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().

◆ isProbability()

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().

◆ isSecuential()

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().

◆ isString()

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.

◆ isSVCPermission()

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.

◆ isTime()

bool GNEAttributeCarrier::AttributeProperties::isTime ( ) const

◆ isUnique()

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.

◆ isVClass()

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.

Field Documentation

◆ myAttributeProperty

◆ myAttrSynonym

SumoXMLAttr GNEAttributeCarrier::AttributeProperties::myAttrSynonym
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().

◆ myDefaultValue

std::string GNEAttributeCarrier::AttributeProperties::myDefaultValue
private

default value (by default empty)

Definition at line 208 of file GNEAttributeCarrier.h.

Referenced by checkAttributeIntegrity(), and getDefaultValue().

◆ myDefinition

std::string GNEAttributeCarrier::AttributeProperties::myDefinition
private

text with a definition of attribute

Definition at line 205 of file GNEAttributeCarrier.h.

Referenced by getDefinition().

◆ myDiscreteValues

std::vector<std::string> GNEAttributeCarrier::AttributeProperties::myDiscreteValues
private

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

Definition at line 211 of file GNEAttributeCarrier.h.

Referenced by getDiscreteValues().

◆ myMaximumRange

double GNEAttributeCarrier::AttributeProperties::myMaximumRange
private

maxium Range

Definition at line 220 of file GNEAttributeCarrier.h.

Referenced by checkAttributeIntegrity(), and getMaximumRange().

◆ myMinimumRange

double GNEAttributeCarrier::AttributeProperties::myMinimumRange
private

minimun Range

Definition at line 217 of file GNEAttributeCarrier.h.

Referenced by checkAttributeIntegrity(), and getMinimumRange().

◆ myPositionListed

int GNEAttributeCarrier::AttributeProperties::myPositionListed
private

listed position

Definition at line 202 of file GNEAttributeCarrier.h.

Referenced by getPositionListed().


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