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