OMNeT++ Simulation Library
6.0.3
|
16 #ifndef __OMNETPP_CMSGPAR_H
17 #define __OMNETPP_CMSGPAR_H
19 #include "cownedobject.h"
20 #include "cnedmathfunction.h"
58 typedef void (*VoidDelFunc)(
void *);
63 typedef void *(*VoidDupFunc)(
void *);
66 static const char *possibleTypes;
69 enum { SHORTSTR_MAXLEN = 27 };
72 bool changedFlag =
false;
73 bool takeOwnership =
false;
76 struct {
bool sht;
char *str; } ls;
77 struct {
bool sht;
char str[SHORTSTR_MAXLEN+1]; } ss;
78 struct {
long val; } lng;
79 struct {
double val; } dbl;
81 double p1,p2,p3,p4; } func;
82 struct { cStatistic *res; } dtr;
86 size_t itemsize; } ptr;
87 struct { cOwnedObject *obj; } obj;
88 struct { cXMLElement *node; } xmlp;
92 void copy(
const cMsgPar& other);
101 bool setfunction(
char *w);
112 virtual void beforeChange();
119 virtual void afterChange();
129 cMsgPar(
const cMsgPar& other);
135 explicit cMsgPar(
const char *name=
nullptr);
141 explicit cMsgPar(
const char *name, cMsgPar& other);
159 cMsgPar& operator=(
const cMsgPar& otherpar);
175 virtual std::string str()
const override;
181 virtual void forEachChild(
cVisitor *v)
override;
188 virtual void parsimPack(
cCommBuffer *buffer)
const override;
195 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
216 cMsgPar& setStringValue(
const char *s);
221 cMsgPar& setDoubleValue(
double d);
270 cMsgPar& setPointerValue(
void *ptr);
302 void configPointer( VoidDelFunc delfunc, VoidDupFunc dupfunc,
size_t itemsize=0);
334 const char *stringValue();
340 double doubleValue();
345 void *pointerValue();
364 char getType()
const;
369 bool isNumeric()
const;
376 bool isConstant()
const;
392 void convertToConst();
410 virtual bool parse(
const char *text,
char type=
'?');
494 operator bool() {
return boolValue();}
499 operator const char *() {
return stringValue();}
504 operator char() {
return (
char)longValue();}
509 operator unsigned char() {
return (
unsigned char)longValue();}
514 operator int() {
return (
int)longValue();}
519 operator unsigned int() {
return (
unsigned int)longValue();}
524 operator short() {
return (
short)longValue();}
529 operator unsigned short() {
return (
unsigned short)longValue();}
534 operator long() {
return longValue();}
539 operator unsigned long() {
return longValue();}
544 operator double() {
return doubleValue();}
549 operator long double() {
return doubleValue();}
554 operator void *() {
return pointerValue();}
cMsgPar & operator=(void *ptr)
Definition: cmsgpar.h:479
cMsgPar & operator=(cXMLElement *node)
Definition: cmsgpar.h:489
cMsgPar & operator=(int i)
Definition: cmsgpar.h:439
cMsgPar & operator=(unsigned int i)
Definition: cmsgpar.h:444
bool getTakeOwnership() const
Definition: cmsgpar.h:314
double(* MathFunc2Args)(double, double)
Prototype for mathematical functions taking two arguments.
Definition: cnedmathfunction.h:57
void setTakeOwnership(bool tk)
Definition: cmsgpar.h:309
double(* MathFunc3Args)(double, double, double)
Prototype for mathematical functions taking three arguments.
Definition: cnedmathfunction.h:65
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
cMsgPar & operator=(cOwnedObject *obj)
Definition: cmsgpar.h:484
cMsgPar & operator=(char c)
Definition: cmsgpar.h:429
double(* MathFunc)(...)
Prototype for mathematical functions.
Definition: cnedmathfunction.h:33
cMsgPar & operator=(long double d)
Definition: cmsgpar.h:474
cMsgPar & operator=(const char *s)
Definition: cmsgpar.h:424
cMsgPar & operator=(short i)
Definition: cmsgpar.h:449
cMsgPar & operator=(long l)
Definition: cmsgpar.h:459
double(* MathFunc4Args)(double, double, double, double)
Prototype for mathematical functions taking four arguments.
Definition: cnedmathfunction.h:73
Represents an XML element in an XML configuration file.
Definition: cxmlelement.h:75
virtual cMsgPar * dup() const override
Definition: cmsgpar.h:169
cMsgPar & operator=(unsigned char c)
Definition: cmsgpar.h:434
double(* MathFunc1Arg)(double)
Prototype for mathematical functions taking one argument.
Definition: cnedmathfunction.h:49
cMsgPar & operator=(unsigned short i)
Definition: cmsgpar.h:454
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
double(* MathFuncNoArg)()
Prototype for mathematical functions taking no arguments.
Definition: cnedmathfunction.h:41
cMsgPar & operator=(double d)
Definition: cmsgpar.h:469
cMsgPar & operator=(unsigned long l)
Definition: cmsgpar.h:464
cMsgPar & operator=(bool b)
Definition: cmsgpar.h:419
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
Allows a value (string, bool, double, etc) to be attached to a cMessage object.
Definition: cmsgpar.h:52
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:105