Qore Programming Language  0.8.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ReferenceNode.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  ReferenceNode.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_REFERENCENODE_H
25 
26 #define _QORE_REFERENCENODE_H
27 
28 #include <qore/AbstractQoreNode.h>
29 
31 
38  friend class RuntimeReferenceHelper;
39  friend class lvalue_ref;
40 
41 private:
43  class lvalue_ref* priv;
44 
45  DLLLOCAL ReferenceNode(lvalue_ref* p);
46 
47 protected:
49  DLLEXPORT virtual AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
50 
52  DLLEXPORT virtual AbstractQoreNode *evalImpl(bool &needs_deref, ExceptionSink *xsink) const;
53 
55  DLLEXPORT virtual int64 bigIntEvalImpl(ExceptionSink *xsink) const;
56 
58  DLLEXPORT virtual int integerEvalImpl(ExceptionSink *xsink) const;
59 
61  DLLEXPORT virtual bool boolEvalImpl(ExceptionSink *xsink) const;
62 
64  DLLEXPORT virtual double floatEvalImpl(ExceptionSink *xsink) const;
65 
67  DLLEXPORT virtual ~ReferenceNode();
68 
69 public:
71  DLLLOCAL ReferenceNode(AbstractQoreNode* exp, QoreObject* self);
72 
74 
80  DLLEXPORT virtual int getAsString(QoreString& str, int foff, ExceptionSink* xsink) const;
81 
83 
89  DLLEXPORT virtual QoreString *getAsString(bool& del, int foff, ExceptionSink* xsink) const;
90 
92  DLLEXPORT virtual AbstractQoreNode *realCopy() const;
93 
95  DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink* xsink) const;
96 
98  DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink* xsink) const;
99 
101  DLLEXPORT virtual const char *getTypeName() const;
102 
103  DLLEXPORT virtual bool derefImpl(ExceptionSink* xsink);
104 };
105 
106 #endif