20 #ifndef GNEAttributeCarrier_h 21 #define GNEAttributeCarrier_h 98 std::vector<SumoXMLAttr>
getAttrs()
const;
101 const std::string
getID()
const;
110 static const std::vector<SumoXMLTag>&
allowedTags();
183 static T
parse(
const std::string&
string);
188 return canParse<T>(string) && parse<T>(
string) > 0;
192 static bool isValidID(
const std::string& value);
247 static std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > >
myDiscreteChoices;
static bool isList(SumoXMLAttr attr)
whether an attribute is of type bool
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 std::set< SumoXMLAttr > myUniqueAttrs
set with the unique attributes (i.e. attributes without default values)
static bool isNumerical(SumoXMLAttr attr)
whether an attribute is numerical (int or float)
const SumoXMLTag myTag
the xml tag to which this carrier corresponds
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::string > > myAttrDefinitions
map with the definition of attributes
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > myDiscreteChoices
map with the values of discrete choices
static const std::string LOADED
feature is still unchanged after being loaded (implies approval)
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
A NBNetBuilder extended by visualisation and editing capabilities.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static std::map< SumoXMLTag, std::vector< std::pair< SumoXMLAttr, std::string > > > _allowedAttributes
map with the allowed attributes
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
static std::set< SumoXMLAttr > myNumericalFloatAttrs
set with the numerical attributes of type Float
virtual std::string getAttribute(SumoXMLAttr key) const =0
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
static std::vector< SumoXMLTag > myAllowedNetElementTags
vector with the allowed tags of netElements
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 bool isValidFileValue(const std::string &value)
true if value is a valid file value
static std::vector< SumoXMLTag > myAllowedAdditionalTags
vector with the allowed tags of additionals
static std::vector< SumoXMLTag > myAllowedTags
vector with the allowed tags
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if a element with certain tag has a certain attribute
static const std::vector< SumoXMLTag > & allowedTags()
get all editable for tag.
static bool hasParent(SumoXMLTag tag)
check if a element with certain tag has another additional element as parent
virtual std::string getDescription()
how should this attribute carrier be called
static T getDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
return the default value of the attribute of an element
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
const std::string getID() const
function to support debugging
virtual ~GNEAttributeCarrier()
Destructor.
static bool isFloat(SumoXMLAttr attr)
whether an attribute is numerical of type float
static bool canParse(const std::string &string)
true if a number of type T can be parsed from string
GNEAttributeCarrier(SumoXMLTag tag)
Constructor.
static bool isValidStringVector(const std::string &value)
true if value is a valid string vector
static const std::vector< SumoXMLTag > & allowedAdditionalTags()
get all editable tags for additionals
static bool isInt(SumoXMLAttr attr)
whether an attribute is numerical or type int
static const std::string APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static const std::vector< SumoXMLTag > & allowedNetElementTags()
get all editable tags for netElements
GNEAttributeCarrier & operator=(const GNEAttributeCarrier &src)
Invalidated assignment operator.
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
static SumoXMLTag getParentType(SumoXMLTag tag)
get parent's tag of a certain additional element
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 bool isString(SumoXMLAttr attr)
whether an attribute is of type string
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 bool isBool(SumoXMLAttr attr)
whether an attribute is of type bool
static std::set< SumoXMLAttr > myListAttrs
set with the attributes of type list
static std::map< SumoXMLTag, SumoXMLTag > myAllowedAdditionalWithParentTags
map with the allowed tags of additionals with parent and their parent
static std::set< SumoXMLAttr > myNumericalIntAttrs
set with the numerical attributes of type Int
SumoXMLTag getTag() const
get Tag assigned to this object