 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
45 : myAmSet(set), myHaveTheDefaultValue(true), myAmWritable(true) {}
49 : myAmSet(s.myAmSet), myHaveTheDefaultValue(s.myHaveTheDefaultValue),
50 myAmWritable(s.myAmWritable) {}
185 :
Option(true), myValue(value) {
222 std::string s =
"'" + v +
"' is not a valid integer.";
230 std::ostringstream s;
247 :
Option(true), myValue(value) {
296 :
Option(true), myValue(value) {
333 throw ProcessError(
"'" + v +
"' is not a valid float.");
340 std::ostringstream s;
351 :
Option(true), myValue(value) {
413 :
Option_Bool(value), myValueString(value ?
"true" :
"false") {
510 :
Option(true), myValue(value) {
516 :
Option(s), myValue(s.myValue) {}
540 if (v.find(
';') != std::string::npos) {
541 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
551 throw ProcessError(
"'" + v +
"' is not a valid integer vector.");
572 :
Option(true), myValue(value) {
578 :
Option(s), myValue(s.myValue) {}
602 if (v.find(
';') != std::string::npos) {
603 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
613 throw ProcessError(
"'" + v +
"' is not a valid float vector.");
bool set(const std::string &v)
Stores the given value after parsing it into a vector of integers.
bool myAmSet
information whether the value is set
~Option_BoolExtended()
Destructor.
std::string getValueString() const
Returns the string-representation of the value.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
#define WRITE_WARNING(msg)
A class representing a single program option.
bool set(const std::string &v)
Stores the given value after parsing it into an integer.
bool isBool() const
Returns true, the information whether the option is a bool option.
bool isWriteable() const
Returns the information whether the option may be set a further time.
Option_Integer & operator=(const Option_Integer &s)
Assignment operator.
Option_BoolExtended & operator=(const Option_BoolExtended &s)
Assignment operator.
Option_Float & operator=(const Option_Float &s)
Assignment operator.
void resetDefault()
Resets the option to be on its default value.
bool hasNext()
returns the information whether further substrings exist
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Option_IntVector()
Constructor for an option with no default value.
Option_Bool & operator=(const Option_Bool &s)
Assignment operator.
virtual bool isFileName() const
Returns the information whether this option is a file name.
virtual bool set(const std::string &v)
bool isFileName() const
Returns true, the information whether this option is a file name.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
virtual bool isBool() const
Returns the information whether the option is a bool option.
void setDescription(const std::string &desc)
Sets the description of what this option does.
virtual bool isDefault() const
Returns the information whether the option holds the default value.
virtual const FloatVector & getFloatVector() const
Returns the stored float vector.
bool set(const std::string &v)
Stores the given value after parsing it into a vector of integers.
std::string myDescription
The description what this option does.
std::vector< int > IntVector
Definition of a vector of ints.
int getInt() const
Returns the stored integer value.
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
Option(bool set=false)
Constructor.
Option_Integer(int value)
Constructor for an option with a default value.
Option_BoolExtended(bool value)
Constructor for an option that can be used without an argument like Option_BoolExtended but which als...
double getFloat() const
Returns the stored double value.
virtual std::string getValueString() const
Returns the string-representation of the value.
std::string getValueString() const
Returns the string-representation of the value.
std::string getString() const
Returns the stored string value.
Option_String & operator=(const Option_String &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
~Option_Integer()
Destructor.
const FloatVector & getFloatVector() const
Returns the stored float vector.
virtual ~Option_FloatVector()
Destructor.
const std::string & getDescription() const
Returns the description of what this option does.
Option_Float(double value)
Constructor for an option with a default value.
bool isSet() const
returns the information whether this options holds a valid value
std::string getValueString() const
Returns the string-representation of the value.
Option_String()
Constructor for an option with no default value.
bool set(const std::string &v)
Stores the given value after parsing it into a double.
Option_FileName()
Constructor for an option with no default value.
virtual double getFloat() const
Returns the stored double value.
~Option_Bool()
Destructor.
Option_FloatVector & operator=(const Option_FloatVector &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
static std::string urlEncode(const std::string &url, const std::string encodeWhich="")
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
bool set(const std::string &v)
Stores the given value.
void resetWritable()
Resets the option to be writeable.
std::string getValueString() const
Returns the string-representation of the value.
std::string getValueString() const
Returns the string-representation of the value.
virtual ~Option_IntVector()
Destructor.
void unSet()
marks this option as unset
const IntVector & getIntVector() const
Returns the stored integer vector.
virtual ~Option_FileName()
Destructor.
bool getBool() const
Returns the stored boolean value.
virtual std::string getString() const
Returns the stored string value.
~Option_Float()
Destructor.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Option_Bool(bool value)
Constructor for an option with a default value.
virtual const IntVector & getIntVector() const
Returns the stored integer vector.
std::string myValueString
bool set(const std::string &v)
bool markSet()
Marks the information as set.
virtual bool getBool() const
Returns the stored boolean value.
virtual Option & operator=(const Option &s)
Assignment operator.
std::string myTypeName
A type name for this option (has presets, but may be overwritten)
virtual int getInt() const
Returns the stored integer value.
virtual ~Option_String()
Destructor.
bool myAmWritable
information whether the value may be changed
Option_IntVector & operator=(const Option_IntVector &s)
Assignment operator.
Option_FileName & operator=(const Option_FileName &s)
Assignment operator.
std::vector< double > FloatVector
Definition of a vector of doubles.
Option_FloatVector()
Constructor for an option with no default value.
bool myHaveTheDefaultValue
information whether the value is the default value (is then set)