00001 /* -*- mode: c++; indent-tabs-mode: nil -*- */ 00002 /* 00003 QoreFloatNode.h 00004 00005 Qore Programming Language 00006 00007 Copyright 2003 - 2010 David Nichols 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the Free Software 00021 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #ifndef _QORE_QOREFLOATNODE_H 00025 00026 #define _QORE_QOREFLOATNODE_H 00027 00028 class LocalVar; 00029 class QoreTypeInfo; 00030 00032 class QoreFloatNode : public SimpleValueQoreNode { 00033 private: 00035 DLLLOCAL virtual bool getAsBoolImpl() const; 00036 00038 DLLLOCAL virtual int getAsIntImpl() const; 00039 00041 DLLLOCAL virtual int64 getAsBigIntImpl() const; 00042 00044 DLLLOCAL virtual double getAsFloatImpl() const; 00045 00046 protected: 00048 00051 DLLEXPORT virtual ~QoreFloatNode(); 00052 00053 public: 00055 double f; 00056 00058 00061 DLLEXPORT QoreFloatNode(double n_f); 00062 00064 DLLEXPORT QoreFloatNode(); 00065 00067 00072 DLLEXPORT virtual QoreString *getStringRepresentation(bool &del) const; 00073 00075 00078 DLLEXPORT virtual void getStringRepresentation(QoreString &str) const; 00079 00081 00087 DLLEXPORT virtual class DateTime *getDateTimeRepresentation(bool &del) const; 00088 00090 00094 DLLEXPORT virtual void getDateTimeRepresentation(DateTime &dt) const; 00095 00097 00103 DLLEXPORT virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const; 00104 00106 00112 DLLEXPORT virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) const; 00113 00115 00118 DLLEXPORT virtual class AbstractQoreNode *realCopy() const; 00119 00121 00126 DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const; 00127 00129 00134 DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const; 00135 00137 00140 DLLEXPORT virtual const char *getTypeName() const; 00141 00143 DLLLOCAL virtual AbstractQoreNode *parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo); 00144 00146 00149 DLLLOCAL static const char *getStaticTypeName() { 00150 return "float"; 00151 } 00152 }; 00153 00154 #endif