Loading...
Searching...
No Matches
ReferenceNode.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
ReferenceNode.h
Qore Programming Language
Copyright (C) 2003 - 2022 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
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:57
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
QoreObject
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition: QoreObject.h:60
QoreString
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
ReferenceNode
parse type: reference to a lvalue expression
Definition: ReferenceNode.h:45
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
ReferenceNode::evalImpl
virtual DLLEXPORT QoreValue evalImpl(bool &needs_deref, ExceptionSink *xsink) const
returns the value of the reference
ReferenceNode::doEval
DLLEXPORT QoreValue doEval(ExceptionSink *xsink) const
returns the value of the reference
ReferenceNode::refRefSelf
DLLEXPORT ReferenceNode * refRefSelf() const
returns a reference to itself
ReferenceNode::ReferenceNode
DLLLOCAL ReferenceNode(const ReferenceNode &old)
creates a copy of the object
ReferenceNode::realCopy
virtual DLLEXPORT AbstractQoreNode * realCopy() const
returns a copy of the object
ReferenceNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
ReferenceNode::is_equal_soft
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
compares the values
ReferenceNode::getAsString
virtual DLLEXPORT QoreString * getAsString(bool &del, int foff, ExceptionSink *xsink) const
returns a QoreString giving the verbose string representation of the value
ReferenceNode::~ReferenceNode
virtual DLLEXPORT ~ReferenceNode()
frees all memory and destroys the object
ReferenceNode::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information for this object
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
ReferenceNode::derefImpl
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
called when the object is deleted
QoreValue
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:276