Qore Programming Language  0.8.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreClass.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreClass.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_QORECLASS_H
25 
26 #define _QORE_QORECLASS_H
27 
28 #include <stdarg.h>
29 #include <string>
30 
31 // all qore class IDs
32 DLLEXPORT extern qore_classid_t CID_AUTOGATE;
33 DLLEXPORT extern qore_classid_t CID_AUTOLOCK;
34 DLLEXPORT extern qore_classid_t CID_AUTOREADLOCK;
35 DLLEXPORT extern qore_classid_t CID_AUTOWRITELOCK;
36 DLLEXPORT extern qore_classid_t CID_CONDITION;
37 DLLEXPORT extern qore_classid_t CID_COUNTER;
38 DLLEXPORT extern qore_classid_t CID_DATASOURCE;
39 DLLEXPORT extern qore_classid_t CID_DATASOURCEPOOL;
40 DLLEXPORT extern qore_classid_t CID_FILE;
41 DLLEXPORT extern qore_classid_t CID_FTPCLIENT;
42 DLLEXPORT extern qore_classid_t CID_GATE;
43 DLLEXPORT extern qore_classid_t CID_GETOPT;
44 DLLEXPORT extern qore_classid_t CID_HTTPCLIENT;
45 DLLEXPORT extern qore_classid_t CID_MUTEX;
46 DLLEXPORT extern qore_classid_t CID_PROGRAM;
47 DLLEXPORT extern qore_classid_t CID_QUEUE;
48 DLLEXPORT extern qore_classid_t CID_RWLOCK;
49 DLLEXPORT extern qore_classid_t CID_SSLCERTIFICATE;
50 DLLEXPORT extern qore_classid_t CID_SSLPRIVATEKEY;
51 DLLEXPORT extern qore_classid_t CID_SEQUENCE;
52 DLLEXPORT extern qore_classid_t CID_SOCKET;
53 DLLEXPORT extern qore_classid_t CID_TERMIOS;
54 
55 DLLEXPORT extern QoreClass *QC_QUEUE;
56 DLLEXPORT extern QoreClass *QC_HTTPCLIENT;
57 
58 class BCList;
59 class BCSMList;
60 class BCAList;
61 class QoreObject;
62 class QoreClass;
63 class BCEAList;
64 class ParamList;
65 class QoreMemberInfo;
66 class BuiltinMethod;
67 class AbstractQoreFunctionVariant;
68 class AbstractFunctionSignature;
69 class UserMethod;
70 class BCANode;
71 class qore_method_private;
72 class MethodFunctionBase;
73 class QoreExternalMethodVariant;
74 class QoreExternalStaticMethodVariant;
75 class NamedScope;
76 class ConstantList;
77 class MethodVariantBase;
78 
80 
83 class QoreMethod {
84  friend class StaticMethodCallNode;
85  friend class QoreObject;
86  friend class qore_class_private;
87  friend class qore_method_private;
88  friend class BCList;
89 
90 private:
92  class qore_method_private *priv;
93 
95  DLLLOCAL QoreMethod(const QoreMethod&);
96 
98  DLLLOCAL QoreMethod& operator=(const QoreMethod&);
99 
100 public:
102 
105  DLLEXPORT bool isSynchronized() const;
106 
108 
111  DLLEXPORT bool newCallingConvention() const;
112 
114 
116  DLLEXPORT bool isUser() const;
117 
119 
121  DLLEXPORT bool isBuiltin() const;
122 
124 
126  DLLEXPORT bool isPrivate() const;
127 
129 
132  DLLEXPORT bool isStatic() const;
133 
135 
138  DLLEXPORT const char *getName() const;
139 
141  DLLEXPORT const QoreClass *getClass() const;
142 
144  DLLEXPORT const char *getClassName() const;
145 
147  DLLEXPORT bool existsVariant(const type_vec_t &paramTypeInfo) const;
148 
149  /* returns the return type information for the method if it is available and if
150  there is only one return type (there can be more return types if the method is
151  overloaded)
152  */
153  DLLEXPORT const QoreTypeInfo *getUniqueReturnTypeInfo() const;
154 
155  DLLLOCAL QoreMethod(const QoreClass *p_class, MethodFunctionBase *n_func, bool n_static = false);
156 
157  DLLLOCAL ~QoreMethod();
158  DLLLOCAL bool inMethod(const QoreObject *self) const;
159  DLLLOCAL QoreMethod *copy(const QoreClass *p_class) const;
160  DLLLOCAL void assign_class(const QoreClass *p_class);
161  DLLLOCAL MethodFunctionBase *getFunction() const;
162 
164 
166  DLLLOCAL bool parseIsPrivate() const;
167 
169 
175  DLLLOCAL AbstractQoreNode *eval(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const;
176  DLLLOCAL int64 bigIntEval(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const;
177  DLLLOCAL int intEval(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const;
178  DLLLOCAL bool boolEval(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const;
179  DLLLOCAL double floatEval(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const;
180 
181  DLLLOCAL AbstractQoreNode *evalNormalVariant(QoreObject *self, const QoreExternalMethodVariant *ev, const QoreListNode *args, ExceptionSink *xsink) const;
182  DLLLOCAL int64 bigIntEvalNormalVariant(QoreObject *self, const QoreExternalMethodVariant *ev, const QoreListNode *args, ExceptionSink *xsink) const;
183  DLLLOCAL int intEvalNormalVariant(QoreObject *self, const QoreExternalMethodVariant *ev, const QoreListNode *args, ExceptionSink *xsink) const;
184  DLLLOCAL bool boolEvalNormalVariant(QoreObject *self, const QoreExternalMethodVariant *ev, const QoreListNode *args, ExceptionSink *xsink) const;
185  DLLLOCAL double floatEvalNormalVariant(QoreObject *self, const QoreExternalMethodVariant *ev, const QoreListNode *args, ExceptionSink *xsink) const;
186 };
187 
189 
193 class QoreClass {
194  friend class BCList;
195  friend class BCNode;
196  friend class BCSMList;
197  friend class qore_object_private;
198  friend class qore_class_private;
199  friend class QoreObject;
200  friend class BCANode;
201  friend class qore_method_private;
202  friend class QoreMethodIterator;
203  friend class QoreStaticMethodIterator;
204  friend class ConstructorMethodFunction;
205 
206 private:
208  DLLLOCAL QoreClass& operator=(const QoreClass&);
209 
211  class qore_class_private *priv;
212 
213  // private constructor only called when the class is copied
214  DLLLOCAL QoreClass(qore_classid_t id, const char *nme);
215 
216  DLLLOCAL void insertMethod(QoreMethod *o);
217  DLLLOCAL void insertStaticMethod(QoreMethod *o);
218  DLLLOCAL AbstractQoreNode *evalMethodGate(QoreObject *self, const char *nme, const QoreListNode *args, ExceptionSink *xsink) const;
219  DLLLOCAL const QoreMethod *parseResolveSelfMethodIntern(const char *nme);
220 
222 
231  DLLLOCAL AbstractQoreNode *evalMethod(QoreObject *self, const char *method_name, const QoreListNode *args, ExceptionSink *xsink) const;
232  DLLLOCAL int64 bigIntEvalMethod(QoreObject *self, const char *method_name, const QoreListNode *args, ExceptionSink *xsink) const;
233  DLLLOCAL int intEvalMethod(QoreObject *self, const char *method_name, const QoreListNode *args, ExceptionSink *xsink) const;
234  DLLLOCAL bool boolEvalMethod(QoreObject *self, const char *method_name, const QoreListNode *args, ExceptionSink *xsink) const;
235  DLLLOCAL double floatEvalMethod(QoreObject *self, const char *method_name, const QoreListNode *args, ExceptionSink *xsink) const;
236 
237  // This function must only be called from QoreObject
238  DLLLOCAL AbstractQoreNode *evalMemberGate(QoreObject *self, const QoreString *nme, ExceptionSink *xsink) const;
239  // This function must only be called from QoreObject
240  DLLLOCAL void execMemberNotification(QoreObject *self, const char *mem, ExceptionSink *xsink) const;
241  // This function must only be called from QoreObject and BCList
242  DLLLOCAL bool execDeleteBlocker(QoreObject *self, ExceptionSink *xsink) const;
243  // This function must only be called from QoreObject
244  DLLLOCAL void execDestructor(QoreObject *self, ExceptionSink *xsink) const;
245  // This function is only called from BCList
246  DLLEXPORT const QoreClass *getClassIntern(qore_classid_t cid, bool &priv) const;
247 
248 public:
250 
255  DLLEXPORT QoreClass(const char *n_name, int n_domain = QDOM_DEFAULT);
256 
258 
265  DLLEXPORT QoreClass(const char *n_name, int64 n_domain, const QoreTypeInfo *n_typeInfo);
266 
268 
270  DLLEXPORT QoreClass(const QoreClass &old);
271 
273  DLLEXPORT ~QoreClass();
274 
276 
297  DLLEXPORT void addMethod(const char *n_name, q_method_t meth, bool priv = false);
298 
300  DLLEXPORT void addMethodExtended(const char *n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
301 
303  DLLEXPORT void addMethodExtended(const char *n_name, q_method_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
304 
306  DLLEXPORT void addMethodExtendedList(const char *n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
307 
309  DLLEXPORT void addMethod2(const char *n_name, q_method2_t meth, bool priv = false);
310 
312  DLLEXPORT void addMethodExtended2(const char *n_name, q_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
313 
315  DLLEXPORT void addMethodExtendedList2(const char *n_name, q_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
316 
318 
328  DLLEXPORT void addMethodExtendedList3(const void *ptr, const char *n_name, q_method3_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
329 
331  DLLEXPORT void addMethodExtended3(const char *n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
332 
334  DLLEXPORT void addMethodExtended3(const char *n_name, q_method_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
335 
337  DLLEXPORT void addMethodExtended3(const char *n_name, q_method_bool_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
338 
340  DLLEXPORT void addMethodExtended3(const char *n_name, q_method_double_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
341 
343  DLLEXPORT void addAbstractMethodVariantExtended3(const char *n_name, bool priv = false, int64 n_flags = QC_NO_FLAGS, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
344 
346 
351  DLLEXPORT void addStaticMethod(const char *n_name, q_func_t meth, bool priv = false);
352 
354  DLLEXPORT void addStaticMethodExtended(const char *n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
355 
357  DLLEXPORT void addStaticMethodExtendedList(const char *n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
358 
360  DLLEXPORT void addStaticMethod2(const char *n_name, q_static_method2_t meth, bool priv = false);
361 
363  DLLEXPORT void addStaticMethodExtended2(const char *n_name, q_static_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
364 
366  DLLEXPORT void addStaticMethodExtendedList2(const char *n_name, q_static_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
367 
369 
379  DLLEXPORT void addStaticMethodExtendedList3(const void *ptr, const char *n_name, q_static_method3_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
380 
382  DLLEXPORT void addStaticMethodExtended3(const char *n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
383 
385  DLLEXPORT void addStaticMethodExtended3(const char *n_name, q_func_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
386 
388  DLLEXPORT void addStaticMethodExtended3(const char *n_name, q_func_bool_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
389 
391  DLLEXPORT void addStaticMethodExtended3(const char *n_name, q_func_double_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo = 0, unsigned num_params = 0, ...);
392 
394 
405  DLLEXPORT void setDestructor(q_destructor_t m);
406 
408 
419  DLLEXPORT void setDestructor2(q_destructor2_t m);
420 
422 
434  DLLEXPORT void setDestructor3(const void *ptr, q_destructor3_t m);
435 
437 
440  DLLEXPORT void setConstructor(q_constructor_t m);
441 
443  DLLEXPORT void setConstructorExtended(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
444 
446  DLLEXPORT void setConstructorExtendedList(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
447 
449 
452  DLLEXPORT void setConstructor2(q_constructor2_t m);
453 
455  DLLEXPORT void setConstructorExtended2(q_constructor2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
456 
458  DLLEXPORT void setConstructorExtendedList2(q_constructor2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
459 
461 
469  DLLEXPORT void setConstructorExtendedList3(const void *ptr, q_constructor3_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t &n_typeList = type_vec_t(), const arg_vec_t &defaultArgList = arg_vec_t());
470 
472  DLLEXPORT void setConstructorExtended3(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
473 
475 
479 
481 
485 
487 
498  DLLEXPORT void setCopy(q_copy_t m);
499 
501 
512  DLLEXPORT void setCopy2(q_copy2_t m);
513 
515 
527  DLLEXPORT void setCopy3(const void *ptr, q_copy3_t m);
528 
530 
538  DLLEXPORT void setDeleteBlocker(q_delete_blocker_t m);
539 
541 
545  DLLEXPORT bool isPrivateMember(const char *str) const;
546 
548 
553  DLLEXPORT bool isPublicOrPrivateMember(const char *str, bool &priv) const;
554 
556 
561  DLLEXPORT QoreObject *execConstructor(const QoreListNode *args, ExceptionSink *xsink) const;
562 
564 
568  DLLEXPORT QoreObject *execSystemConstructor(int code = 0, ...) const;
569 
571 
575  DLLEXPORT QoreObject *execCopy(QoreObject *old, ExceptionSink *xsink) const;
576 
578 
583  DLLEXPORT const QoreMethod *findLocalMethod(const char *name) const;
584 
586 
591  DLLEXPORT const QoreMethod *findLocalStaticMethod(const char *name) const;
592 
594 
597  DLLEXPORT QoreListNode *getMethodList() const;
598 
600 
603  DLLEXPORT QoreListNode *getStaticMethodList() const;
604 
606 
614  DLLEXPORT QoreClass *getClass(qore_classid_t cid) const;
615 
617 
624  DLLEXPORT const QoreClass *getClass(qore_classid_t cid, bool &priv) const;
625 
627 
634  DLLEXPORT const QoreClass *getClass(const QoreClass& qc, bool &priv) const;
635 
637  DLLEXPORT int numMethods() const;
638 
640  DLLEXPORT int numStaticMethods() const;
641 
643  DLLEXPORT int numUserMethods() const;
644 
646  DLLEXPORT int numStaticUserMethods() const;
647 
649  DLLEXPORT bool hasCopy() const;
650 
652  DLLEXPORT qore_classid_t getID() const;
653 
655  DLLEXPORT bool isSystem() const;
656 
658  DLLEXPORT bool hasMemberGate() const;
659 
661  DLLEXPORT bool hasMethodGate() const;
662 
664  DLLEXPORT bool hasMemberNotification() const;
665 
667 
669  DLLEXPORT int getDomain() const;
670 
672 
674  DLLEXPORT int64 getDomain64() const;
675 
677  DLLEXPORT const char *getName() const;
678 
680  // used at run-time
681  DLLEXPORT const QoreMethod *findMethod(const char *nme) const;
682 
684  // used at run-time
685  DLLEXPORT const QoreMethod *findStaticMethod(const char *nme) const;
686 
688  DLLEXPORT const QoreMethod *findMethod(const char *nme, bool &priv) const;
689 
691  DLLEXPORT const QoreMethod *findStaticMethod(const char *nme, bool &priv) const;
692 
694 
698  DLLEXPORT void addBuiltinBaseClass(QoreClass *qc, QoreListNode *xargs = 0);
699 
701 
707  DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass *qc, QoreListNode *xargs = 0);
708 
710 
716  DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass *qc);
717 
719 
721  DLLEXPORT void setSynchronousClass();
722 
724 
727  DLLEXPORT const QoreMethod *getConstructor() const;
728 
730 
733  DLLEXPORT const QoreMethod *getSystemConstructor() const;
734 
736 
739  DLLEXPORT const QoreMethod *getDestructor() const;
740 
742 
745  DLLEXPORT const QoreMethod *getCopyMethod() const;
746 
748 
751  DLLEXPORT const QoreMethod *getMemberGateMethod() const;
752 
754 
757  DLLEXPORT const QoreMethod *getMethodGate() const;
758 
760 
763  DLLEXPORT const QoreMethod *getMemberNotificationMethod() const;
764 
766  DLLEXPORT const QoreTypeInfo *getTypeInfo() const;
767 
769  DLLEXPORT const QoreTypeInfo *getOrNothingTypeInfo() const;
770 
772  DLLEXPORT void addPublicMember(const char *mem, const QoreTypeInfo *n_typeInfo, AbstractQoreNode *initial_value = 0);
773 
775  DLLEXPORT void addPrivateMember(const char *mem, const QoreTypeInfo *n_typeInfo, AbstractQoreNode *initial_value = 0);
776 
778  DLLEXPORT void setUserData(const void *ptr);
779 
781  DLLEXPORT const void *getUserData() const;
782 
784  DLLEXPORT void recheckBuiltinMethodHierarchy();
785 
787 
789  DLLEXPORT const QoreExternalMethodVariant *findUserMethodVariant(const char *name, const QoreMethod *&method, const type_vec_t &argTypeList) const;
790 
792 
797  DLLEXPORT void addBuiltinConstant(const char *name, AbstractQoreNode *value, bool priv = false, const QoreTypeInfo *typeInfo = 0);
798 
800 
805  DLLEXPORT void addBuiltinStaticVar(const char *name, AbstractQoreNode *value, bool priv = false, const QoreTypeInfo *typeInfo = 0);
806 
808 
810  DLLEXPORT bool hasAbstract() const;
811 
813  DLLLOCAL QoreClass();
814 
815  // used when parsing, finds committed non-static methods within the entire class hierarchy (local class plus base classes)
816  DLLLOCAL const QoreMethod *parseFindCommittedMethod(const char *nme);
817 
818  // adds public constants to pending list
819  DLLLOCAL void parseAssimilatePublicConstants(ConstantList &cmap);
820  // adds private constants to pending list
821  DLLLOCAL void parseAssimilatePrivateConstants(ConstantList &cmap);
822  // adds a single public constant to pending list
823  DLLLOCAL void parseAddPublicConstant(const std::string &name, AbstractQoreNode *val);
824 
825  // returns 0 for success, -1 for error
826  DLLLOCAL int parseAddBaseClassArgumentList(BCAList *bcal);
827  // only called when parsing, sets the name of the class
828  DLLLOCAL void setName(const char *n);
829 
830  DLLLOCAL qore_classid_t getIDForMethod() const;
831  // get base class list to add virtual class indexes for private data
832  DLLLOCAL BCSMList *getBCSMList() const;
833  // returns true if the class has a delete_blocker function (somewhere in the hierarchy)
834  DLLLOCAL bool has_delete_blocker() const;
835  // looks in current and pending method lists, non-static methods only, no initialization
836  DLLLOCAL const QoreMethod *parseFindLocalMethod(const char *name) const;
837  // looks in current and pending method lists for the entire hierarchy (local class plus base classes), non-static methods only
838  DLLLOCAL const QoreMethod *parseFindMethodTree(const char *name);
839  // looks in current and pending method lists for the entire hierarchy (local class plus base classes), static methods only
840  DLLLOCAL const QoreMethod *parseFindStaticMethodTree(const char *name);
841  // returns true if the class passed is equal to or in the class' hierarchy - to be called only at parse time or under the program's parse lock
842  DLLLOCAL bool parseCheckHierarchy(const QoreClass *cls) const;
843  // checks if the given member can be accessed at parse time
844  DLLLOCAL int parseCheckMemberAccess(const char *mem, const QoreTypeInfo *&memberTypeInfo, int pflag) const;
845  DLLLOCAL bool parseHasPublicMembersInHierarchy() const;
846  DLLLOCAL bool runtimeGetMemberInfo(const char *mem, const QoreTypeInfo *&memberTypeInfo, bool &priv) const;
847  DLLLOCAL bool runtimeHasPublicMembersInHierarchy() const;
848  DLLLOCAL int initMembers(QoreObject *o, ExceptionSink *xsink) const;
849  // returns true if the class has one or more parent classes
850  DLLLOCAL bool hasParentClass() const;
851  DLLLOCAL QoreObject *execConstructor(const AbstractQoreFunctionVariant *variant, const QoreListNode *args, ExceptionSink *xsink) const;
852  DLLLOCAL bool hasPrivateCopyMethod() const;
853  // returns the status including the pending variant (if any)
854  DLLLOCAL bool parseHasPrivateCopyMethod() const;
855  DLLLOCAL const QoreMethod *parseGetConstructor() const;
856  // returns true if the class implements a "methodGate" method, also in pending uncommitted methods
857  DLLLOCAL bool parseHasMethodGate() const;
858  // called when there is an empty public member declaration or a "no_public" declaration
859  DLLLOCAL void parseSetEmptyPublicMemberDeclaration();
860  // unsets the public member flag for builtin classes
861  DLLLOCAL void unsetPublicMemberFlag();
862 };
863 
866 private:
867  void *priv;
868 
869 public:
870  DLLEXPORT QoreMethodIterator(const QoreClass* qc);
871  DLLEXPORT ~QoreMethodIterator();
872  DLLEXPORT bool next();
873  DLLEXPORT const QoreMethod* getMethod() const;
874 };
875 
878 private:
879  void *priv;
880 
881 public:
882  DLLEXPORT QoreStaticMethodIterator(const QoreClass *qc);
883  DLLEXPORT ~QoreStaticMethodIterator();
884  DLLEXPORT bool next();
885  DLLEXPORT const QoreMethod *getMethod() const;
886 };
887 
888 #endif // _QORE_QORECLASS_H