Qore Programming Language  0.8.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreNothingNode.h
Go to the documentation of this file.
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreNothingNode.h
4 
5  Qore Programming Language
6 
7  Copyright 2003 - 2013 David Nichols
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23 
24 #ifndef _QORE_QORENOTHINGNODE_H
25 
26 #define _QORE_QORENOTHINGNODE_H
27 
28 #include <qore/AbstractQoreNode.h>
29 
34 
44 protected:
46 
49  DLLLOCAL AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
50 
51 public:
52  DLLEXPORT QoreNothingNode();
53 
54  DLLEXPORT virtual ~QoreNothingNode();
55 
57 
63  DLLEXPORT virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const;
64 
66 
73  DLLEXPORT virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) const;
74 
76 
80  DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const;
81 
83 
87  DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const;
88 
90  DLLEXPORT virtual const char *getTypeName() const;
91 
93  DLLLOCAL virtual AbstractQoreNode *parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo);
94 
96  DLLLOCAL static const char *getStaticTypeName() {
97  return "nothing";
98  }
99 
101  DLLLOCAL static qore_type_t getStaticTypeCode() {
102  return NT_NOTHING;
103  }
104 };
105 
107 DLLEXPORT extern QoreNothingNode Nothing;
108 
110 static inline QoreNothingNode *nothing() {
111  return &Nothing;
112 }
113 
114 #endif
static QoreNothingNode * nothing()
returns a pointer to Nothing
Definition: QoreNothingNode.h:110
static DLLLOCAL const char * getStaticTypeName()
returns the type name (useful in templates)
Definition: QoreNothingNode.h:96
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:47
const qore_type_t NT_NOTHING
type value for QoreNothingNode
Definition: node_types.h:34
DLLLOCAL AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
should never be called for value types
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality with possible type conversion (soft compare)
signed short qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:59
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:42
virtual DLLEXPORT AbstractQoreNode * evalImpl(ExceptionSink *xsink) const
should never be called for value types
DLLEXPORT QoreNothingNode Nothing
the global and unique NOTHING object in Qore
static DLLLOCAL qore_type_t getStaticTypeCode()
returns the type code (useful in templates)
Definition: QoreNothingNode.h:101
this class is for value types that will exists only once in the Qore library, reference counting is d...
Definition: AbstractQoreNode.h:461
virtual DLLLOCAL AbstractQoreNode * parseInit(LocalVar *oflag, int pflag, int &lvids, const QoreTypeInfo *&typeInfo)
returns the type information
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
Qore&#39;s &quot;NOTHING&quot; parse tree/value type, not-referenced counted, not dynamically allocated.
Definition: QoreNothingNode.h:43
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:35
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality without type conversions (hard compare)
virtual DLLEXPORT int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const
concatenate &quot;&lt;NOTHING&gt;&quot; to an existing QoreString