16 #ifndef __OMNETPP_CPAR_H 17 #define __OMNETPP_CPAR_H 19 #include "cownedobject.h" 20 #include "cexpression.h" 21 #include "cexception.h" 88 cPar() {ownerComponent = evalContext =
nullptr; p =
nullptr;}
93 void moveto(
cPar& other);
105 void acceptDefault();
113 #ifdef SIMFRONTEND_SUPPORT 115 virtual bool hasChangedSince(int64_t lastRefreshSerial);
124 void operator=(
const cPar& other);
129 virtual const char *getName()
const override;
134 virtual std::string str()
const override;
141 virtual cObject *getOwner()
const override;
147 virtual void forEachChild(
cVisitor *v)
override;
155 Type getType()
const;
160 static const char *getTypeName(Type t);
165 bool isNumeric()
const;
171 bool isVolatile()
const;
178 bool isExpression()
const;
185 bool isShared()
const;
199 bool containsValue()
const;
214 cPar& setBoolValue(
bool b);
229 cPar& setDoubleValue(
double d);
236 cPar& setStringValue(
const char *s);
279 bool boolValue()
const;
296 double doubleValue()
const;
303 double doubleValueInUnit(
const char *targetUnit)
const;
310 const char *getUnit()
const;
320 const char *stringValue()
const;
325 std::string stdstringValue()
const;
373 void convertToConst();
383 void parse(
const char *text);
432 cPar&
operator=(
unsigned long i) {
return setIntValue(checked_int_cast<intpar_t>(i,
this));}
437 cPar&
operator=(
long long i) {
return setIntValue(checked_int_cast<intpar_t>(i,
this));}
442 cPar&
operator=(
unsigned long long i) {
return setIntValue(checked_int_cast<intpar_t>(i,
this));}
472 operator bool()
const {
return boolValue();}
508 operator unsigned short()
const {
return checked_int_cast<
unsigned short>(intValue(),
this);}
532 operator unsigned long long()
const {
return checked_int_cast<
unsigned long long>(intValue(),
this);}
537 operator double()
const {
return doubleValue();}
542 operator long double()
const {
return doubleValue();}
547 operator const char *()
const {
return stringValue();}
552 operator std::string()
const {
return stdstringValue();}
Common base for module and channel classes.
Definition: ccomponent.h:48
cPar & operator=(unsigned char c)
Definition: cpar.h:402
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
cPar & operator=(long long i)
Definition: cpar.h:437
void setEvaluationContext(cComponent *ctx)
Definition: cpar.h:270
Represents an XML element in an XML configuration file.
Definition: cxmlelement.h:73
Represents a module or channel parameter.
Definition: cpar.h:68
cPar & operator=(const std::string &s)
Definition: cpar.h:462
int64_t intpar_t
Type for NED parameter values that store integers. It is guaranteed to be signed and at least as wide...
Definition: simkerneldefs.h:86
cPar & operator=(long i)
Definition: cpar.h:427
cPar & operator=(unsigned long long i)
Definition: cpar.h:442
cPar & operator=(unsigned long i)
Definition: cpar.h:432
_OPPDEPRECATED cPar & setLongValue(intpar_t l)
Definition: cpar.h:224
cPar & operator=(unsigned int i)
Definition: cpar.h:412
cPar & operator=(short i)
Definition: cpar.h:417
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cComponent * getEvaluationContext() const
Definition: cpar.h:364
cPar & operator=(long double d)
Definition: cpar.h:452
Definition: cabstracthistogram.h:21
cPar & operator=(int i)
Definition: cpar.h:407
A collection of properties (cProperty).
Definition: cproperties.h:34
cPar & setStringValue(const std::string &s)
Definition: cpar.h:241
bool isEmptyString() const
Definition: cpar.h:331
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:54
cPar & operator=(char c)
Definition: cpar.h:397
Abstract base class for expression evaluators.
Definition: cexpression.h:33
cPar & operator=(unsigned short i)
Definition: cpar.h:422
_OPPDEPRECATED intpar_t longValue() const
Definition: cpar.h:290
cPar & operator=(cXMLElement *node)
Definition: cpar.h:467
cPar & operator=(double d)
Definition: cpar.h:447
Internal class that stores values for cPar objects.
Definition: cparimpl.h:44
cPar & operator=(bool b)
Definition: cpar.h:392
cPar & operator=(const char *s)
Definition: cpar.h:457