Qore Programming Language - C/C++ Library  1.0.8
QoreClass.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  QoreClass.h
4 
5  Qore Programming Language
6 
7  Copyright (C) 2003 - 2021 Qore Technologies, s.r.o.
8 
9  Permission is hereby granted, free of charge, to any person obtaining a
10  copy of this software and associated documentation files (the "Software"),
11  to deal in the Software without restriction, including without limitation
12  the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  and/or sell copies of the Software, and to permit persons to whom the
14  Software is furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in
17  all copies or substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  DEALINGS IN THE SOFTWARE.
26 
27  Note that the Qore library is released under a choice of three open-source
28  licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
29  information.
30 */
31 
32 #ifndef _QORE_QORECLASS_H
33 
34 #define _QORE_QORECLASS_H
35 
36 #include <cstdarg>
37 #include <memory>
38 #include <string>
39 
40 // all qore class IDs
41 DLLEXPORT extern qore_classid_t CID_AUTOGATE;
42 DLLEXPORT extern qore_classid_t CID_AUTOLOCK;
43 DLLEXPORT extern qore_classid_t CID_AUTOREADLOCK;
44 DLLEXPORT extern qore_classid_t CID_AUTOWRITELOCK;
45 DLLEXPORT extern qore_classid_t CID_CONDITION;
46 DLLEXPORT extern qore_classid_t CID_COUNTER;
47 DLLEXPORT extern qore_classid_t CID_DATASOURCE;
48 DLLEXPORT extern qore_classid_t CID_DATASOURCEPOOL;
49 DLLEXPORT extern qore_classid_t CID_FILE;
50 DLLEXPORT extern qore_classid_t CID_FTPCLIENT;
51 DLLEXPORT extern qore_classid_t CID_GATE;
52 DLLEXPORT extern qore_classid_t CID_GETOPT;
53 DLLEXPORT extern qore_classid_t CID_HTTPCLIENT;
54 DLLEXPORT extern qore_classid_t CID_MUTEX;
55 DLLEXPORT extern qore_classid_t CID_PROGRAM;
56 DLLEXPORT extern qore_classid_t CID_PROGRAMDEBUG;
57 DLLEXPORT extern qore_classid_t CID_QUEUE;
58 DLLEXPORT extern qore_classid_t CID_RWLOCK;
59 DLLEXPORT extern qore_classid_t CID_SSLCERTIFICATE;
60 DLLEXPORT extern qore_classid_t CID_SSLPRIVATEKEY;
61 DLLEXPORT extern qore_classid_t CID_SEQUENCE;
62 DLLEXPORT extern qore_classid_t CID_SOCKET;
63 DLLEXPORT extern qore_classid_t CID_TERMIOS;
64 DLLEXPORT extern qore_classid_t CID_INPUTSTREAM;
65 DLLEXPORT extern qore_classid_t CID_OUTPUTSTREAM;
66 DLLEXPORT extern qore_classid_t CID_INPUTSTREAMBASE;
67 DLLEXPORT extern qore_classid_t CID_OUTPUTSTREAMBASE;
68 DLLEXPORT extern qore_classid_t CID_PROGRAM;
69 DLLEXPORT extern qore_classid_t CID_SERIALIZABLE;
70 
71 DLLEXPORT extern QoreClass* QC_QUEUE;
72 DLLEXPORT extern QoreClass* QC_HTTPCLIENT;
73 DLLEXPORT extern QoreClass* QC_SSLCERTIFICATE;
74 DLLEXPORT extern QoreClass* QC_SSLPRIVATEKEY;
75 DLLEXPORT extern QoreClass* QC_PROGRAM;
76 DLLEXPORT extern QoreClass* QC_SERIALIZABLE;
77 
78 class BCList;
79 class BCSMList;
80 class BCAList;
81 class QoreObject;
82 class QoreClass;
83 class BCEAList;
84 class ParamList;
85 class QoreMemberInfo;
86 class BuiltinMethod;
87 class AbstractQoreFunctionVariant;
88 class AbstractFunctionSignature;
89 class UserMethod;
90 class BCANode;
91 class qore_method_private;
92 class MethodFunctionBase;
93 class NamedScope;
94 class ConstantList;
95 class MethodVariantBase;
96 
102 class QoreExternalMethodFunction;
107 
109 
111 enum method_type_e {
112  MT_None = 0, // not a method function/variant
113  MT_Normal = 1,
114  MT_Static = 2,
115  MT_Constructor = 3,
116  MT_Destructor = 4,
117  MT_Copy = 5,
118  MT_Pseudo = 6,
119 };
120 
122 
125 class QoreMethod {
126  friend class StaticMethodCallNode;
127  friend class QoreObject;
128  friend class qore_class_private;
129  friend class qore_method_private;
130  friend class BCList;
131 
132 private:
134  class qore_method_private* priv;
135 
137  DLLLOCAL QoreMethod(const QoreMethod&);
138 
140  DLLLOCAL QoreMethod& operator=(const QoreMethod&);
141 
142 public:
144 
146  DLLEXPORT bool isUser() const;
147 
149 
151  DLLEXPORT bool isBuiltin() const;
152 
154 
156  DLLEXPORT bool isPrivate() const;
157 
159  DLLEXPORT ClassAccess getAccess() const;
160 
162 
165  DLLEXPORT bool isStatic() const;
166 
168 
171  DLLEXPORT const char* getName() const;
172 
174 
177  DLLEXPORT const std::string& getNameStr() const;
178 
180  DLLEXPORT const QoreClass* getClass() const;
181 
183  DLLEXPORT const char* getClassName() const;
184 
186  DLLEXPORT bool existsVariant(const type_vec_t& paramTypeInfo) const;
187 
188  /* returns the return type information for the method if it is available and if
189  there is only one return type (there can be more return types if the method is
190  overloaded)
191  */
192  DLLEXPORT const QoreTypeInfo* getUniqueReturnTypeInfo() const;
193 
195 
199  DLLEXPORT QoreValue execManaged(QoreObject* self, const QoreListNode* args, ExceptionSink* xsink) const;
200 
202 
204  DLLEXPORT method_type_e getMethodType() const;
205 
207 
209  DLLEXPORT const QoreExternalMethodFunction* getFunction() const;
210 
211  DLLLOCAL QoreMethod(const QoreClass* p_class, MethodFunctionBase* n_func, bool n_static = false);
212 
213  DLLLOCAL bool inMethod(const QoreObject* self) const;
214  DLLLOCAL QoreMethod* copy(const QoreClass* p_class) const;
215  DLLLOCAL void assign_class(const QoreClass* p_class);
216  // non-exported destructor
217  DLLLOCAL ~QoreMethod();
218 };
219 
221 
224 public:
225  DLLEXPORT virtual ~AbstractQoreClassUserData();
226 
228  virtual AbstractQoreClassUserData* copy() const = 0;
229 
231  virtual void doDeref() = 0;
232 };
233 
235 
239 class QoreClass {
240  friend class BCList;
241  friend class BCNode;
242  friend class BCSMList;
243  friend class qore_object_private;
244  friend class qore_class_private;
245  friend class QoreObject;
246  friend class BCANode;
247  friend class qore_method_private;
248  friend class QoreMethodIterator;
249  friend class QoreStaticMethodIterator;
250  friend class ConstructorMethodFunction;
251  friend class QoreBuiltinClass;
252  friend class QoreParseClass;
253 
254 public:
256 
264  DLLEXPORT QoreClass(std::string&& n_name, std::string&& ns_path, int64 n_domain = QDOM_DEFAULT);
265 
267 
275  DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain = QDOM_DEFAULT);
276 
278 
293  DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain, const QoreTypeInfo* n_typeInfo);
294 
296 
298  DLLEXPORT QoreClass(const QoreClass& old);
299 
301 
303  DLLEXPORT virtual QoreClass* copyImport();
304 
306 
308  DLLEXPORT virtual QoreClass* copy();
309 
311 
313  DLLEXPORT QoreProgram* getProgram() const;
314 
316 
345  DLLEXPORT void addMethod(const char* n_name, q_method_n_t meth, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
346 
348 
382  DLLEXPORT void addMethod(const void* ptr, const char* n_name, q_external_method_t meth, ClassAccess access = Public, int64 n_flags = QCF_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(), const name_vec_t& n_names = name_vec_t());
383 
385  DLLEXPORT void addStaticMethod(const char* n_name, q_func_n_t meth, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
386 
388 
390  DLLEXPORT void addStaticMethod(const void* ptr, const char* n_name, q_external_static_method_t meth, ClassAccess access = Public, int64 n_flags = QCF_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(), const name_vec_t& n_names = name_vec_t());
391 
393  DLLEXPORT void addAbstractMethod(const char* n_name, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
394 
396  DLLEXPORT void addAbstractMethod(const char* n_name, ClassAccess access, int64 n_flags, const QoreTypeInfo* returnTypeInfo, const type_vec_t& n_typeList, const arg_vec_t& defaultArgList = arg_vec_t(), const name_vec_t& n_names = name_vec_t());
397 
399 
410  DLLEXPORT void setDestructor(q_destructor_t m);
411 
413 
425  DLLEXPORT void setDestructor(const void* ptr, q_external_destructor_t m);
426 
428  DLLEXPORT void addConstructor(q_constructor_n_t meth, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
429 
431 
433  DLLEXPORT void addConstructor(const void* ptr, q_external_constructor_t meth, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t& n_typeList = type_vec_t(), const arg_vec_t& defaultArgList = arg_vec_t(), const name_vec_t& n_names = name_vec_t());
434 
436 
440 
442 
453  DLLEXPORT void setCopy(q_copy_t m);
454 
456 
468  DLLEXPORT void setCopy(const void* ptr, q_external_copy_t m);
469 
471 
475  DLLEXPORT void setSerializer(q_serializer_t m);
476 
478 
482  DLLEXPORT void setDeserializer(q_deserializer_t m);
483 
485 
487  DLLEXPORT q_serializer_t getSerializer() const;
488 
490 
492  DLLEXPORT q_deserializer_t getDeserializer() const;
493 
495  DLLEXPORT void setFinal();
496 
498 
502  DLLEXPORT bool isPrivateMember(const char* str) const;
503 
505 
510  DLLEXPORT bool isPublicOrPrivateMember(const char* str, bool& priv) const;
511 
513 
519  DLLEXPORT QoreObject* execConstructor(const QoreListNode* args, ExceptionSink* xsink) const;
520 
522 
535  DLLEXPORT QoreObject* execConstructor(const QoreClass& obj_cls, const QoreListNode* args, bool allow_abstract,
536  ExceptionSink* xsink) const;
537 
539 
546  DLLEXPORT QoreObject* execConstructorVariant(const QoreExternalMethodVariant* mv, const QoreListNode *args, ExceptionSink* xsink) const;
547 
549 
553  DLLEXPORT QoreObject* execSystemConstructor(int code = 0, ...) const;
554 
556 
560  DLLEXPORT QoreObject* execCopy(QoreObject* old, ExceptionSink* xsink) const;
561 
563 
566  DLLEXPORT QoreListNode* getMethodList() const;
567 
569 
572  DLLEXPORT QoreListNode* getStaticMethodList() const;
573 
575 
584  DLLEXPORT const QoreClass* getClass(qore_classid_t cid) const;
585 
587 
596  DLLEXPORT const QoreClass* getClass(qore_classid_t cid, bool& priv) const;
597 
599 
608  DLLEXPORT const QoreClass* getClass(const QoreClass& qc, bool& priv) const;
609 
611  DLLEXPORT int numMethods() const;
612 
614  DLLEXPORT int numStaticMethods() const;
615 
617  DLLEXPORT int numUserMethods() const;
618 
620  DLLEXPORT int numStaticUserMethods() const;
621 
623  DLLEXPORT bool hasCopy() const;
624 
626  DLLEXPORT qore_classid_t getID() const;
627 
629  DLLEXPORT bool isSystem() const;
630 
632 
634  DLLEXPORT bool isModulePublic() const;
635 
637 
639  DLLEXPORT bool isAbstract() const;
640 
642 
644  DLLEXPORT bool isFinal() const;
645 
647 
649  DLLEXPORT bool isInjected() const;
650 
652 
654  DLLEXPORT bool isPseudoClass() const;
655 
657 
661  DLLEXPORT QoreClass* getInjectedAsClass();
662 
664 
668  DLLEXPORT const QoreClass* getInjectedAsClass() const;
669 
671 
675  DLLEXPORT qore_type_t getPseudoClassType() const;
676 
678 
682  DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char* nme, const QoreListNode* args, ExceptionSink* xsink) const;
683 
685 
699  DLLEXPORT QoreValue evalPseudoMethod(const QoreMethod* m, const QoreExternalMethodVariant* variant, const QoreValue n, const QoreListNode* args, ExceptionSink* xsink) const;
700 
702  DLLEXPORT void setSystem();
703 
705  DLLEXPORT bool hasMemberGate() const;
706 
708  DLLEXPORT bool hasMethodGate() const;
709 
711  DLLEXPORT bool hasMemberNotification() const;
712 
714 
716  DLLEXPORT int64 getDomain() const;
717 
719  DLLEXPORT const char* getName() const;
720 
722 
726  DLLEXPORT const QoreMethod* findMethod(const char* nme) const;
727 
729 
733  DLLEXPORT const QoreMethod* findStaticMethod(const char* nme) const;
734 
736 
740  DLLEXPORT const QoreMethod* findMethod(const char* nme, ClassAccess& access) const;
741 
743 
747  DLLEXPORT const QoreMethod* findStaticMethod(const char* nme, ClassAccess& access) const;
748 
750 
754  DLLEXPORT const QoreMethod* findLocalMethod(const char* name) const;
755 
757 
761  DLLEXPORT const QoreMethod* findLocalStaticMethod(const char* name) const;
762 
764 
767  DLLEXPORT void addBuiltinBaseClass(QoreClass* qc);
768 
770 
775  DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass* qc);
776 
778 
784  DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass* qc);
785 
787 
792  DLLEXPORT void addBaseClass(QoreClass* qc, bool virt = false);
793 
795 
797  DLLEXPORT void setSynchronousClass();
798 
800 
803  DLLEXPORT const QoreMethod* getConstructor() const;
804 
806 
809  DLLEXPORT const QoreMethod* getSystemConstructor() const;
810 
812 
815  DLLEXPORT const QoreMethod* getDestructor() const;
816 
818 
821  DLLEXPORT const QoreMethod* getCopyMethod() const;
822 
824 
827  DLLEXPORT const QoreMethod* getMemberGateMethod() const;
828 
830 
833  DLLEXPORT const QoreMethod* getMethodGate() const;
834 
836 
839  DLLEXPORT const QoreMethod* getMemberNotificationMethod() const;
840 
842  DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
843 
845  DLLEXPORT const QoreTypeInfo* getOrNothingTypeInfo() const;
846 
848  DLLEXPORT void addMember(const char* mem, ClassAccess access, const QoreTypeInfo* n_typeInfo, QoreValue initial_value = QoreValue());
849 
851 
853  DLLEXPORT void setUserData(const void* ptr);
854 
856 
858  DLLEXPORT const void* getUserData() const;
859 
861 
863  DLLEXPORT void setManagedUserData(AbstractQoreClassUserData* cud);
864 
866 
869 
871 
873  template <typename T>
874  DLLLOCAL T* getManagedUserData() const {
875  return static_cast<T*>(getManagedUserData());
876  }
877 
879  DLLEXPORT void recheckBuiltinMethodHierarchy();
880 
882 
884  DLLEXPORT const QoreExternalMethodVariant* findUserMethodVariant(const char* name, const QoreMethod*& method, const type_vec_t& argTypeList) const;
885 
887 
892  DLLEXPORT void addBuiltinConstant(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
893 
895 
900  DLLEXPORT void addBuiltinStaticVar(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
901 
903 
909  DLLEXPORT void rescanParents();
910 
912 
914  DLLEXPORT void setPublicMemberFlag();
915 
917 
919  DLLEXPORT void setGateAccessFlag();
920 
922 
924  DLLEXPORT void setLanguage(const char* lang);
925 
927 
931  DLLEXPORT const char* getLanguage() const;
932 
934 
938  DLLEXPORT void setRelaxedAbstractMatch();
939 
941 
947  DLLEXPORT bool getRelaxedAbstractMatch() const;
948 
950 
952  DLLEXPORT const QoreExternalNormalMember* findLocalMember(const char* name) const;
953 
955 
957  DLLEXPORT const QoreExternalStaticMember* findLocalStaticMember(const char* name) const;
958 
960 
964  DLLEXPORT std::string getNamespacePath(bool anchored = false) const;
965 
967 
971  DLLEXPORT const char* getPath() const;
972 
974 
976  DLLEXPORT bool isEqual(const QoreClass& cls) const;
977 
979 
981  DLLEXPORT BinaryNode* getBinaryHash() const;
982 
984 
986  DLLEXPORT int runtimeCheckInstantiateClass(ExceptionSink* xsink) const;
987 
989 
991  DLLEXPORT const QoreExternalConstant* findConstant(const char* name) const;
992 
994 
996  DLLEXPORT const QoreNamespace* getNamespace() const;
997 
999 
1001  DLLEXPORT bool inHierarchy(const QoreClass& cls, ClassAccess& n_access) const;
1002 
1004 
1006  DLLEXPORT bool inHierarchyStrict(const QoreClass& cls, ClassAccess& n_access) const;
1007 
1009 
1011  DLLEXPORT bool hasTransientMember() const;
1012 
1014 
1016  DLLEXPORT const char* getModuleName() const;
1017 
1019 
1028  DLLEXPORT QoreValue setKeyValue(const std::string& key, QoreValue val);
1029 
1031 
1042  DLLEXPORT QoreValue setKeyValueIfNotSet(const std::string& key, QoreValue val);
1043 
1045 
1052  DLLEXPORT void setKeyValueIfNotSet(const std::string& key, const char* str);
1053 
1055 
1063  DLLEXPORT QoreValue getReferencedKeyValue(const std::string& key) const;
1064 
1065  // used when parsing, finds committed non-static methods within the entire class hierarchy (local class plus base classes)
1066  DLLLOCAL const QoreMethod* parseFindCommittedMethod(const char* nme);
1067 
1068  // returns 0 for success, -1 for error
1069  DLLLOCAL int parseAddBaseClassArgumentList(BCAList* bcal);
1070  // only called when parsing, sets the name of the class
1071  DLLLOCAL void setName(const char* n);
1072 
1073  DLLLOCAL qore_classid_t getIDForMethod() const;
1074  // get base class list to add virtual class indexes for private data
1075  DLLLOCAL BCSMList* getBCSMList() const;
1076 
1077  DLLLOCAL bool parseHasPublicMembersInHierarchy() const;
1078  DLLLOCAL bool runtimeHasPublicMembersInHierarchy() const;
1079 
1080  // returns true if the class has one or more parent classes
1081  DLLLOCAL bool hasParentClass() const;
1082  DLLLOCAL bool hasPrivateCopyMethod() const;
1083  // returns the status including the pending variant (if any)
1084  DLLLOCAL bool parseHasPrivateCopyMethod() const;
1085  DLLLOCAL const QoreMethod* parseGetConstructor() const;
1086  // returns true if the class implements a "methodGate" method, also in pending uncommitted methods
1087  DLLLOCAL bool parseHasMethodGate() const;
1088  // called when there is an empty public member declaration or a "no_public" declaration
1089  DLLLOCAL void parseSetEmptyPublicMemberDeclaration();
1090  // unsets the public member flag for builtin classes
1091  DLLLOCAL void unsetPublicMemberFlag();
1092 
1093 protected:
1095  DLLEXPORT virtual ~QoreClass();
1096 
1098  DLLEXPORT QoreClass();
1099 
1100 private:
1102  QoreClass& operator=(const QoreClass&) = delete;
1103 
1105  class qore_class_private* priv;
1106 
1107  DLLLOCAL void insertMethod(QoreMethod* o);
1108  DLLLOCAL void insertStaticMethod(QoreMethod* o);
1109  DLLLOCAL QoreValue evalMethodGate(QoreObject* self, const char* nme, const QoreListNode* args, ExceptionSink* xsink) const;
1110  DLLLOCAL const QoreMethod* parseResolveSelfMethodIntern(const char* nme);
1111 
1113 
1124  DLLLOCAL QoreValue evalMethod(QoreObject* self, const char* method_name, const QoreListNode* args, ExceptionSink* xsink) const;
1125 
1126  // This function must only be called from QoreObject
1127  DLLLOCAL void execMemberNotification(QoreObject* self, const char* mem, ExceptionSink* xsink) const;
1128  // This function must only be called from QoreObject
1129  DLLLOCAL void execDestructor(QoreObject* self, ExceptionSink* xsink) const;
1130 };
1131 
1134 private:
1135  void* priv;
1136 
1137 public:
1138  DLLEXPORT QoreMethodIterator(const QoreClass& qc);
1139  DLLEXPORT ~QoreMethodIterator();
1140  DLLEXPORT bool next();
1141  DLLEXPORT const QoreMethod* getMethod() const;
1142 };
1143 
1146 private:
1147  void* priv;
1148 
1149 public:
1150  DLLEXPORT QoreStaticMethodIterator(const QoreClass& qc);
1151  DLLEXPORT ~QoreStaticMethodIterator();
1152  DLLEXPORT bool next();
1153  DLLEXPORT const QoreMethod* getMethod() const;
1154 };
1155 
1157 
1160 public:
1162  DLLLOCAL QoreClassHolder(QoreClass* c) : c(c) {
1163  }
1164 
1166  DLLEXPORT ~QoreClassHolder();
1167 
1169  DLLLOCAL operator QoreClass*() const {
1170  return c;
1171  }
1172 
1174  DLLLOCAL QoreClass* release() {
1175  auto rv = c;
1176  c = 0;
1177  return rv;
1178  }
1179 
1180 private:
1182  QoreClass* c;
1183 };
1184 
1186 class QoreBuiltinClass : public QoreClass {
1187 public:
1189 
1194  DLLEXPORT QoreBuiltinClass(QoreProgram* pgm, const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1195 
1197  DLLEXPORT QoreBuiltinClass(const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1198 
1200  DLLEXPORT QoreBuiltinClass(const QoreBuiltinClass& old);
1201 
1202 protected:
1204  DLLEXPORT QoreBuiltinClass();
1205 };
1206 
1208 
1211 public:
1213  DLLEXPORT QoreParentClassIterator(const QoreClass& cls);
1214 
1216  DLLEXPORT ~QoreParentClassIterator();
1217 
1219  DLLEXPORT bool next();
1220 
1222  DLLEXPORT bool valid() const;
1223 
1225  DLLEXPORT const QoreClass& getParentClass() const;
1226 
1228  DLLEXPORT ClassAccess getAccess() const;
1229 
1230 private:
1231  std::unique_ptr<class qore_parent_class_iterator_private> priv;
1232 };
1233 
1235 
1238 public:
1240  DLLEXPORT QoreClassMemberIterator(const QoreClass& cls);
1241 
1243  DLLEXPORT ~QoreClassMemberIterator();
1244 
1246  DLLEXPORT bool next();
1247 
1249  DLLEXPORT bool valid() const;
1250 
1252  DLLEXPORT const QoreExternalNormalMember& getMember() const;
1253 
1255  DLLEXPORT const char* getName() const;
1256 
1257 private:
1258  std::unique_ptr<class qore_class_member_iterator_private> priv;
1259 };
1260 
1262 
1265 public:
1267  DLLEXPORT QoreClassStaticMemberIterator(const QoreClass& cls);
1268 
1270  DLLEXPORT ~QoreClassStaticMemberIterator();
1271 
1273  DLLEXPORT bool next();
1274 
1276  DLLEXPORT bool valid() const;
1277 
1279  DLLEXPORT const QoreExternalStaticMember& getMember() const;
1280 
1282  DLLEXPORT const char* getName() const;
1283 
1284 private:
1285  std::unique_ptr<class qore_class_static_member_iterator_private> priv;
1286 };
1287 
1289 
1292 public:
1294  DLLEXPORT QoreClassConstantIterator(const QoreClass& cls);
1295 
1297  DLLEXPORT ~QoreClassConstantIterator();
1298 
1300  DLLEXPORT bool next();
1301 
1303  DLLEXPORT bool valid() const;
1304 
1306  DLLEXPORT const QoreExternalConstant& get() const;
1307 
1308 private:
1309  std::unique_ptr<class qore_class_constant_iterator> priv;
1310 };
1311 
1313 
1318 public:
1320  DLLEXPORT QoreClassHierarchyIterator(const QoreClass& cls);
1321 
1323  DLLEXPORT ~QoreClassHierarchyIterator();
1324 
1326  DLLEXPORT bool next();
1327 
1329  DLLEXPORT bool valid() const;
1330 
1332  DLLEXPORT const QoreClass& get() const;
1333 
1335 
1337  DLLEXPORT bool isVirtual() const;
1338 
1339 private:
1340  std::unique_ptr<class qore_class_hierarchy_iterator> priv;
1341 };
1342 
1344 
1349 public:
1351  DLLEXPORT QoreClassDestructorHierarchyIterator(const QoreClass* cls);
1352 
1355 
1357  DLLEXPORT bool next();
1358 
1360  DLLEXPORT bool valid() const;
1361 
1363  DLLEXPORT const QoreClass* get() const;
1364 
1366 
1368  DLLEXPORT bool isVirtual() const;
1369 
1370 private:
1371  class qore_class_destructor_hierarchy_iterator* priv;
1372 };
1373 
1374 DLLEXPORT const char* get_access_string(ClassAccess access);
1375 
1376 #endif // _QORE_QORECLASS_H
DLLEXPORT QoreClassHierarchyIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT bool isPrivate() const
returns true if all overloaded variants of a methods are private or class internal, false if at least one variant is public
DLLEXPORT QoreParentClassIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT void setUserData(const void *ptr)
sets a pointer to user-specific data in the class
DLLEXPORT int runtimeCheckInstantiateClass(ExceptionSink *xsink) const
Throws a Qore-language exception if the class cannot be instantiated.
external wrapper base class for class normal members
Definition: QoreReflection.h:174
void(* q_external_constructor_t)(const QoreMethod &method, const void *ptr, QoreObject *self, const QoreListNode *args, q_rt_flags_t rtflags, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:378
DLLEXPORT void setDestructor(q_destructor_t m)
sets the builtin destructor method for the class
DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass *qc)
sets "virtual" base class for a class, meaning that the base class data is appropriate for use in the...
To be used to iterate through a class&#39;s normal (non-static) methods.
Definition: QoreClass.h:1133
DLLEXPORT QoreValue setKeyValue(const std::string &key, QoreValue val)
Sets a key value in the class&#39;s key-value store unconditionally.
DLLEXPORT ~QoreClassStaticMemberIterator()
destroys the object
external wrapper class for constants
Definition: QoreReflection.h:200
DLLEXPORT const QoreClass * getClass(qore_classid_t cid) const
returns a pointer to the QoreClass object representing the class ID passed if it exists in the class ...
DLLEXPORT bool isBuiltin() const
returns true if all variants of the method are builtin variants
DLLEXPORT QoreObject * execCopy(QoreObject *old, ExceptionSink *xsink) const
executes a class&#39;s "copy" method on an object and returns the new object (or 0 in the case of an exce...
DLLEXPORT QoreClassConstantIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT const QoreNamespace * getNamespace() const
Returns the namespace that owns this class.
DLLEXPORT QoreObject * execSystemConstructor(int code=0,...) const
creates a new "system" object for use as the value of a constant, executes the system constructor on ...
DLLEXPORT bool isPrivateMember(const char *str) const
returns true if the member is private
void(* q_destructor_t)(QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures
Definition: common.h:398
DLLEXPORT QoreValue setKeyValueIfNotSet(const std::string &key, QoreValue val)
Sets a key value in the class&#39;s key-value store only if no value exists for the given key...
DLLEXPORT ~QoreParentClassIterator()
destroys the object
DLLEXPORT void setCopy(q_copy_t m)
sets the builtin copy method for the class
DLLEXPORT bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
DLLEXPORT const QoreExternalStaticMember & getMember() const
returns the member
DLLEXPORT void setSerializer(q_serializer_t m)
sets the serializer method for builtin classes
DLLEXPORT void addStaticMethod(const char *n_name, q_func_n_t meth, ClassAccess access=Public, int64 n_flags=QCF_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin static method with extended information; additional functional domain info...
QoreValue(* q_external_static_method_t)(const QoreMethod &method, const void *ptr, const QoreListNode *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for external static methods
Definition: common.h:358
virtual void doDeref()=0
for non-reference counted classes, deletes the object immediately
DLLEXPORT bool isAbstract() const
returns true if the class has at least one unimplemented abstract method variant
void(* q_system_constructor_t)(QoreObject *self, int code, va_list args)
the type used for builtin QoreClass system constructor method signatures
Definition: common.h:390
DLLEXPORT const QoreMethod * findLocalMethod(const char *name) const
finds a normal (non-static) method in the class hierarchy
an abstract class for class-specific external user data
Definition: QoreClass.h:223
external wrapper base class for class static members
Definition: QoreReflection.h:153
external wrapper class for function and call variants
Definition: QoreReflection.h:38
iterates class constants
Definition: QoreClass.h:1291
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
iterates the class hierarchy in the order of destructor execution
Definition: QoreClass.h:1348
allows for temporary storage of a QoreClass pointer
Definition: QoreClass.h:1159
DLLEXPORT const char * getName() const
returns the method&#39;s name
DLLEXPORT const char * getPath() const
Returns the root-justified namespace path of the class including the class name.
DLLEXPORT bool isPublicOrPrivateMember(const char *str, bool &priv) const
returns true if the member is private or public
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:65
DLLEXPORT void setRelaxedAbstractMatch()
Sets relaxed abstract matching.
DLLEXPORT const QoreExternalStaticMember * findLocalStaticMember(const char *name) const
Finds the given local static member or returns nullptr.
virtual AbstractQoreClassUserData * copy() const =0
for reference-counted classes, returns the same object with the reference count incremented ...
DLLEXPORT int64 getDomain() const
returns the functional domain of the class
DLLLOCAL QoreClass * release()
releases the QoreClass*
Definition: QoreClass.h:1174
DLLEXPORT const QoreMethod * getDestructor() const
returns a const pointer to the QoreMethod object of the constructor method, if any is set ...
DLLEXPORT bool hasMethodGate() const
returns true if the class implements a "methodGate" method
QoreHashNode *(* q_serializer_t)(const QoreObject &self, const AbstractPrivateData &data, QoreSerializationContext &context, ExceptionSink *xsink)
the type used for builtin QoreClass serializer method signatures
Definition: common.h:438
DLLEXPORT QoreValue execManaged(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink) const
evaluates the method and returns the value, does not reference the object for the call ...
DLLEXPORT const QoreMethod * findMethod(const char *nme) const
finds a normal (non-static) method in the class hierarchy
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT const QoreMethod * findStaticMethod(const char *nme) const
finds a static method in the class hierarchy
DLLEXPORT QoreObject * execConstructor(const QoreListNode *args, ExceptionSink *xsink) const
creates a new object and executes the constructor on it and returns the new object ...
DLLEXPORT const QoreTypeInfo * getOrNothingTypeInfo() const
returns the "or nothing" type information structure for this class
DLLEXPORT const char * getModuleName() const
Returns the module name the class was loaded from or nullptr if it is a builtin class.
DLLEXPORT const QoreExternalNormalMember & getMember() const
returns the member
DLLEXPORT int numStaticMethods() const
returns the number of static methods in this class (user and builtin)
DLLEXPORT void setManagedUserData(AbstractQoreClassUserData *cud)
sets a pointer to user-specific data in the class
DLLEXPORT bool isUser() const
returns true if all variants of the method are user variants
To be used to iterate through a class&#39;s static methods.
Definition: QoreClass.h:1145
virtual DLLEXPORT QoreClass * copyImport()
Called when a class is copied for import.
DLLEXPORT const QoreClass * getClass() const
returns a pointer to the parent class
DLLEXPORT int numUserMethods() const
returns the number of non-static user methods in this class
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
iterates the class hierarchy in the order of constructor execution
Definition: QoreClass.h:1317
DLLEXPORT q_serializer_t getSerializer() const
returns the serializer method or nullptr if not present
DLLEXPORT void addMember(const char *mem, ClassAccess access, const QoreTypeInfo *n_typeInfo, QoreValue initial_value=QoreValue())
adds a member
DLLEXPORT bool existsVariant(const type_vec_t &paramTypeInfo) const
returns true if a variant with the given parameter signature already exists in the method ...
virtual DLLEXPORT QoreClass * copy()
Called when a class is copied.
DLLEXPORT QoreListNode * getMethodList() const
returns a list strings of all non-static methods in the class, the caller owns the reference count re...
DLLEXPORT const QoreMethod * getMemberGateMethod() const
returns a const pointer to the QoreMethod object of the memberGate method, if any is set ...
DLLEXPORT const std::string & getNameStr() const
returns the method&#39;s name
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
external wrapper base class for class members
Definition: QoreReflection.h:137
DLLEXPORT BinaryNode * getBinaryHash() const
returns a binary hash for the class&#39;s API
DLLEXPORT QoreObject * execConstructorVariant(const QoreExternalMethodVariant *mv, const QoreListNode *args, ExceptionSink *xsink) const
creates a new object and executes the constructor on it and returns the new object ...
DLLEXPORT const QoreMethod * getConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set ...
DLLEXPORT const QoreMethod * getMemberNotificationMethod() const
returns a const pointer to the QoreMethod object of the memberNotification method, if any is set
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
void(* q_external_copy_t)(const QoreClass &thisclass, const void *ptr, QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures with the new generic calling convention ...
Definition: common.h:428
defines a Qore-language class
Definition: QoreClass.h:239
DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class and ensures that the given class&#39;s private data...
void(* q_external_destructor_t)(const QoreClass &thisclass, const void *ptr, QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures with the new generic calling convention and...
Definition: common.h:408
DLLEXPORT bool isStatic() const
returns true if the method is static
DLLEXPORT QoreClassDestructorHierarchyIterator(const QoreClass *cls)
creates the iterator; call next() to start iterating
DLLEXPORT void setDeserializer(q_deserializer_t m)
sets the deserializer method for builtin classes
DLLEXPORT const char * getName() const
returns the member&#39;s name
DLLEXPORT bool isFinal() const
returns true if the class is final
void(* q_deserializer_t)(QoreObject &self, const QoreHashNode *sdata, QoreDeserializationContext &context, ExceptionSink *xsink)
the type used for builtin QoreClass deserializer method signatures
Definition: common.h:450
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT QoreValue getReferencedKeyValue(const std::string &key) const
Returns a referenced key value from the class&#39;s key-value store.
DLLEXPORT const QoreMethod * getCopyMethod() const
returns a const pointer to the QoreMethod object of the destructor method, if any is set ...
DLLEXPORT const char * getClassName() const
returns the class name for the method
virtual DLLEXPORT ~QoreClass()
Deletes the object and frees all memory.
creates a builtin class
Definition: QoreClass.h:1186
DLLEXPORT bool hasCopy() const
returns true if the class implements a copy method
void(* q_constructor_n_t)(QoreObject *self, const QoreListNode *args, q_rt_flags_t rtflags, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:366
iterates static members of a class
Definition: QoreClass.h:1264
QoreValue(* q_method_n_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures
Definition: common.h:330
DLLEXPORT void setLanguage(const char *lang)
Sets the language for classes imported from another programming language.
DLLEXPORT bool isEqual(const QoreClass &cls) const
returns true if the classes are equal
DLLEXPORT void addMethod(const char *n_name, q_method_n_t meth, ClassAccess access=Public, int64 n_flags=QCF_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin method variant to a class
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:267
DLLEXPORT bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only ...
Definition: QoreProgram.h:127
DLLEXPORT bool hasMemberGate() const
returns true if the class implements a "memberGate" method
DLLEXPORT const QoreMethod * getSystemConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set ...
the implementation of Qore&#39;s object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:60
DLLEXPORT const QoreClass & getParentClass() const
returns the parent class
DLLEXPORT bool getRelaxedAbstractMatch() const
Returns the relaxed abstract matching flag.
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:79
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:54
DLLEXPORT bool hasMemberNotification() const
returns true if the class implements a "memberNotification" method
external wrapper class for method variants
Definition: QoreReflection.h:90
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT const QoreExternalConstant * findConstant(const char *name) const
Finds the given constant or returns nullptr if not found.
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition: common.h:257
DLLEXPORT ClassAccess getAccess() const
returns the lowest access code of all variants in the method
DLLEXPORT std::string getNamespacePath(bool anchored=false) const
returns the full namespace path of the class
DLLEXPORT void recheckBuiltinMethodHierarchy()
rechecks for inherited methods in base classes when adding builtin classes
DLLLOCAL QoreClassHolder(QoreClass *c)
creates the object
Definition: QoreClass.h:1162
DLLEXPORT void addConstructor(q_constructor_n_t meth, ClassAccess access=Public, int64 n_flags=QCF_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, unsigned num_params=0,...)
adds a constructor method variant with the access specifier, additional functional domain info...
DLLEXPORT const QoreExternalMethodFunction * getFunction() const
returns the function for the method
external wrapper class for source code location information
Definition: QoreReflection.h:187
DLLEXPORT bool isModulePublic() const
returns true if the class has its module public flag set
DLLEXPORT method_type_e getMethodType() const
returns the type of method
DLLEXPORT qore_classid_t getID() const
returns the class ID of this class
DLLEXPORT QoreClassMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT void setSystem()
marks the class as a builtin class
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information structure for this class
DLLEXPORT const QoreExternalNormalMember * findLocalMember(const char *name) const
Finds the given local member or returns nullptr.
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260
std::vector< QoreValue > arg_vec_t
vector of value information for default argument lists
Definition: common.h:254
DLLEXPORT const void * getUserData() const
retrieves the user-specific data pointer
DLLEXPORT ~QoreClassMemberIterator()
destroys the object
DLLEXPORT void setGateAccessFlag()
sets the class&#39;s gate access flag so that memberGate() and methodGate() methods will be called with a...
DLLEXPORT const QoreMethod * getMethodGate() const
returns a const pointer to the QoreMethod object of the methodGate method, if any is set ...
DLLEXPORT QoreClass * getInjectedAsClass()
returns the class pointer for any injection target class if this class was injected, otherwise nullptr
DLLEXPORT const QoreExternalMethodVariant * findUserMethodVariant(const char *name, const QoreMethod *&method, const type_vec_t &argTypeList) const
returns the user variant for the given non-static method and argument types
DLLEXPORT void setSynchronousClass()
call this function if your builtin class requires *all* methods (except the constructor) to be run in...
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT int numStaticUserMethods() const
returns the number of static user methods in this class
DLLEXPORT ~QoreClassHolder()
deletes the QoreClass object if still managed
DLLEXPORT void addBuiltinStaticVar(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a static variable to the class
DLLEXPORT QoreProgram * getProgram() const
Returns the owning QoreProgram object (if not the static system namespace)
DLLEXPORT bool isPseudoClass() const
returns true if the class is a pseudo class
DLLEXPORT bool isInjected() const
returns true if the class has been injected as a dependency injection
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode) ...
Definition: common.h:70
DLLEXPORT AbstractQoreClassUserData * getManagedUserData() const
retrieves the user-specific data pointer
DLLEXPORT QoreBuiltinClass()
for use with QoreClass::copyImport()
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char *nme, const QoreListNode *args, ExceptionSink *xsink) const
evaluates a pseudo-method on a pseudo-class
DLLEXPORT int numMethods() const
returns the number of non-static methods in this class (user and builtin)
iterates normal (non-static) members of a class
Definition: QoreClass.h:1237
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT void addBuiltinConstant(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a class constant to the class
DLLEXPORT q_deserializer_t getDeserializer() const
returns the deserializer method or nullptr if not present
DLLEXPORT bool inHierarchy(const QoreClass &cls, ClassAccess &n_access) const
Returns true if the class passed as an argument is present in the current class&#39;s hierachy...
DLLEXPORT bool inHierarchyStrict(const QoreClass &cls, ClassAccess &n_access) const
Returns true if the class passed as an argument is present in the current class&#39;s hierachy...
DLLEXPORT void setPublicMemberFlag()
sets the class&#39;s public member flag so that undeclared member references will fail ...
DLLEXPORT void addBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class
DLLEXPORT const char * getName() const
returns the member&#39;s name
void(* q_copy_t)(QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures
Definition: common.h:417
QoreValue(* q_external_method_t)(const QoreMethod &method, const void *ptr, QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures
Definition: common.h:345
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:251
a method in a QoreClass
Definition: QoreClass.h:125
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT const QoreMethod * findLocalStaticMethod(const char *name) const
finds a static method in the class hierarchy
DLLEXPORT void rescanParents()
rescan builtin parent classes in a class hierarchy; to be used with out-of-order class hierarchy cons...
DLLEXPORT void setFinal()
sets the final flag of the class
DLLEXPORT QoreListNode * getStaticMethodList() const
returns a list strings of all static methods in the class, the caller owns the reference count return...
DLLEXPORT qore_type_t getPseudoClassType() const
returns a pseudo-classes base type
DLLEXPORT ~QoreClassConstantIterator()
destroys the object
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT void setSystemConstructor(q_system_constructor_t m)
sets the builtin constructor for system objects (ex: used as constant values)
DLLEXPORT void addAbstractMethod(const char *n_name, ClassAccess access=Public, int64 n_flags=QCF_NO_FLAGS, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds an unimplemented abstract method variant to the class with extended information; with return and...
DLLEXPORT bool isSystem() const
returns true if the class is a builtin class
DLLEXPORT const char * getName() const
returns the class name
iterates parent classes for a class with inheritance access information
Definition: QoreClass.h:1210
DLLEXPORT bool hasTransientMember() const
Returns true if the class has at least one locally-declared transient member.
DLLEXPORT QoreClassStaticMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreValue(* q_func_n_t)(const QoreListNode *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:307
DLLEXPORT ~QoreClassHierarchyIterator()
destroys the object
DLLEXPORT const char * getLanguage() const
Returns the language this class is written in.
holds arbitrary binary data
Definition: BinaryNode.h:41
DLLEXPORT QoreClass()
For use with QoreClass::copyImport()
DLLEXPORT ClassAccess getAccess() const
returns the access of the parent class
DLLEXPORT void addBaseClass(QoreClass *qc, bool virt=false)
Adds a base class to the current class.
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:159
DLLEXPORT ~QoreClassDestructorHierarchyIterator()
destroys the object