20 #ifndef GNEAttributeCarrier_h 21 #define GNEAttributeCarrier_h 92 const std::vector<SumoXMLAttr>&
getAttrs()
const {
97 const std::string
getID()
const {
105 static const std::vector<SumoXMLTag>&
allowedTags();
134 static T
parse(
const std::string&
string);
139 return canParse<T>(string) && parse<T>(
string) > 0;
143 static bool isValidID(
const std::string& value);
168 static std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > >
_discreteChoices;
static std::set< SumoXMLAttr > _numericalAttrs
SumoXMLTag
Numbers representing SUMO-XML - element names.
static bool isPositive(const std::string &string)
true if a positive number of type T can be parsed from string
static bool isNumerical(SumoXMLAttr attr)
whether an attribute is numerical
const SumoXMLTag myTag
the xml tag to which this carrier corresponds
static const std::string LOADED
feature is still unchanged after being loaded (implies approval)
A NBNetBuilder extended by visualisation and editing capabilities.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
virtual std::string getAttribute(SumoXMLAttr key) const =0
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
the function-object for an editing operation (abstract base)
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
static const std::string MODIFIED
feature has been manually modified (implies approval)
static const std::vector< SumoXMLTag > & allowedTags()
get all editable attributes for tag.
const std::string getID() const
function to support debugging
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
virtual ~GNEAttributeCarrier()
Destructor.
static std::set< SumoXMLAttr > _uniqueAttrs
static bool canParse(const std::string &string)
true if a number of type T can be parsed from string
GNEAttributeCarrier(SumoXMLTag tag)
Constructor.
const std::vector< SumoXMLAttr > & getAttrs() const
static std::vector< SumoXMLTag > _allowedTags
static const std::string APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static const std::vector< SumoXMLAttr > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag.
GNEAttributeCarrier & operator=(const GNEAttributeCarrier &src)
Invalidated assignment operator.
virtual std::string getDescription()
how should this attribute carrier be called
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
SumoXMLTag getTag() const
static const std::string GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
static bool isUnique(SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection)
static std::map< SumoXMLTag, std::vector< SumoXMLAttr > > _allowedAttributes
virtual bool isValid(SumoXMLAttr key, const std::string &value)
static T parse(const std::string &string)
parses a number of type T from string
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > _discreteChoices