|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CPAR_H
17 #define __OMNETPP_CPAR_H
19 #include "cownedobject.h"
20 #include "cexpression.h"
21 #include "cexception.h"
32 namespace internal {
class cParImpl; }
92 cPar() {ownerComponent = evalContext =
nullptr; p =
nullptr;}
97 void moveto(
cPar& other);
99 void beforeChange(
bool isInternalChange=
false);
103 void doConvertToConst(
bool isInternalChange=
true);
112 void acceptDefault();
120 #ifdef SIMFRONTEND_SUPPORT
122 virtual bool hasChangedSince(int64_t lastRefreshSerial);
131 void operator=(
const cPar& other);
136 virtual const char *getName()
const override;
141 virtual std::string str()
const override;
148 virtual cObject *getOwner()
const override;
154 virtual void forEachChild(
cVisitor *v)
override;
162 Type getType()
const;
167 static const char *getTypeName(Type t);
172 bool isNumeric()
const;
178 bool isVolatile()
const;
184 bool isMutable()
const;
191 bool isExpression()
const;
198 bool isShared()
const;
212 bool containsValue()
const;
229 virtual const char *getBaseDirectory()
const;
235 virtual std::string getSourceLocation()
const;
244 cPar& setBoolValue(
bool b);
254 cPar& setDoubleValue(
double d);
261 cPar& setStringValue(
const char *s);
317 bool boolValue()
const;
329 double doubleValue()
const;
336 double doubleValueInUnit(
const char *targetUnit)
const;
343 const char *getUnit()
const;
353 const char *stringValue()
const;
358 std::string stdstringValue()
const;
454 void parse(
const char *text,
const char *baseDirectory=
nullptr,
FileLine loc=
FileLine(),
bool resetEvalContext=
true);
503 cPar&
operator=(
unsigned long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
508 cPar&
operator=(
long long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
513 cPar&
operator=(
unsigned long long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
548 operator bool()
const {
return boolValue();}
554 operator char()
const {
return checked_int_cast<char>(intValue(),
this);}
560 operator unsigned char()
const {
return checked_int_cast<unsigned char>(intValue(),
this);}
566 operator int()
const {
return checked_int_cast<int>(intValue(),
this);}
572 operator unsigned int()
const {
return checked_int_cast<unsigned int>(intValue(),
this);}
578 operator short()
const {
return checked_int_cast<short>(intValue(),
this);}
584 operator unsigned short()
const {
return checked_int_cast<unsigned short>(intValue(),
this);}
590 operator long()
const {
return checked_int_cast<long>(intValue(),
this);}
596 operator unsigned long()
const {
return checked_int_cast<unsigned long>(intValue(),
this);}
602 operator long long()
const {
return checked_int_cast<long long>(intValue(),
this);}
608 operator unsigned long long()
const {
return checked_int_cast<unsigned long long>(intValue(),
this);}
613 operator double()
const {
return doubleValue();}
618 operator long double()
const {
return doubleValue();}
623 operator const char *()
const {
return stringValue();}
628 operator std::string()
const {
return stdstringValue();}
633 operator cObject *()
const {
return objectValue();}
cPar & operator=(long double d)
Definition: cpar.h:523
cPar & operator=(unsigned char c)
Definition: cpar.h:473
cPar & operator=(const std::string &s)
Definition: cpar.h:533
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition: cobject.h:92
A variant-like value class used during evaluating NED expressions.
Definition: cvalue.h:47
cPar & operator=(char c)
Definition: cpar.h:468
cPar & setStringValue(const std::string &s)
Definition: cpar.h:266
cPar & operator=(const char *s)
Definition: cpar.h:528
Abstract base class for expression evaluators.
Definition: cexpression.h:33
cPar & operator=(unsigned int i)
Definition: cpar.h:483
cPar & operator=(cXMLElement *node)
Definition: cpar.h:543
void convertToConst()
Definition: cpar.h:444
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cPar & operator=(short i)
Definition: cpar.h:488
cPar & operator=(unsigned short i)
Definition: cpar.h:493
cComponent * getOwnerComponent() const
Definition: cpar.h:223
cPar & operator=(unsigned long long i)
Definition: cpar.h:513
cPar & operator=(cObject *object)
Definition: cpar.h:538
Definition: fileline.h:27
void setEvaluationContext(cComponent *ctx)
Definition: cpar.h:308
A collection of properties (cProperty).
Definition: cproperties.h:34
Represents a module or channel parameter.
Definition: cpar.h:70
cPar & operator=(bool b)
Definition: cpar.h:463
cComponent * getEvaluationContext() const
Definition: cpar.h:435
cPar & operator=(long long i)
Definition: cpar.h:508
cPar & operator=(long i)
Definition: cpar.h:498
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
Internal class that stores values for cPar objects.
Definition: cparimpl.h:46
cPar & operator=(int i)
Definition: cpar.h:478
Represents an XML element in an XML configuration file.
Definition: cxmlelement.h:75
Common base for module and channel classes.
Definition: ccomponent.h:49
bool isEmptyString() const
Definition: cpar.h:364
cPar & operator=(double d)
Definition: cpar.h:518
cPar & operator=(unsigned long i)
Definition: cpar.h:503