Qore Programming Language  0.8.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreTypeSafeReferenceHelper.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreTypeSafeReferenceHelper.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_QORETYPESAFEREFERENCEHELPER_H
25 
26 #define _QORE_QORETYPESAFEREFERENCEHELPER_H
27 
29 
50 private:
53 
55  DLLLOCAL QoreTypeSafeReferenceHelper& operator=(const QoreTypeSafeReferenceHelper&);
56 
58  DLLLOCAL void *operator new(size_t);
59 
61  struct qore_type_safe_ref_helper_priv_t *priv;
62 
63 public:
65 
68  DLLEXPORT QoreTypeSafeReferenceHelper(const ReferenceNode *ref, ExceptionSink *xsink);
69 
71 
77  DLLEXPORT QoreTypeSafeReferenceHelper(const ReferenceNode *ref, AutoVLock &vl, ExceptionSink *xsink);
78 
80  DLLEXPORT ~QoreTypeSafeReferenceHelper();
81 
83 
85  DLLEXPORT operator bool() const;
86 
88 
90  DLLEXPORT qore_type_t getType() const;
91 
93 
95  DLLEXPORT const char* getTypeName() const;
96 
98 
114  DLLEXPORT AbstractQoreNode *getUnique(ExceptionSink *xsink);
115 
117 
129  DLLEXPORT int assign(AbstractQoreNode *val);
130 
132 
147  DLLEXPORT int assign(AbstractQoreNode *val, ExceptionSink *xsink);
148 
150 
153  DLLEXPORT int assignBigInt(int64 v);
154 
156 
159  DLLEXPORT int assignFloat(double v);
160 
162 
164  DLLEXPORT const AbstractQoreNode *getValue() const;
165 
167  DLLEXPORT void swap(QoreTypeSafeReferenceHelper &other);
168 };
169 
170 #ifndef _QORE_LIB_INTERN
172 #endif
173 
174 #endif