20 #ifndef GNEAttributeCarrier_h 21 #define GNEAttributeCarrier_h 106 std::vector<SumoXMLAttr>
getAttrs()
const;
109 const std::string
getID()
const;
118 static const std::vector<SumoXMLTag>&
allowedTags(
bool net);
199 static T
parse(
const std::string&
string);
204 return canParse<T>(string) && parse<T>(
string) > 0;
208 static bool isValidID(
const std::string& value);
278 static std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > >
myDiscreteChoices;
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 isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
static std::string getAttributeType(SumoXMLTag tag, SumoXMLAttr attr)
get type of attribute
GNEAttributeCarrier(SumoXMLTag tag, GUIIcon icon)
Constructor.
const SumoXMLTag myTag
the xml tag to which this attribute 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
GUIIcon
An enumeration of icons used by the gui applications.
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myPositiveAttrs
map with the positive attributes
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myUniqueAttrs
map with the unique attributes (i.e. attributes without default values)
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > myDiscreteChoices
map with the values of discrete choices
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myBoolAttrs
map with the boolean attributes
static const std::string LOADED
feature is still unchanged after being loaded (implies approval)
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myProbabilityAttrs
map with the probability attributes
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
GUIIcon myIcon
icon associated to this AC
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myTimeAttrs
map with the attributes of type time
static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is only Positive (i.e. cannot take negative values)
FXIcon * getIcon() const
get FXIcon assigned to this object
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 and their default values
static bool isValidFilename(const std::string &value)
true if value is a valid file value
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::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 bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myListAttrs
map with the attributes of type list
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
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 isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
static bool isNonEditable(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is non editable
static std::vector< SumoXMLTag > myAllowedAdditionalTags
vector with the allowed tags of additionals
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a filename
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
static const std::vector< SumoXMLTag > & allowedTags(bool net)
get all editable for tag (net or additional).
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
const std::string getID() const
function to support debugging
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNonEditableAttrs
map with the non-editable attributes
virtual ~GNEAttributeCarrier()
Destructor.
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don't have a default valu...
static bool canParse(const std::string &string)
true if a number of type T can be parsed from string
static int myMaxNumAttribute
maximum number of attributes of all tags
static bool isProbability(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is a probability (i.e. oly can values between [0, 1])
static const std::string APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
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 const std::string GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
GUIIcon getGUIIcon() const
get GUI icon assigned to this object
static bool isNumerical(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical (int or float)
virtual bool isValid(SumoXMLAttr key, const std::string &value)
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalIntAttrs
map with the numerical attributes of type Int
static T parse(const std::string &string)
parses a number of type T from string
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalFloatAttrs
map with the numerical attributes of type Float
static std::map< SumoXMLTag, SumoXMLTag > myAllowedAdditionalWithParentTags
map with the allowed tags of additionals with parent and their parent
static bool isList(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool
SumoXMLTag getTag() const
get XML Tag assigned to this object
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myFileAttrs
map with the empty attributes