All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ReferenceNode.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
ReferenceNode.h
Qore Programming Language
Copyright (C) 2003 - 2015 David Nichols
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_REFERENCENODE_H
#define _QORE_REFERENCENODE_H
#include <qore/AbstractQoreNode.h>
class ReferenceNode : public AbstractQoreNode {
friend class RuntimeReferenceHelper;
friend class lvalue_ref;
private:
class lvalue_ref* priv;
DLLLOCAL ReferenceNode(lvalue_ref* p);
protected:
DLLEXPORT virtual AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
DLLEXPORT virtual AbstractQoreNode *evalImpl(bool &needs_deref, ExceptionSink *xsink) const;
DLLEXPORT virtual int64 bigIntEvalImpl(ExceptionSink *xsink) const;
DLLEXPORT virtual int integerEvalImpl(ExceptionSink *xsink) const;
DLLEXPORT virtual bool boolEvalImpl(ExceptionSink *xsink) const;
DLLEXPORT virtual double floatEvalImpl(ExceptionSink *xsink) const;
DLLEXPORT virtual ~ReferenceNode();
public:
DLLLOCAL ReferenceNode(AbstractQoreNode* exp, QoreObject* self, const void* lvalue_id);
DLLEXPORT virtual int getAsString(QoreString& str, int foff, ExceptionSink* xsink) const;
DLLEXPORT virtual QoreString *getAsString(bool& del, int foff, ExceptionSink* xsink) const;
DLLEXPORT virtual AbstractQoreNode *realCopy() const;
DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink* xsink) const;
DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink* xsink) const;
DLLEXPORT virtual const char *getTypeName() const;
DLLEXPORT virtual bool derefImpl(ExceptionSink* xsink);
};
#endif
ReferenceNode::integerEvalImpl
virtual DLLEXPORT int integerEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as an int
ReferenceNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
ReferenceNode::derefImpl
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
decrements the reference count
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:55
ReferenceNode::boolEvalImpl
virtual DLLEXPORT bool boolEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as a bool
ReferenceNode::is_equal_soft
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
ReferenceNode::floatEvalImpl
virtual DLLEXPORT double floatEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as a double
ReferenceNode::getAsString
virtual DLLEXPORT int getAsString(QoreString &str, int foff, ExceptionSink *xsink) const
concatenate the verbose string representation of the value to an existing QoreString ...
QoreString
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:82
ReferenceNode::~ReferenceNode
virtual DLLEXPORT ~ReferenceNode()
frees all memory and destroys the object
ReferenceNode
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:45
QoreObject
the implementation of Qore&#39;s object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:64
ExceptionSink
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:43
int64
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:228
ReferenceNode::bigIntEvalImpl
virtual DLLEXPORT int64 bigIntEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as an int64
ReferenceNode::evalImpl
virtual DLLEXPORT AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
returns the value of the reference; caller owns any reference count returned for non-NULL return valu...
ReferenceNode::is_equal_hard
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
ReferenceNode::realCopy
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns a copy of the object