cxmlparimpl.h Source File

API: cxmlparimpl.h Source File
API
cxmlparimpl.h
1//==========================================================================
2// CXMLPARIMPL.H - part of
3// OMNeT++/OMNEST
4// Discrete System Simulation in C++
5//
6//==========================================================================
7
8/*--------------------------------------------------------------*
9 Copyright (C) 1992-2017 Andras Varga
10 Copyright (C) 2006-2017 OpenSim Ltd.
11
12 This file is distributed WITHOUT ANY WARRANTY. See the file
13 `license' for details on this and other legal matters.
14*--------------------------------------------------------------*/
15
16#ifndef __OMNETPP_CXMLPARIMPL_H
17#define __OMNETPP_CXMLPARIMPL_H
18
19#include "cparimpl.h"
20
21namespace omnetpp {
22namespace internal {
23
29class SIM_API cXMLParImpl : public cParImpl
30{
31 protected:
32 // selector: flags & FL_ISEXPR
33 cExpression *expr = nullptr;
34 mutable cXMLElement *obj = nullptr;
35
36 private:
37 void copy(const cXMLParImpl& other);
38
39 protected:
40 void deleteOld();
41
42 public:
45
49 explicit cXMLParImpl() {}
50
54 cXMLParImpl(const cXMLParImpl& other) : cParImpl(other) {copy(other);}
55
59 virtual ~cXMLParImpl();
60
64 void operator=(const cXMLParImpl& otherpar);
66
69
73 virtual cXMLParImpl *dup() const override {return new cXMLParImpl(*this);}
75
78
82 virtual void setBoolValue(bool b) override;
83
87 virtual void setIntValue(intval_t l) override;
88
92 virtual void setDoubleValue(double d) override;
93
97 virtual void setStringValue(const char *s) override;
98
102 virtual void setObjectValue(cObject *object) override;
103
107 virtual void setXMLValue(cXMLElement *node) override;
108
113 virtual void setExpression(cExpression *e) override;
115
118
122 virtual bool boolValue(cComponent *context, const cPar *targetPar) const override;
123
127 virtual intval_t intValue(cComponent *context, const cPar *targetPar) const override;
128
132 virtual double doubleValue(cComponent *context, const cPar *targetPar) const override;
133
137 virtual const char *stringValue(cComponent *context, const cPar *targetPar) const override;
138
142 virtual std::string stdstringValue(cComponent *context, const cPar *targetPar) const override;
143
147 virtual cObject *objectValue(cComponent *context, const cPar *targetPar) const override;
148
152 virtual cXMLElement *xmlValue(cComponent *context, const cPar *targetPar) const override;
153
157 virtual cExpression *getExpression() const override;
159
162
166 virtual Type getType() const override;
167
171 virtual bool isNumeric() const override;
173
176
181 virtual void convertToConst(cComponent *context, const cPar *targetPar) override;
182
186 virtual std::string str() const override;
187
191 virtual std::string unparse() const override;
192
196 virtual void parse(const char *text, FileLine loc, const cPar *targetPar) override;
197
201 virtual int compare(const cParImpl *other) const override;
202
206 virtual void forEachChild(cVisitor *v, cComponent *context) override;
208};
209
210} // namespace internal
211} // namespace omnetpp
212
213#endif
214
215
Definition fileline.h:28
Common base for module and channel classes.
Definition ccomponent.h:51
Abstract base class for expression evaluators.
Definition cexpression.h:34
cObject()
Definition cobject.h:124
Represents a module or channel parameter.
Definition cpar.h:71
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition cvisitor.h:57
Represents an XML element in an XML configuration file.
Definition cxmlelement.h:76
virtual cXMLElement * xmlValue(cComponent *context, const cPar *targetPar) const override
virtual void setXMLValue(cXMLElement *node) override
virtual cXMLParImpl * dup() const override
Definition cxmlparimpl.h:73
virtual std::string stdstringValue(cComponent *context, const cPar *targetPar) const override
virtual bool boolValue(cComponent *context, const cPar *targetPar) const override
virtual cObject * objectValue(cComponent *context, const cPar *targetPar) const override
virtual void setDoubleValue(double d) override
virtual void setIntValue(intval_t l) override
virtual void parse(const char *text, FileLine loc, const cPar *targetPar) override
void operator=(const cXMLParImpl &otherpar)
cXMLParImpl(const cXMLParImpl &other)
Definition cxmlparimpl.h:54
virtual std::string unparse() const override
virtual void setExpression(cExpression *e) override
virtual double doubleValue(cComponent *context, const cPar *targetPar) const override
virtual const char * stringValue(cComponent *context, const cPar *targetPar) const override
virtual void forEachChild(cVisitor *v, cComponent *context) override
virtual void setStringValue(const char *s) override
virtual int compare(const cParImpl *other) const override
virtual void convertToConst(cComponent *context, const cPar *targetPar) override
virtual void setObjectValue(cObject *object) override
virtual std::string str() const override
cXMLParImpl()
Definition cxmlparimpl.h:49
virtual cExpression * getExpression() const override
virtual intval_t intValue(cComponent *context, const cPar *targetPar) const override
virtual void setBoolValue(bool b) override
virtual Type getType() const override
virtual bool isNumeric() const override
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