Qore Programming Language  0.8.11
 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, const void* lvalue_id);
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
virtual DLLEXPORT int integerEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as an int
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
decrements the reference count
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
virtual DLLEXPORT bool boolEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as a bool
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
virtual DLLEXPORT double floatEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as a double
virtual DLLEXPORT int getAsString(QoreString &str, int foff, ExceptionSink *xsink) const
concatenate the verbose string representation of the value to an existing QoreString ...
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:42
virtual DLLEXPORT ~ReferenceNode()
frees all memory and destroys the object
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:37
the implementation of Qore's object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:56
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:35
virtual DLLEXPORT int64 bigIntEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as an int64
virtual DLLEXPORT AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
returns the value of the reference; caller owns any reference count returned for non-NULL return valu...
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns a copy of the object