All Classes Namespaces 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 - 2017 Qore Technologies, s.r.o.
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;
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, const QoreTypeInfo* typeInfo, QoreObject* self, const void* lvalue_id, const qore_class_private* cls);
DLLLOCAL ReferenceNode(const ReferenceNode& old);
DLLEXPORT ReferenceNode* refRefSelf() const;
DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
DLLEXPORT const QoreTypeInfo* getLValueTypeInfo() const;
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)
called when the object is deleted
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:54
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 ...
ReferenceNode::getLValueTypeInfo
DLLEXPORT const QoreTypeInfo * getLValueTypeInfo() const
returns the type information for the lvalue referenced
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:62
ExceptionSink
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:47
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:241
ReferenceNode::refRefSelf
DLLEXPORT ReferenceNode * refRefSelf() const
returns a reference to itself
ReferenceNode::ReferenceNode
DLLLOCAL ReferenceNode(AbstractQoreNode *exp, const QoreTypeInfo *typeInfo, QoreObject *self, const void *lvalue_id, const qore_class_private *cls)
creates the ReferenceNode object - internal function, not exported, not part of the Qore API ...
ReferenceNode::bigIntEvalImpl
virtual DLLEXPORT int64 bigIntEvalImpl(ExceptionSink *xsink) const
returns the value of the reference as an int64
ReferenceNode::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information for this object
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