|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
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 enum { SHORTSTR_MAXLEN = 27 };
69 bool changedFlag =
false;
70 bool takeOwnership =
false;
73 struct {
bool sht;
char *str; } ls;
74 struct {
bool sht;
char str[SHORTSTR_MAXLEN+1]; } ss;
75 struct {
long val; } lng;
76 struct {
double val; } dbl;
78 double p1,p2,p3,p4; } func;
79 struct { cStatistic *res; } dtr;
83 size_t itemsize; } ptr;
84 struct { cOwnedObject *obj; } obj;
85 struct { cXMLElement *node; } xmlp;
89 void copy(
const cMsgPar& other);
98 bool setfunction(
char *w);
109 virtual void beforeChange();
116 virtual void afterChange();
126 cMsgPar(
const cMsgPar& other);
132 explicit cMsgPar(
const char *name=
nullptr);
138 explicit cMsgPar(
const char *name, cMsgPar& other);
156 cMsgPar& operator=(
const cMsgPar& otherpar);
172 virtual std::string str()
const override;
178 virtual void forEachChild(
cVisitor *v)
override;
185 virtual void parsimPack(
cCommBuffer *buffer)
const override;
192 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
213 cMsgPar& setStringValue(
const char *s);
218 cMsgPar& setDoubleValue(
double d);
267 cMsgPar& setPointerValue(
void *ptr);
299 void configPointer( VoidDelFunc delfunc, VoidDupFunc dupfunc,
size_t itemsize=0);
331 const char *stringValue();
337 double doubleValue();
342 void *pointerValue();
361 char getType()
const;
366 bool isNumeric()
const;
373 bool isConstant()
const;
389 void convertToConst();
407 virtual bool parse(
const char *text,
char type=
'?');
491 operator bool() {
return boolValue();}
496 operator const char *() {
return stringValue();}
501 operator char() {
return (
char)longValue();}
506 operator unsigned char() {
return (
unsigned char)longValue();}
511 operator int() {
return (
int)longValue();}
516 operator unsigned int() {
return (
unsigned int)longValue();}
521 operator short() {
return (
short)longValue();}
526 operator unsigned short() {
return (
unsigned short)longValue();}
531 operator long() {
return longValue();}
536 operator unsigned long() {
return longValue();}
541 operator double() {
return doubleValue();}
546 operator long double() {
return doubleValue();}
551 operator void *() {
return pointerValue();}
cMsgPar & operator=(void *ptr)
Definition: cmsgpar.h:476
cMsgPar & operator=(cXMLElement *node)
Definition: cmsgpar.h:486
cMsgPar & operator=(int i)
Definition: cmsgpar.h:436
cMsgPar & operator=(unsigned int i)
Definition: cmsgpar.h:441
bool getTakeOwnership() const
Definition: cmsgpar.h:311
double(* MathFunc2Args)(double, double)
Prototype for mathematical functions taking two arguments.
Definition: cnedmathfunction.h:57
void setTakeOwnership(bool tk)
Definition: cmsgpar.h:306
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:481
cMsgPar & operator=(char c)
Definition: cmsgpar.h:426
double(* MathFunc)(...)
Prototype for mathematical functions.
Definition: cnedmathfunction.h:33
cMsgPar & operator=(long double d)
Definition: cmsgpar.h:471
cMsgPar & operator=(const char *s)
Definition: cmsgpar.h:421
cMsgPar & operator=(short i)
Definition: cmsgpar.h:446
cMsgPar & operator=(long l)
Definition: cmsgpar.h:456
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:166
cMsgPar & operator=(unsigned char c)
Definition: cmsgpar.h:431
double(* MathFunc1Arg)(double)
Prototype for mathematical functions taking one argument.
Definition: cnedmathfunction.h:49
cMsgPar & operator=(unsigned short i)
Definition: cmsgpar.h:451
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:466
cMsgPar & operator=(unsigned long l)
Definition: cmsgpar.h:461
cMsgPar & operator=(bool b)
Definition: cmsgpar.h:416
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