cvalue.h Source File¶
|
API
|
cvalue.h
105 cValue(const void *) = delete; // prevent non-cObject pointers from silently being converted to bool
195 static std::string formatQuantity(double d, const char *unit, int maxSignificantDigits=6, const char *groupSeparator="'");
204 static std::string formatQuantityInBestUnit(double d, const char *unit, int maxSignificantDigits=6, const char *groupSeparator="'");
456 cValue& operator=(unsigned long l) {set(checked_int_cast<intval_t>(l, OVERFLOW_MSG)); return *this;}
461 cValue& operator=(long long l) {set(checked_int_cast<intval_t>(l, OVERFLOW_MSG)); return *this;}
466 cValue& operator=(unsigned long long l) {set(checked_int_cast<intval_t>(l, OVERFLOW_MSG)); return *this;}
513 operator unsigned char() const {return checked_int_cast<unsigned char>(intValue(), OVERFLOW_MSG);}
525 operator unsigned int() const {return checked_int_cast<unsigned int>(intValue(), OVERFLOW_MSG);}
537 operator unsigned short() const {return checked_int_cast<unsigned short>(intValue(), OVERFLOW_MSG);}
549 operator unsigned long() const {return checked_int_cast<unsigned long>(intValue(), OVERFLOW_MSG);}
561 operator unsigned long long() const {return checked_int_cast<unsigned long long>(intValue(), OVERFLOW_MSG);}
A stack-based expression evaluator class, for dynamically created expressions.
Definition cdynamicexpression.h:41
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition cobject.h:93
void convertToDouble()
double doubleValueInUnit(const char *targetUnit) const
intval_t intValueInUnit(const char *targetUnit) const
void setUnit(const char *unit)
void operator=(const cValue &other)
bool containsXML() const
cObject * objectValue() const
static double convertUnit(double d, const char *unit, const char *targetUnit)
static double parseQuantity(const char *str, std::string &outActualUnit)
intval_t intValue() const
double doubleValueRaw() const
intval_t intValueRaw() const
static std::string formatQuantityInBestUnit(double d, const char *unit, int maxSignificantDigits=6, const char *groupSeparator="'")
cXMLElement * xmlValue() const
void convertTo(const char *unit)
bool containsObject() const
static const char * getTypeName(Type t)
static double parseQuantity(const char *str, const char *expectedUnit=nullptr)
double doubleValue() const
void set(const void *)=delete
bool operator==(const cValue &other)
std::string str() const
static const char * getBestUnit(double d, const char *unit)
static std::string formatQuantity(double d, const char *unit, int maxSignificantDigits=6, const char *groupSeparator="'")
Represents an XML element in an XML configuration file.
Definition cxmlelement.h:76
Definition opp_pooledstring.h:30
Lightweight string class, used internally in some parts of OMNeT++.
Definition opp_string.h:40
int64_t intval_t
Signed integer type which is guaranteed to be at least 64 bits wide. It is used throughout the librar...
Definition simkerneldefs.h:101
ToInt checked_int_cast(FromInt x, const char *errmsg=nullptr)
Safe integer cast: it throws an exception if in case of an overflow, i.e. when if the target type can...
Definition simutil.h:46
Generated on for API by