OMNeT++ Simulation Library
6.0.3
|
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;
227 cPar& setBoolValue(
bool b);
237 cPar& setDoubleValue(
double d);
244 cPar& setStringValue(
const char *s);
300 bool boolValue()
const;
312 double doubleValue()
const;
319 double doubleValueInUnit(
const char *targetUnit)
const;
326 const char *getUnit()
const;
336 const char *stringValue()
const;
341 std::string stdstringValue()
const;
437 void parse(
const char *text,
const char *baseDirectory=
nullptr,
FileLine loc=
FileLine());
486 cPar&
operator=(
unsigned long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
491 cPar&
operator=(
long long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
496 cPar&
operator=(
unsigned long long i) {
return setIntValue(checked_int_cast<intval_t>(i,
this));}
531 operator bool()
const {
return boolValue();}
537 operator char()
const {
return checked_int_cast<char>(intValue(),
this);}
543 operator unsigned char()
const {
return checked_int_cast<unsigned char>(intValue(),
this);}
549 operator int()
const {
return checked_int_cast<int>(intValue(),
this);}
555 operator unsigned int()
const {
return checked_int_cast<unsigned int>(intValue(),
this);}
561 operator short()
const {
return checked_int_cast<short>(intValue(),
this);}
567 operator unsigned short()
const {
return checked_int_cast<unsigned short>(intValue(),
this);}
573 operator long()
const {
return checked_int_cast<long>(intValue(),
this);}
579 operator unsigned long()
const {
return checked_int_cast<unsigned long>(intValue(),
this);}
585 operator long long()
const {
return checked_int_cast<long long>(intValue(),
this);}
591 operator unsigned long long()
const {
return checked_int_cast<unsigned long long>(intValue(),
this);}
596 operator double()
const {
return doubleValue();}
601 operator long double()
const {
return doubleValue();}
606 operator const char *()
const {
return stringValue();}
611 operator std::string()
const {
return stdstringValue();}
616 operator cObject *()
const {
return objectValue();}
cPar & operator=(long double d)
Definition: cpar.h:506
cPar & operator=(unsigned char c)
Definition: cpar.h:456
cPar & operator=(const std::string &s)
Definition: cpar.h:516
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:451
cPar & setStringValue(const std::string &s)
Definition: cpar.h:249
cPar & operator=(const char *s)
Definition: cpar.h:511
Abstract base class for expression evaluators.
Definition: cexpression.h:33
cPar & operator=(unsigned int i)
Definition: cpar.h:466
cPar & operator=(cXMLElement *node)
Definition: cpar.h:526
void convertToConst()
Definition: cpar.h:427
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cPar & operator=(short i)
Definition: cpar.h:471
cPar & operator=(unsigned short i)
Definition: cpar.h:476
cPar & operator=(unsigned long long i)
Definition: cpar.h:496
cPar & operator=(cObject *object)
Definition: cpar.h:521
Definition: fileline.h:27
void setEvaluationContext(cComponent *ctx)
Definition: cpar.h:291
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:446
cComponent * getEvaluationContext() const
Definition: cpar.h:418
cPar & operator=(long long i)
Definition: cpar.h:491
cPar & operator=(long i)
Definition: cpar.h:481
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:461
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:347
cPar & operator=(double d)
Definition: cpar.h:501
cPar & operator=(unsigned long i)
Definition: cpar.h:486