OMNeT++ Simulation Library  6.0.3
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 
21 namespace omnetpp {
22 namespace internal {
23 
29 class SIM_API cXMLParImpl : public cParImpl
30 {
31  protected:
32  // selector: flags & FL_ISEXPR
33  cExpression *expr = nullptr;
34  cXMLElement *val = 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 override;
123 
127  virtual intval_t intValue(cComponent *context) const override;
128 
132  virtual double doubleValue(cComponent *context) const override;
133 
137  virtual const char *stringValue(cComponent *context) const override;
138 
142  virtual std::string stdstringValue(cComponent *context) const override;
143 
147  virtual cObject *objectValue(cComponent *context) const override;
148 
152  virtual cXMLElement *xmlValue(cComponent *context) 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) override;
182 
186  virtual std::string str() const override;
187 
191  virtual void parse(const char *text, FileLine loc) override;
192 
196  virtual int compare(const cParImpl *other) const override;
197 
201  virtual void forEachChild(cVisitor *v, cComponent *context) override;
203 };
204 
205 } // namespace internal
206 } // namespace omnetpp
207 
208 #endif
209 
210 
omnetpp::cObject
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition: cobject.h:92
omnetpp::cExpression
Abstract base class for expression evaluators.
Definition: cexpression.h:33
omnetpp::internal::cXMLParImpl
A cParImpl subclass that stores a module/channel parameter of type XML.
Definition: cxmlparimpl.h:29
omnetpp::cVisitor
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
omnetpp::internal::cXMLParImpl::cXMLParImpl
cXMLParImpl(const cXMLParImpl &other)
Definition: cxmlparimpl.h:54
omnetpp::internal::cXMLParImpl::dup
virtual cXMLParImpl * dup() const override
Definition: cxmlparimpl.h:73
omnetpp::FileLine
Definition: fileline.h:27
omnetpp::internal::cXMLParImpl::cXMLParImpl
cXMLParImpl()
Definition: cxmlparimpl.h:49
omnetpp::intval_t
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
omnetpp::internal::cParImpl
Internal class that stores values for cPar objects.
Definition: cparimpl.h:46
omnetpp::cXMLElement
Represents an XML element in an XML configuration file.
Definition: cxmlelement.h:75
omnetpp::cComponent
Common base for module and channel classes.
Definition: ccomponent.h:49