All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreNothingNode.h
Go to the documentation of this file.
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QoreNothingNode.h
Qore Programming Language
Copyright 2003 - 2013 David Nichols
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _QORE_QORENOTHINGNODE_H
#define _QORE_QORENOTHINGNODE_H
#include <qore/AbstractQoreNode.h>
class QoreNothingNode : public UniqueValueQoreNode {
protected:
using SimpleValueQoreNode::evalImpl;
DLLLOCAL AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
public:
DLLEXPORT QoreNothingNode();
DLLEXPORT virtual ~QoreNothingNode();
DLLEXPORT virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const;
DLLEXPORT virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) 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;
DLLLOCAL virtual AbstractQoreNode *parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
DLLLOCAL static const char *getStaticTypeName() {
return "nothing";
}
DLLLOCAL static qore_type_t getStaticTypeCode() {
return NT_NOTHING;
}
};
DLLEXPORT extern QoreNothingNode Nothing;
static inline QoreNothingNode *nothing() {
return &Nothing;
}
#endif
nothing
static QoreNothingNode * nothing()
returns a pointer to Nothing
Definition: QoreNothingNode.h:110
QoreNothingNode::getStaticTypeName
static DLLLOCAL const char * getStaticTypeName()
returns the type name (useful in templates)
Definition: QoreNothingNode.h:96
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
NT_NOTHING
const qore_type_t NT_NOTHING
type value for QoreNothingNode
Definition: node_types.h:34
QoreNothingNode::evalImpl
DLLLOCAL AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
should never be called for value types
QoreNothingNode::is_equal_soft
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality with possible type conversion (soft compare)
qore_type_t
signed short qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:59
QoreString
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:42
SimpleValueQoreNode::evalImpl
virtual DLLEXPORT AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
should never be called for value types
Nothing
DLLEXPORT QoreNothingNode Nothing
the global and unique NOTHING object in Qore
QoreNothingNode::getStaticTypeCode
static DLLLOCAL qore_type_t getStaticTypeCode()
returns the type code (useful in templates)
Definition: QoreNothingNode.h:101
UniqueValueQoreNode
this class is for value types that will exists only once in the Qore library, reference counting is d...
Definition: AbstractQoreNode.h:461
QoreNothingNode::parseInit
virtual DLLLOCAL AbstractQoreNode * parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
returns the type information
QoreNothingNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
QoreNothingNode
Qore&#39;s &quot;NOTHING&quot; parse tree/value type, not-referenced counted, not dynamically allocated.
Definition: QoreNothingNode.h:43
ExceptionSink
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:35
QoreNothingNode::is_equal_hard
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality without type conversions (hard compare)
QoreNothingNode::getAsString
virtual DLLEXPORT int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const
concatenate &quot;&lt;NOTHING&gt;&quot; to an existing QoreString