44 #ifdef CHECK_MEMORY_LEAKS 46 #endif // CHECK_MEMORY_LEAKS 56 : myAmSet(set), myHaveTheDefaultValue(true), myAmWritable(true) {}
229 std::string s =
"'" + v +
"' is not a valid integer.";
237 std::ostringstream s;
346 throw ProcessError(
"'" + v +
"' is not a valid float.");
353 std::ostringstream s;
510 if (v.find(
';') != std::string::npos) {
511 WRITE_WARNING(
"Please note that using ';' as list separator is deprecated.\n From 1.0 onwards, only ',' will be accepted.");
521 throw ProcessError(
"'" + v +
"' is not a valid integer vector.");
Option_Float()
Constructor for an option with no default value.
~Option_Bool()
Destructor.
bool set(const std::string &v)
Stores the given value after parsing it into an integer.
bool markSet()
Marks the information as set.
bool isSet() const
returns the information whether this options holds a valid value
Option_IntVector & operator=(const Option_IntVector &s)
Assignment operator.
bool myAmWritable
information whether the value may be changed
static SUMOReal _2SUMOReal(const E *const data)
static bool _2bool(const E *const data)
virtual bool isBool() const
Returns the information whether the option is a bool option.
std::string getValueString() const
Returns the string-representation of the value.
~Option_Float()
Destructor.
virtual bool getBool() const
Returns the stored boolean value.
Option_String & operator=(const Option_String &s)
Assignment operator.
virtual const IntVector & getIntVector() const
Returns the stored integer vector.
bool isFileName() const
Returns true, the information whether this option is a file name.
bool set(const std::string &v)
Stores the given value after parsing it into a SUMOReal.
void setDescription(const std::string &desc)
Sets the description of what this option does.
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
SUMOReal getFloat() const
Returns the stored SUMOReal value.
bool myAmSet
information whether the value is set
std::string getString() const
Returns the stored string value.
virtual std::string getString() const
Returns the stored string value.
void unSet()
marks this option as unset
Option(bool set=false)
Constructor.
virtual ~Option_IntVector()
Destructor.
#define WRITE_WARNING(msg)
std::string getValueString() const
Returns the string-representation of the value.
static std::string urlEncode(const std::string &url, const std::string encodeWhich="")
std::string getValueString() const
Returns the string-representation of the value.
Option_FileName()
Constructor for an option with no default value.
std::string getValueString() const
Returns the string-representation of the value.
virtual ~Option_String()
Destructor.
bool isBool() const
Returns true, the information whether the option is a bool option.
virtual Option & operator=(const Option &s)
Assignment operator.
std::vector< int > IntVector
Definition of a vector of unsigned ints.
const std::string & getDescription() const
Returns the description of what this option does.
std::string myTypeName
A type name for this option (has presets, but may be overwritten)
Option_Integer()
Constructor for an option with no default value.
Option_String()
Constructor for an option with no default value.
int getInt() const
Returns the stored integer value.
bool set(const std::string &v)
Stores the given value after parsing it into a vector of integers.
Option_Bool()
Constructor for an option with no default value.
bool isWriteable() const
Returns the information whether the option may be set a further time.
Option_Bool & operator=(const Option_Bool &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
~Option_Integer()
Destructor.
bool set(const std::string &v)
Stores the given value.
A class representing a single program option.
virtual bool isDefault() const
Returns the information whether the option holds the default value.
virtual int getInt() const
Returns the stored integer value.
virtual SUMOReal getFloat() const
Returns the stored SUMOReal value.
bool set(const std::string &v)
static int _2int(const E *const data)
virtual bool isFileName() const
Returns the information whether this option is a file name.
void resetWritable()
Resets the option to be writeable.
Option_IntVector()
Constructor for an option with no default value.
std::string myDescription
The description what this option does.
bool getBool() const
Returns the stored boolean value.
virtual ~Option_FileName()
Destructor.
Option_FileName & operator=(const Option_FileName &s)
Assignment operator.
std::string getValueString() const
Returns the string-representation of the value.
Option_Float & operator=(const Option_Float &s)
Assignment operator.
bool myHaveTheDefaultValue
information whether the value is the default value (is then set)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
const IntVector & getIntVector() const
Returns the stored integer vector.
Option_Integer & operator=(const Option_Integer &s)
Assignment operator.