Qore Programming Language  0.8.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreFloatNode.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreFloatNode.h
4 
5  Qore Programming Language
6 
7  Copyright 2003 - 2013 David Nichols
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23 
24 #ifndef _QORE_QOREFLOATNODE_H
25 
26 #define _QORE_QOREFLOATNODE_H
27 
28 class LocalVar;
29 class QoreTypeInfo;
30 
33 private:
35  DLLLOCAL virtual bool getAsBoolImpl() const;
36 
38  DLLLOCAL virtual int getAsIntImpl() const;
39 
41  DLLLOCAL virtual int64 getAsBigIntImpl() const;
42 
44  DLLLOCAL virtual double getAsFloatImpl() const;
45 
46 protected:
48 
51  DLLEXPORT virtual ~QoreFloatNode();
52 
53 public:
55  double f;
56 
58 
61  DLLEXPORT QoreFloatNode(double n_f);
62 
64  DLLEXPORT QoreFloatNode();
65 
67 
72  DLLEXPORT virtual QoreString *getStringRepresentation(bool &del) const;
73 
75 
78  DLLEXPORT virtual void getStringRepresentation(QoreString &str) const;
79 
81 
87  DLLEXPORT virtual class DateTime *getDateTimeRepresentation(bool &del) const;
88 
90 
94  DLLEXPORT virtual void getDateTimeRepresentation(DateTime &dt) const;
95 
97 
103  DLLEXPORT virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const;
104 
106 
112  DLLEXPORT virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) const;
113 
115 
118  DLLEXPORT virtual class AbstractQoreNode *realCopy() const;
119 
121 
126  DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const;
127 
129 
134  DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const;
135 
137 
140  DLLEXPORT virtual const char *getTypeName() const;
141 
143  DLLLOCAL virtual AbstractQoreNode *parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
144 
146 
149  DLLLOCAL static const char *getStaticTypeName() {
150  return "float";
151  }
152 
154  DLLLOCAL static qore_type_t getStaticTypeCode() {
155  return NT_FLOAT;
156  }
157 
159  DLLLOCAL static double getValue(AbstractQoreNode *v) {
160  return v->getAsFloat();
161  }
162 };
163 
164 #endif