ReferenceNode.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
ReferenceNode.h
Qore Programming Language
Copyright (C) 2003 - 2018 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 QoreValue evalImpl(bool& needs_deref, ExceptionSink* xsink) const;
DLLEXPORT QoreValue doEval(ExceptionSink* xsink) const;
DLLEXPORT virtual ~ReferenceNode();
public:
DLLLOCAL ReferenceNode(QoreValue 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::realCopy
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns a copy of the object
ReferenceNode::is_equal_soft
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
ReferenceNode::derefImpl
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
called when the object is deleted
ReferenceNode::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information for this object
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:54
ReferenceNode::evalImpl
virtual DLLEXPORT QoreValue evalImpl(bool &needs_deref, ExceptionSink *xsink) const
returns the value of the reference
QoreString
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:81
ReferenceNode::getLValueTypeInfo
DLLEXPORT const QoreTypeInfo * getLValueTypeInfo() const
returns the type information for the lvalue referenced
ReferenceNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
ReferenceNode::~ReferenceNode
virtual DLLEXPORT ~ReferenceNode()
frees all memory and destroys the object
ReferenceNode
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:45
ReferenceNode::refRefSelf
DLLEXPORT ReferenceNode * refRefSelf() const
returns a reference to itself
QoreValue
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:262
QoreObject
the implementation of Qore&#39;s object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:61
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 ...
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
ReferenceNode::doEval
DLLEXPORT QoreValue doEval(ExceptionSink *xsink) const
returns the value of the reference
ReferenceNode::ReferenceNode
DLLLOCAL ReferenceNode(QoreValue 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::is_equal_hard
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values