cxmlparimpl.h

00001 //==========================================================================
00002 //   CXMLPARIMPL.H  - part of
00003 //                     OMNeT++/OMNEST
00004 //            Discrete System Simulation in C++
00005 //
00006 //  Author: Andras Varga
00007 //
00008 //==========================================================================
00009 
00010 /*--------------------------------------------------------------*
00011   Copyright (C) 1992-2008 Andras Varga
00012   Copyright (C) 2006-2008 OpenSim Ltd.
00013 
00014   This file is distributed WITHOUT ANY WARRANTY. See the file
00015   `license' for details on this and other legal matters.
00016 *--------------------------------------------------------------*/
00017 
00018 #ifndef __CXMLPARIMPL_H
00019 #define __CXMLPARIMPL_H
00020 
00021 #include "cparimpl.h"
00022 
00023 NAMESPACE_BEGIN
00024 
00030 class SIM_API cXMLParImpl : public cParImpl
00031 {
00032   protected:
00033     // selector: flags & FL_ISEXPR
00034     cExpression *expr;
00035     cXMLElement *val;
00036 
00037   private:
00038     void copy(const cXMLParImpl& other);
00039 
00040   protected:
00041     void deleteOld();
00042 
00043   public:
00046 
00050     explicit cXMLParImpl();
00051 
00055     cXMLParImpl(const cXMLParImpl& other) : cParImpl(other) {copy(other);}
00056 
00060     virtual ~cXMLParImpl();
00061 
00065     void operator=(const cXMLParImpl& otherpar);
00067 
00070 
00074     virtual cXMLParImpl *dup() const  {return new cXMLParImpl(*this);}
00075 
00079     virtual std::string detailedInfo() const;
00080 
00084     virtual void parsimPack(cCommBuffer *buffer);
00085 
00089     virtual void parsimUnpack(cCommBuffer *buffer);
00091 
00094 
00098     virtual void setBoolValue(bool b);
00099 
00103     virtual void setLongValue(long l);
00104 
00108     virtual void setDoubleValue(double d);
00109 
00113     virtual void setStringValue(const char *s);
00114 
00118     virtual void setXMLValue(cXMLElement *node);
00119 
00124     virtual void setExpression(cExpression *e);
00126 
00129 
00133     virtual bool boolValue(cComponent *context) const;
00134 
00138     virtual long longValue(cComponent *context) const;
00139 
00143     virtual double doubleValue(cComponent *context) const;
00144 
00148     virtual const char *stringValue(cComponent *context) const;
00149 
00153     virtual std::string stdstringValue(cComponent *context) const;
00154 
00158     virtual cXMLElement *xmlValue(cComponent *context) const;
00159 
00163     virtual cExpression *getExpression() const;
00165 
00168 
00172     virtual Type getType() const;
00173 
00177     virtual bool isNumeric() const;
00179 
00182 
00187     virtual void convertToConst(cComponent *context);
00188 
00192     virtual std::string str() const;
00193 
00197     virtual void parse(const char *text);
00198 
00202     virtual int compare(const cParImpl *other) const;
00204 };
00205 
00206 NAMESPACE_END
00207 
00208 
00209 #endif
00210 
00211 
Generated on Tue Dec 2 11:16:27 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3