![]() |
SUMO - Simulation of Urban MObility
|
#include <GNEAttributeCarrier.h>
Public Member Functions | |
void | decRef (const std::string &debugMsg="") |
virtual std::string | getAttribute (SumoXMLAttr key) const =0 |
const std::vector< SumoXMLAttr > & | getAttrs () const |
virtual std::string | getDescription () |
how should this attribute carrier be called More... | |
const std::string | getID () const |
function to support debugging More... | |
SumoXMLTag | getTag () const |
GNEAttributeCarrier (SumoXMLTag tag) | |
Constructor. More... | |
void | incRef (const std::string &debugMsg="") |
virtual bool | isValid (SumoXMLAttr key, const std::string &value) |
template<> | |
int | parse (const std::string &string) |
template<> | |
SUMOReal | parse (const std::string &string) |
virtual void | setAttribute (SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0 |
bool | unreferenced () |
virtual | ~GNEAttributeCarrier () |
Destructor. More... | |
Static Public Member Functions | |
static const std::vector< SumoXMLAttr > & | allowedAttributes (SumoXMLTag tag) |
get all editable attributes for tag. More... | |
static const std::vector< SumoXMLTag > & | allowedTags () |
get all editable attributes for tag. More... | |
template<typename T > | |
static bool | canParse (const std::string &string) |
true if a number of type T can be parsed from string More... | |
static const std::vector< std::string > & | discreteChoices (SumoXMLTag tag, SumoXMLAttr attr) |
return a list of discrete choices for this attribute or an empty vector More... | |
static bool | discreteCombinableChoices (SumoXMLTag tag, SumoXMLAttr attr) |
return whether the given attribute allows for a combination of discrete values More... | |
static bool | isNumerical (SumoXMLAttr attr) |
whether an attribute is numerical More... | |
template<typename T > | |
static bool | isPositive (const std::string &string) |
true if a positive number of type T can be parsed from string More... | |
static bool | isUnique (SumoXMLAttr attr) |
whether an attribute is unique (may not be edited for a multi-selection) More... | |
static bool | isValidID (const std::string &value) |
true if value is a valid sumo ID More... | |
template<typename T > | |
static T | parse (const std::string &string) |
parses a number of type T from string More... | |
Static Public Attributes | |
static const std::string | APPROVED = "approved" |
feature has been approved but not changed (i.e. after being reguessed) More... | |
static const std::string | GUESSED = "guessed" |
feature has been reguessed (may still be unchanged be we can't tell (yet) More... | |
static const std::string | LOADED = "loaded" |
feature is still unchanged after being loaded (implies approval) More... | |
static const std::string | MODIFIED = "modified" |
feature has been manually modified (implies approval) More... | |
Private Member Functions | |
GNEAttributeCarrier & | operator= (const GNEAttributeCarrier &src) |
Invalidated assignment operator. More... | |
virtual void | setAttribute (SumoXMLAttr key, const std::string &value)=0 |
Private Attributes | |
const SumoXMLTag | myTag |
the xml tag to which this carrier corresponds More... | |
Static Private Attributes | |
static std::map< SumoXMLTag, std::vector< SumoXMLAttr > > | _allowedAttributes |
static std::vector< SumoXMLTag > | _allowedTags |
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > | _discreteChoices |
static std::set< SumoXMLAttr > | _numericalAttrs |
static std::set< SumoXMLAttr > | _uniqueAttrs |
Friends | |
class | GNEChange_Attribute |
Abstract Base class for gui objects which carry attributes inherits from GNEReferenceCounter for convenience
Definition at line 57 of file GNEAttributeCarrier.h.
GNEAttributeCarrier::GNEAttributeCarrier | ( | SumoXMLTag | tag | ) |
Constructor.
Definition at line 57 of file GNEAttributeCarrier.cpp.
|
inlinevirtual |
Destructor.
Definition at line 69 of file GNEAttributeCarrier.h.
References getAttribute(), isValid(), and setAttribute().
|
static |
get all editable attributes for tag.
Definition at line 91 of file GNEAttributeCarrier.cpp.
References _allowedAttributes, SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMO_ATTR_EDGES, SUMO_ATTR_ENDOFFSET, SUMO_ATTR_FROM, SUMO_ATTR_ID, SUMO_ATTR_INDEX, SUMO_ATTR_KEEP_CLEAR, SUMO_ATTR_LENGTH, SUMO_ATTR_NAME, SUMO_ATTR_NUMLANES, SUMO_ATTR_POSITION, SUMO_ATTR_PRIORITY, SUMO_ATTR_RADIUS, SUMO_ATTR_SHAPE, SUMO_ATTR_SPEED, SUMO_ATTR_SPREADTYPE, SUMO_ATTR_TO, SUMO_ATTR_TYPE, SUMO_ATTR_WIDTH, SUMO_TAG_CROSSING, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, SUMO_TAG_LANE, SUMO_TAG_POI, toString(), and WRITE_WARNING.
Referenced by getAttrs(), getID(), GNESelector::onCmdSelMBString(), and GNESelector::onCmdSelMBTag().
|
static |
get all editable attributes for tag.
Definition at line 157 of file GNEAttributeCarrier.cpp.
References _allowedTags, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, and SUMO_TAG_LANE.
Referenced by getID(), GNESelector::GNESelector(), GNESelector::onCmdSelMBString(), and GNESelector::onCmdSelMBTag().
|
inlinestatic |
true if a number of type T can be parsed from string
Definition at line 121 of file GNEAttributeCarrier.h.
References parse().
|
inlineinherited |
Definition at line 61 of file GNEReferenceCounter.h.
References GNEReferenceCounter::getID(), GNEReferenceCounter::myCount, toString(), and UNUSED_PARAMETER.
Referenced by GNENet::deleteSingleEdge(), GNENet::deleteSingleJunction(), GNEEdge::removeLane(), GNEInspector::setEdgeTemplate(), GNEChange_Attribute::~GNEChange_Attribute(), GNEChange_Connection::~GNEChange_Connection(), GNEChange_Edge::~GNEChange_Edge(), GNEChange_Junction::~GNEChange_Junction(), GNEChange_Lane::~GNEChange_Lane(), GNEChange_TLS::~GNEChange_TLS(), and GNEInspector::~GNEInspector().
|
static |
return a list of discrete choices for this attribute or an empty vector
Definition at line 201 of file GNEAttributeCarrier.cpp.
References _discreteChoices, StringBijection< T >::getStrings(), SUMOXMLDefinitions::LaneSpreadFunctions, NODETYPE_DEAD_END_DEPRECATED, SUMOXMLDefinitions::NodeTypes, SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMO_ATTR_KEEP_CLEAR, SUMO_ATTR_PRIORITY, SUMO_ATTR_SPREADTYPE, SUMO_ATTR_TYPE, SUMO_TAG_CROSSING, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, SUMO_TAG_LANE, SumoVehicleClassStrings, and toString().
Referenced by GNEInspector::AttrInput::AttrInput(), getID(), and GNEInspector::AttrInput::onCmdOpenAttributeEditor().
|
static |
return whether the given attribute allows for a combination of discrete values
Definition at line 236 of file GNEAttributeCarrier.cpp.
References SUMO_ATTR_ALLOW, and SUMO_ATTR_DISALLOW.
Referenced by GNEInspector::AttrInput::AttrInput(), and getID().
|
pure virtual |
Implemented in GNEEdge, GNEJunction, GNEPoly, GNELane, GNECrossing, and GNEPOI.
Referenced by getID(), GNESelector::getMatches(), and ~GNEAttributeCarrier().
|
inline |
Definition at line 92 of file GNEAttributeCarrier.h.
References allowedAttributes(), and myTag.
Referenced by isValid().
|
inlinevirtual |
how should this attribute carrier be called
Definition at line 84 of file GNEAttributeCarrier.h.
References myTag, and toString().
Referenced by GNEChange_Attribute::redoName(), and GNEChange_Attribute::undoName().
|
inlinevirtual |
function to support debugging
Implements GNEReferenceCounter.
Definition at line 97 of file GNEAttributeCarrier.h.
References allowedAttributes(), allowedTags(), discreteChoices(), discreteCombinableChoices(), getAttribute(), isNumerical(), isUnique(), and SUMO_ATTR_ID.
Referenced by GNENet::addReversedEdge(), GNENet::reverseEdge(), and GNEJunction::setLogicValid().
|
inline |
Definition at line 88 of file GNEAttributeCarrier.h.
References myTag.
Referenced by GNESelector::getMatches().
|
inlineinherited |
Definition at line 73 of file GNEReferenceCounter.h.
References GNEReferenceCounter::getID(), GNEReferenceCounter::myCount, toString(), and UNUSED_PARAMETER.
Referenced by GNEEdge::addLane(), GNENet::registerEdge(), GNENet::registerJunction(), and GNEInspector::setEdgeTemplate().
|
static |
whether an attribute is numerical
Definition at line 169 of file GNEAttributeCarrier.cpp.
References _numericalAttrs, SUMO_ATTR_ENDOFFSET, SUMO_ATTR_INDEX, SUMO_ATTR_LENGTH, SUMO_ATTR_NUMLANES, SUMO_ATTR_PRIORITY, SUMO_ATTR_RADIUS, SUMO_ATTR_SPEED, and SUMO_ATTR_WIDTH.
Referenced by GNEInspector::AttrInput::AttrInput(), getID(), GNESelector::getMatches(), and GNESelector::onCmdSelMBString().
|
inlinestatic |
true if a positive number of type T can be parsed from string
Definition at line 138 of file GNEAttributeCarrier.h.
References isValidID().
|
static |
whether an attribute is unique (may not be edited for a multi-selection)
Definition at line 186 of file GNEAttributeCarrier.cpp.
References _uniqueAttrs, SUMO_ATTR_EDGES, SUMO_ATTR_FROM, SUMO_ATTR_ID, SUMO_ATTR_POSITION, SUMO_ATTR_SHAPE, and SUMO_ATTR_TO.
Referenced by GNEInspector::AttrPanel::AttrPanel(), and getID().
|
virtual |
Reimplemented in GNEEdge, GNEJunction, GNEPoly, GNELane, GNECrossing, and GNEPOI.
Definition at line 63 of file GNEAttributeCarrier.cpp.
References getAttrs(), and UNUSED_PARAMETER.
Referenced by ~GNEAttributeCarrier().
|
static |
true if value is a valid sumo ID
Definition at line 70 of file GNEAttributeCarrier.cpp.
Referenced by isPositive(), GNEJunction::isValid(), and GNEEdge::isValid().
|
private |
Invalidated assignment operator.
int GNEAttributeCarrier::parse | ( | const std::string & | string | ) |
Definition at line 76 of file GNEAttributeCarrier.cpp.
References TplConvert::_str2int(), and SUMOReal.
SUMOReal GNEAttributeCarrier::parse | ( | const std::string & | string | ) |
Definition at line 82 of file GNEAttributeCarrier.cpp.
References TplConvert::_str2SUMOReal().
|
static |
parses a number of type T from string
Referenced by canParse().
|
pure virtual |
Implemented in GNEEdge, GNEJunction, GNEPoly, GNELane, GNECrossing, and GNEPOI.
Referenced by GNEChange_Attribute::redo(), GNEChange_Attribute::undo(), and ~GNEAttributeCarrier().
|
privatepure virtual |
Implemented in GNEJunction, GNEEdge, GNEPoly, GNELane, GNECrossing, and GNEPOI.
|
inlineinherited |
Definition at line 82 of file GNEReferenceCounter.h.
References GNEReferenceCounter::getID(), and GNEReferenceCounter::myCount.
Referenced by GNEInspector::setEdgeTemplate(), GNEChange_Attribute::~GNEChange_Attribute(), GNEChange_Connection::~GNEChange_Connection(), GNEChange_Edge::~GNEChange_Edge(), GNEChange_Junction::~GNEChange_Junction(), GNEChange_Lane::~GNEChange_Lane(), GNEChange_TLS::~GNEChange_TLS(), and GNEInspector::~GNEInspector().
|
friend |
Definition at line 59 of file GNEAttributeCarrier.h.
Referenced by GNEJunction::registerMove(), GNECrossing::setAttribute(), GNELane::setAttribute(), GNEJunction::setAttribute(), GNEEdge::setAttribute(), and GNEJunction::setLogicValid().
|
staticprivate |
Definition at line 164 of file GNEAttributeCarrier.h.
Referenced by allowedAttributes().
|
staticprivate |
Definition at line 165 of file GNEAttributeCarrier.h.
Referenced by allowedTags().
|
staticprivate |
Definition at line 168 of file GNEAttributeCarrier.h.
Referenced by discreteChoices().
|
staticprivate |
Definition at line 166 of file GNEAttributeCarrier.h.
Referenced by isNumerical().
|
staticprivate |
Definition at line 167 of file GNEAttributeCarrier.h.
Referenced by isUnique().
|
static |
feature has been approved but not changed (i.e. after being reguessed)
Definition at line 152 of file GNEAttributeCarrier.h.
|
static |
feature has been reguessed (may still be unchanged be we can't tell (yet)
Definition at line 148 of file GNEAttributeCarrier.h.
Referenced by GNEEdge::setAttribute(), and GNEJunction::setResponsible().
|
static |
feature is still unchanged after being loaded (implies approval)
Definition at line 146 of file GNEAttributeCarrier.h.
|
static |
feature has been manually modified (implies approval)
Definition at line 150 of file GNEAttributeCarrier.h.
Referenced by GNEConnector::onCmdClearSelectedConnections(), and GNEEdge::setAttribute().
|
private |
the xml tag to which this carrier corresponds
Definition at line 162 of file GNEAttributeCarrier.h.
Referenced by getAttrs(), getDescription(), and getTag().