| Qore Programming Language - C/C++ Library 1.12.2

QoreClass.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3 QoreClass.h
4
5 Qore Programming Language
6
7 Copyright (C) 2003 - 2022 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 DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLABLEIOOBJECT;
71 DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLABLEIOOBJECTBASE;
72 DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLOPERATION;
73 DLLEXPORT extern qore_classid_t CID_SOCKETPOLLOPERATIONBASE;
74 DLLEXPORT extern qore_classid_t CID_SOCKETPOLLOPERATION;
75
76 DLLEXPORT extern QoreClass* QC_QUEUE;
77 DLLEXPORT extern QoreClass* QC_HTTPCLIENT;
78 DLLEXPORT extern QoreClass* QC_SSLCERTIFICATE;
79 DLLEXPORT extern QoreClass* QC_SSLPRIVATEKEY;
80 DLLEXPORT extern QoreClass* QC_PROGRAM;
81 DLLEXPORT extern QoreClass* QC_SERIALIZABLE;
82 DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLABLEIOOBJECT;
83 DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLABLEIOOBJECTBASE;
84 DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLOPERATION;
85 DLLEXPORT extern QoreClass* QC_SOCKETPOLLOPERATIONBASE;
86 DLLEXPORT extern QoreClass* QC_SOCKETPOLLOPERATION;
87
88 class BCList;
89 class BCSMList;
90 class BCAList;
91 class QoreObject;
92 class QoreClass;
93 class BCEAList;
94 class ParamList;
95 class QoreMemberInfo;
96 class BuiltinMethod;
97 class AbstractQoreFunctionVariant;
98 class AbstractFunctionSignature;
99 class UserMethod;
100 class BCANode;
101 class qore_method_private;
102 class MethodFunctionBase;
103 class NamedScope;
104 class ConstantList;
105 class MethodVariantBase;
106
107 class QoreExternalVariant;
108 class QoreExternalMethodVariant;
109 class QoreExternalNormalMember;
110 class QoreExternalStaticMember;
111 class QoreExternalProgramLocation;
112 class QoreExternalMethodFunction;
113 class QoreExternalMemberVarBase;
114 class QoreExternalStaticMember;
115 class QoreExternalNormalMember;
116 class QoreExternalConstant;
117
119
121 enum method_type_e {
122 MT_None = 0, // not a method function/variant
123 MT_Normal = 1,
124 MT_Static = 2,
125 MT_Constructor = 3,
126 MT_Destructor = 4,
127 MT_Copy = 5,
128 MT_Pseudo = 6,
129 };
130
132
135 class QoreMethod {
136 friend class StaticMethodCallNode;
137 friend class QoreObject;
138 friend class qore_class_private;
139 friend class qore_method_private;
140 friend class BCList;
141
142 private:
144 class qore_method_private* priv;
145
147 DLLLOCAL QoreMethod(const QoreMethod&);
148
150 DLLLOCAL QoreMethod& operator=(const QoreMethod&);
151
152 public:
154
156 DLLEXPORT bool isUser() const;
157
159
161 DLLEXPORT bool isBuiltin() const;
162
164
166 DLLEXPORT bool isPrivate() const;
167
169 DLLEXPORT ClassAccess getAccess() const;
170
172
175 DLLEXPORT bool isStatic() const;
176
178
181 DLLEXPORT const char* getName() const;
182
184
187 DLLEXPORT const std::string& getNameStr() const;
188
190 DLLEXPORT const QoreClass* getClass() const;
191
193 DLLEXPORT const char* getClassName() const;
194
196 DLLEXPORT bool existsVariant(const type_vec_t& paramTypeInfo) const;
197
198 /* returns the return type information for the method if it is available and if
199 there is only one return type (there can be more return types if the method is
200 overloaded)
201 */
202 DLLEXPORT const QoreTypeInfo* getUniqueReturnTypeInfo() const;
203
205
209 DLLEXPORT QoreValue execManaged(QoreObject* self, const QoreListNode* args, ExceptionSink* xsink) const;
210
212
214 DLLEXPORT method_type_e getMethodType() const;
215
217
219 DLLEXPORT const QoreExternalMethodFunction* getFunction() const;
220
221 DLLLOCAL QoreMethod(const QoreClass* p_class, MethodFunctionBase* n_func, bool n_static = false);
222
223 DLLLOCAL bool inMethod(const QoreObject* self) const;
224 DLLLOCAL QoreMethod* copy(const QoreClass* p_class) const;
225 DLLLOCAL void assign_class(const QoreClass* p_class);
226 // non-exported destructor
227 DLLLOCAL ~QoreMethod();
228 };
229
231
233 class AbstractQoreClassUserData {
234 public:
235 DLLEXPORT virtual ~AbstractQoreClassUserData();
236
238 virtual AbstractQoreClassUserData* copy() const = 0;
239
241 virtual void doDeref() = 0;
242 };
243
245
249 class QoreClass {
250 friend class BCList;
251 friend class BCNode;
252 friend class BCSMList;
253 friend class qore_object_private;
254 friend class qore_class_private;
255 friend class QoreObject;
256 friend class BCANode;
257 friend class qore_method_private;
258 friend class QoreMethodIterator;
259 friend class QoreStaticMethodIterator;
260 friend class ConstructorMethodFunction;
261 friend class QoreBuiltinClass;
262 friend class QoreParseClass;
263
264 public:
266
274 DLLEXPORT QoreClass(std::string&& n_name, std::string&& ns_path, int64 n_domain = QDOM_DEFAULT);
275
277
285 DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain = QDOM_DEFAULT);
286
288
303 DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain, const QoreTypeInfo* n_typeInfo);
304
306
308 DLLEXPORT QoreClass(const QoreClass& old);
309
311
313 DLLEXPORT virtual QoreClass* copyImport();
314
316
318 DLLEXPORT virtual QoreClass* copy();
319
321
323 DLLEXPORT QoreProgram* getProgram() const;
324
326
355 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, ...);
356
358
392 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());
393
395 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, ...);
396
398
400 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());
401
403 DLLEXPORT void addAbstractMethod(const char* n_name, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
404
406 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());
407
409
420 DLLEXPORT void setDestructor(q_destructor_t m);
421
423
435 DLLEXPORT void setDestructor(const void* ptr, q_external_destructor_t m);
436
438 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, ...);
439
441
443 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());
444
446
449 DLLEXPORT void setSystemConstructor(q_system_constructor_t m);
450
452
463 DLLEXPORT void setCopy(q_copy_t m);
464
466
478 DLLEXPORT void setCopy(const void* ptr, q_external_copy_t m);
479
481
485 DLLEXPORT void setSerializer(q_serializer_t m);
486
488
492 DLLEXPORT void setDeserializer(q_deserializer_t m);
493
495
497 DLLEXPORT q_serializer_t getSerializer() const;
498
500
502 DLLEXPORT q_deserializer_t getDeserializer() const;
503
505 DLLEXPORT void setFinal();
506
508
512 DLLEXPORT bool isPrivateMember(const char* str) const;
513
515
520 DLLEXPORT bool isPublicOrPrivateMember(const char* str, bool& priv) const;
521
523
529 DLLEXPORT QoreObject* execConstructor(const QoreListNode* args, ExceptionSink* xsink) const;
530
532
545 DLLEXPORT QoreObject* execConstructor(const QoreClass& obj_cls, const QoreListNode* args, bool allow_abstract,
546 ExceptionSink* xsink) const;
547
549
556 DLLEXPORT QoreObject* execConstructorVariant(const QoreExternalMethodVariant* mv, const QoreListNode *args, ExceptionSink* xsink) const;
557
559
563 DLLEXPORT QoreObject* execSystemConstructor(int code = 0, ...) const;
564
566
570 DLLEXPORT QoreObject* execCopy(QoreObject* old, ExceptionSink* xsink) const;
571
573
576 DLLEXPORT QoreListNode* getMethodList() const;
577
579
582 DLLEXPORT QoreListNode* getStaticMethodList() const;
583
585
594 DLLEXPORT const QoreClass* getClass(qore_classid_t cid) const;
595
597
606 DLLEXPORT const QoreClass* getClass(qore_classid_t cid, bool& priv) const;
607
609
618 DLLEXPORT const QoreClass* getClass(const QoreClass& qc, bool& priv) const;
619
621 DLLEXPORT int numMethods() const;
622
624 DLLEXPORT int numStaticMethods() const;
625
627 DLLEXPORT int numUserMethods() const;
628
630 DLLEXPORT int numStaticUserMethods() const;
631
633 DLLEXPORT bool hasCopy() const;
634
636 DLLEXPORT qore_classid_t getID() const;
637
639 DLLEXPORT bool isSystem() const;
640
642
644 DLLEXPORT bool isModulePublic() const;
645
647
649 DLLEXPORT bool isAbstract() const;
650
652
654 DLLEXPORT bool isFinal() const;
655
657
659 DLLEXPORT bool isInjected() const;
660
662
664 DLLEXPORT bool isPseudoClass() const;
665
667
671 DLLEXPORT QoreClass* getInjectedAsClass();
672
674
678 DLLEXPORT const QoreClass* getInjectedAsClass() const;
679
681
685 DLLEXPORT qore_type_t getPseudoClassType() const;
686
688
692 DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char* nme, const QoreListNode* args, ExceptionSink* xsink) const;
693
695
709 DLLEXPORT QoreValue evalPseudoMethod(const QoreMethod* m, const QoreExternalMethodVariant* variant, const QoreValue n, const QoreListNode* args, ExceptionSink* xsink) const;
710
712 DLLEXPORT void setSystem();
713
715 DLLEXPORT bool hasMemberGate() const;
716
718 DLLEXPORT bool hasMethodGate() const;
719
721 DLLEXPORT bool hasMemberNotification() const;
722
724
726 DLLEXPORT int64 getDomain() const;
727
729 DLLEXPORT const char* getName() const;
730
732
736 DLLEXPORT const QoreMethod* findMethod(const char* nme) const;
737
739
743 DLLEXPORT const QoreMethod* findStaticMethod(const char* nme) const;
744
746
750 DLLEXPORT const QoreMethod* findMethod(const char* nme, ClassAccess& access) const;
751
753
757 DLLEXPORT const QoreMethod* findStaticMethod(const char* nme, ClassAccess& access) const;
758
760
764 DLLEXPORT const QoreMethod* findLocalMethod(const char* name) const;
765
767
771 DLLEXPORT const QoreMethod* findLocalStaticMethod(const char* name) const;
772
774
777 DLLEXPORT void addBuiltinBaseClass(QoreClass* qc);
778
780
784 DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass* qc);
785
787
793 DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass* qc);
794
796
801 DLLEXPORT void addBaseClass(QoreClass* qc, bool virt = false);
802
804
806 DLLEXPORT void setSynchronousClass();
807
809
812 DLLEXPORT const QoreMethod* getConstructor() const;
813
815
818 DLLEXPORT const QoreMethod* getSystemConstructor() const;
819
821
824 DLLEXPORT const QoreMethod* getDestructor() const;
825
827
830 DLLEXPORT const QoreMethod* getCopyMethod() const;
831
833
836 DLLEXPORT const QoreMethod* getMemberGateMethod() const;
837
839
842 DLLEXPORT const QoreMethod* getMethodGate() const;
843
845
848 DLLEXPORT const QoreMethod* getMemberNotificationMethod() const;
849
851 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
852
854 DLLEXPORT const QoreTypeInfo* getOrNothingTypeInfo() const;
855
857 DLLEXPORT void addMember(const char* mem, ClassAccess access, const QoreTypeInfo* n_typeInfo, QoreValue initial_value = QoreValue());
858
860
862 DLLEXPORT void setUserData(const void* ptr);
863
865
867 DLLEXPORT const void* getUserData() const;
868
870
872 DLLEXPORT void setManagedUserData(AbstractQoreClassUserData* cud);
873
875
877 DLLEXPORT AbstractQoreClassUserData* getManagedUserData() const;
878
880
882 template <typename T>
883 DLLLOCAL T* getManagedUserData() const {
884 return static_cast<T*>(getManagedUserData());
885 }
886
888 DLLEXPORT void recheckBuiltinMethodHierarchy();
889
891
893 DLLEXPORT const QoreExternalMethodVariant* findUserMethodVariant(const char* name, const QoreMethod*& method, const type_vec_t& argTypeList) const;
894
896
901 DLLEXPORT void addBuiltinConstant(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
902
904
909 DLLEXPORT void addBuiltinStaticVar(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
910
912
918 DLLEXPORT void rescanParents();
919
921
923 DLLEXPORT void setPublicMemberFlag();
924
926
928 DLLEXPORT void setGateAccessFlag();
929
931
933 DLLEXPORT void setLanguage(const char* lang);
934
936
940 DLLEXPORT const char* getLanguage() const;
941
943
947 DLLEXPORT void setRelaxedAbstractMatch();
948
950
956 DLLEXPORT bool getRelaxedAbstractMatch() const;
957
959
961 DLLEXPORT const QoreExternalNormalMember* findLocalMember(const char* name) const;
962
964
966 DLLEXPORT const QoreExternalStaticMember* findLocalStaticMember(const char* name) const;
967
969
973 DLLEXPORT std::string getNamespacePath(bool anchored = false) const;
974
976
980 DLLEXPORT const char* getPath() const;
981
983
985 DLLEXPORT bool isEqual(const QoreClass& cls) const;
986
988
990 DLLEXPORT BinaryNode* getBinaryHash() const;
991
993
995 DLLEXPORT int runtimeCheckInstantiateClass(ExceptionSink* xsink) const;
996
998
1000 DLLEXPORT const QoreExternalConstant* findConstant(const char* name) const;
1001
1003
1005 DLLEXPORT const QoreNamespace* getNamespace() const;
1006
1008
1010 DLLEXPORT bool inHierarchy(const QoreClass& cls, ClassAccess& n_access) const;
1011
1013
1015 DLLEXPORT bool inHierarchyStrict(const QoreClass& cls, ClassAccess& n_access) const;
1016
1018
1020 DLLEXPORT bool hasTransientMember() const;
1021
1023
1025 DLLEXPORT const char* getModuleName() const;
1026
1028
1037 DLLEXPORT QoreValue setKeyValue(const std::string& key, QoreValue val);
1038
1040
1051 DLLEXPORT QoreValue setKeyValueIfNotSet(const std::string& key, QoreValue val);
1052
1054
1063 DLLEXPORT bool setKeyValueIfNotSet(const std::string& key, const char* str);
1064
1066
1074 DLLEXPORT QoreValue getReferencedKeyValue(const std::string& key) const;
1075
1077
1085 DLLEXPORT QoreValue getReferencedKeyValue(const char* key) const;
1086
1088 DLLEXPORT bool hasParentClass() const;
1089
1091 DLLEXPORT bool hasPublicMembersInHierarchy() const;
1092
1093 protected:
1095 DLLEXPORT virtual ~QoreClass();
1096
1098 DLLEXPORT QoreClass();
1099
1100 private:
1101 QoreClass& operator=(const QoreClass&) = delete;
1102
1104 class qore_class_private* priv;
1105 };
1106
1108 class QoreMethodIterator {
1109 private:
1110 void* priv;
1111
1112 public:
1113 DLLEXPORT QoreMethodIterator(const QoreClass& qc);
1114 DLLEXPORT ~QoreMethodIterator();
1115 DLLEXPORT bool next();
1116 DLLEXPORT const QoreMethod* getMethod() const;
1117 };
1118
1120 class QoreStaticMethodIterator {
1121 private:
1122 void* priv;
1123
1124 public:
1125 DLLEXPORT QoreStaticMethodIterator(const QoreClass& qc);
1126 DLLEXPORT ~QoreStaticMethodIterator();
1127 DLLEXPORT bool next();
1128 DLLEXPORT const QoreMethod* getMethod() const;
1129 };
1130
1132
1134 class QoreClassHolder {
1135 public:
1137 DLLLOCAL QoreClassHolder(QoreClass* c) : c(c) {
1138 }
1139
1141 DLLEXPORT ~QoreClassHolder();
1142
1144 DLLLOCAL operator QoreClass*() const {
1145 return c;
1146 }
1147
1149 DLLLOCAL QoreClass* release() {
1150 auto rv = c;
1151 c = 0;
1152 return rv;
1153 }
1154
1155 private:
1157 QoreClass* c;
1158 };
1159
1161 class QoreBuiltinClass : public QoreClass {
1162 public:
1164
1169 DLLEXPORT QoreBuiltinClass(QoreProgram* pgm, const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1170
1172 DLLEXPORT QoreBuiltinClass(const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1173
1175 DLLEXPORT QoreBuiltinClass(const QoreBuiltinClass& old);
1176
1177 protected:
1179 DLLEXPORT QoreBuiltinClass();
1180 };
1181
1183
1185 class QoreParentClassIterator final {
1186 public:
1188 DLLEXPORT QoreParentClassIterator(const QoreClass& cls);
1189
1191 DLLEXPORT ~QoreParentClassIterator();
1192
1194 DLLEXPORT bool next();
1195
1197 DLLEXPORT bool valid() const;
1198
1200 DLLEXPORT const QoreClass& getParentClass() const;
1201
1203 DLLEXPORT ClassAccess getAccess() const;
1204
1205 private:
1206 std::unique_ptr<class qore_parent_class_iterator_private> priv;
1207 };
1208
1210
1212 class QoreClassMemberIterator final {
1213 public:
1215 DLLEXPORT QoreClassMemberIterator(const QoreClass& cls);
1216
1218 DLLEXPORT ~QoreClassMemberIterator();
1219
1221 DLLEXPORT bool next();
1222
1224 DLLEXPORT bool valid() const;
1225
1227 DLLEXPORT const QoreExternalNormalMember& getMember() const;
1228
1230 DLLEXPORT const char* getName() const;
1231
1232 private:
1233 std::unique_ptr<class qore_class_member_iterator_private> priv;
1234 };
1235
1237
1239 class QoreClassStaticMemberIterator final {
1240 public:
1242 DLLEXPORT QoreClassStaticMemberIterator(const QoreClass& cls);
1243
1245 DLLEXPORT ~QoreClassStaticMemberIterator();
1246
1248 DLLEXPORT bool next();
1249
1251 DLLEXPORT bool valid() const;
1252
1254 DLLEXPORT const QoreExternalStaticMember& getMember() const;
1255
1257 DLLEXPORT const char* getName() const;
1258
1259 private:
1260 std::unique_ptr<class qore_class_static_member_iterator_private> priv;
1261 };
1262
1264
1266 class QoreClassConstantIterator final {
1267 public:
1269 DLLEXPORT QoreClassConstantIterator(const QoreClass& cls);
1270
1272 DLLEXPORT ~QoreClassConstantIterator();
1273
1275 DLLEXPORT bool next();
1276
1278 DLLEXPORT bool valid() const;
1279
1281 DLLEXPORT const QoreExternalConstant& get() const;
1282
1283 private:
1284 std::unique_ptr<class qore_class_constant_iterator> priv;
1285 };
1286
1288
1292 class QoreClassHierarchyIterator final {
1293 public:
1295 DLLEXPORT QoreClassHierarchyIterator(const QoreClass& cls);
1296
1298 DLLEXPORT ~QoreClassHierarchyIterator();
1299
1301 DLLEXPORT bool next();
1302
1304 DLLEXPORT bool valid() const;
1305
1307 DLLEXPORT const QoreClass& get() const;
1308
1310
1312 DLLEXPORT bool isVirtual() const;
1313
1314 private:
1315 std::unique_ptr<class qore_class_hierarchy_iterator> priv;
1316 };
1317
1319
1323 class QoreClassDestructorHierarchyIterator {
1324 public:
1326 DLLEXPORT QoreClassDestructorHierarchyIterator(const QoreClass* cls);
1327
1329 DLLEXPORT ~QoreClassDestructorHierarchyIterator();
1330
1332 DLLEXPORT bool next();
1333
1335 DLLEXPORT bool valid() const;
1336
1338 DLLEXPORT const QoreClass* get() const;
1339
1341
1343 DLLEXPORT bool isVirtual() const;
1344
1345 private:
1346 class qore_class_destructor_hierarchy_iterator* priv;
1347 };
1348
1349 DLLEXPORT const char* get_access_string(ClassAccess access);
1350
1351 #endif // _QORE_QORECLASS_H
QDOM_DEFAULT
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:159
AbstractQoreClassUserData
an abstract class for class-specific external user data
Definition: QoreClass.h:233
AbstractQoreClassUserData::copy
virtual AbstractQoreClassUserData * copy() const =0
for reference-counted classes, returns the same object with the reference count incremented
AbstractQoreClassUserData::doDeref
virtual void doDeref()=0
for non-reference counted classes, deletes the object immediately
BinaryNode
holds arbitrary binary data
Definition: BinaryNode.h:41
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
QoreBuiltinClass
creates a builtin class
Definition: QoreClass.h:1161
QoreBuiltinClass::QoreBuiltinClass
DLLEXPORT QoreBuiltinClass()
for use with QoreClass::copyImport()
QoreClassConstantIterator
iterates class constants
Definition: QoreClass.h:1266
QoreClassConstantIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreClassConstantIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreClassConstantIterator::QoreClassConstantIterator
DLLEXPORT QoreClassConstantIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreClassConstantIterator::get
DLLEXPORT const QoreExternalConstant & get() const
returns the
QoreClassConstantIterator::~QoreClassConstantIterator
DLLEXPORT ~QoreClassConstantIterator()
destroys the object
QoreClassDestructorHierarchyIterator
iterates the class hierarchy in the order of destructor execution
Definition: QoreClass.h:1323
QoreClassDestructorHierarchyIterator::~QoreClassDestructorHierarchyIterator
DLLEXPORT ~QoreClassDestructorHierarchyIterator()
destroys the object
QoreClassDestructorHierarchyIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreClassDestructorHierarchyIterator::isVirtual
DLLEXPORT bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
QoreClassDestructorHierarchyIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreClassDestructorHierarchyIterator::get
DLLEXPORT const QoreClass * get() const
returns the parent class
QoreClassDestructorHierarchyIterator::QoreClassDestructorHierarchyIterator
DLLEXPORT QoreClassDestructorHierarchyIterator(const QoreClass *cls)
creates the iterator; call next() to start iterating
QoreClassHierarchyIterator
iterates the class hierarchy in the order of constructor execution
Definition: QoreClass.h:1292
QoreClassHierarchyIterator::QoreClassHierarchyIterator
DLLEXPORT QoreClassHierarchyIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreClassHierarchyIterator::isVirtual
DLLEXPORT bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
QoreClassHierarchyIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreClassHierarchyIterator::get
DLLEXPORT const QoreClass & get() const
returns the parent class
QoreClassHierarchyIterator::~QoreClassHierarchyIterator
DLLEXPORT ~QoreClassHierarchyIterator()
destroys the object
QoreClassHierarchyIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreClassHolder
allows for temporary storage of a QoreClass pointer
Definition: QoreClass.h:1134
QoreClassHolder::QoreClassHolder
DLLLOCAL QoreClassHolder(QoreClass *c)
creates the object
Definition: QoreClass.h:1137
QoreClassHolder::release
DLLLOCAL QoreClass * release()
releases the QoreClass*
Definition: QoreClass.h:1149
QoreClassHolder::~QoreClassHolder
DLLEXPORT ~QoreClassHolder()
deletes the QoreClass object if still managed
QoreClass
defines a Qore-language class
Definition: QoreClass.h:249
QoreClass::isPseudoClass
DLLEXPORT bool isPseudoClass() const
returns true if the class is a pseudo class
QoreClass::findStaticMethod
DLLEXPORT const QoreMethod * findStaticMethod(const char *nme) const
finds a static method in the class hierarchy
QoreClass::findLocalStaticMember
DLLEXPORT const QoreExternalStaticMember * findLocalStaticMember(const char *name) const
Finds the given local static member or returns nullptr.
QoreClass::getMethodGate
DLLEXPORT const QoreMethod * getMethodGate() const
returns a const pointer to the QoreMethod object of the methodGate method, if any is set
QoreClass::setKeyValueIfNotSet
DLLEXPORT QoreValue setKeyValueIfNotSet(const std::string &key, QoreValue val)
Sets a key value in the class's key-value store only if no value exists for the given key.
QoreClass::setDestructor
DLLEXPORT void setDestructor(q_destructor_t m)
sets the builtin destructor method for the class
QoreClass::~QoreClass
virtual DLLEXPORT ~QoreClass()
Deletes the object and frees all memory.
QoreClass::getNamespace
DLLEXPORT const QoreNamespace * getNamespace() const
Returns the namespace that owns this class.
QoreClass::setLanguage
DLLEXPORT void setLanguage(const char *lang)
Sets the language for classes imported from another programming language.
QoreClass::hasTransientMember
DLLEXPORT bool hasTransientMember() const
Returns true if the class has at least one locally-declared transient member.
QoreClass::getDomain
DLLEXPORT int64 getDomain() const
returns the functional domain of the class
QoreClass::addBuiltinVirtualBaseClass
DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass *qc)
sets "virtual" base class for a class, meaning that the base class data is appropriate for use in the...
QoreClass::findLocalMember
DLLEXPORT const QoreExternalNormalMember * findLocalMember(const char *name) const
Finds the given local member or returns nullptr.
QoreClass::addBuiltinConstant
DLLEXPORT void addBuiltinConstant(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a class constant to the class
QoreClass::getRelaxedAbstractMatch
DLLEXPORT bool getRelaxedAbstractMatch() const
Returns the relaxed abstract matching flag.
QoreClass::inHierarchy
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's hierachy,...
QoreClass::hasPublicMembersInHierarchy
DLLEXPORT bool hasPublicMembersInHierarchy() const
returns true if the class has any publicly-declared members
QoreClass::addAbstractMethod
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...
QoreClass::setSerializer
DLLEXPORT void setSerializer(q_serializer_t m)
sets the serializer method for builtin classes
QoreClass::isAbstract
DLLEXPORT bool isAbstract() const
returns true if the class has at least one unimplemented abstract method variant
QoreClass::isPublicOrPrivateMember
DLLEXPORT bool isPublicOrPrivateMember(const char *str, bool &priv) const
returns true if the member is private or public
QoreClass::getMethodList
DLLEXPORT QoreListNode * getMethodList() const
returns a list strings of all non-static methods in the class, the caller owns the reference count re...
QoreClass::setManagedUserData
DLLEXPORT void setManagedUserData(AbstractQoreClassUserData *cud)
sets a pointer to user-specific data in the class
QoreClass::getClass
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 ...
QoreClass::isPrivateMember
DLLEXPORT bool isPrivateMember(const char *str) const
returns true if the member is private
QoreClass::getReferencedKeyValue
DLLEXPORT QoreValue getReferencedKeyValue(const std::string &key) const
Returns a referenced key value from the class's key-value store.
QoreClass::getProgram
DLLEXPORT QoreProgram * getProgram() const
Returns the owning QoreProgram object (if not the static system namespace)
QoreClass::copy
virtual DLLEXPORT QoreClass * copy()
Called when a class is copied.
QoreClass::addDefaultBuiltinBaseClass
DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class and ensures that the given class's private data...
QoreClass::QoreClass
DLLEXPORT QoreClass()
For use with QoreClass::copyImport()
QoreClass::inHierarchyStrict
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's hierachy,...
QoreClass::setRelaxedAbstractMatch
DLLEXPORT void setRelaxedAbstractMatch()
Sets relaxed abstract matching.
QoreClass::execSystemConstructor
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 ...
QoreClass::isEqual
DLLEXPORT bool isEqual(const QoreClass &cls) const
returns true if the classes are equal
QoreClass::numUserMethods
DLLEXPORT int numUserMethods() const
returns the number of non-static user methods in this class
QoreClass::setDeserializer
DLLEXPORT void setDeserializer(q_deserializer_t m)
sets the deserializer method for builtin classes
QoreClass::execCopy
DLLEXPORT QoreObject * execCopy(QoreObject *old, ExceptionSink *xsink) const
executes a class's "copy" method on an object and returns the new object (or 0 in the case of an exce...
QoreClass::setUserData
DLLEXPORT void setUserData(const void *ptr)
sets a pointer to user-specific data in the class
QoreClass::runtimeCheckInstantiateClass
DLLEXPORT int runtimeCheckInstantiateClass(ExceptionSink *xsink) const
Throws a Qore-language exception if the class cannot be instantiated.
QoreClass::rescanParents
DLLEXPORT void rescanParents()
rescan builtin parent classes in a class hierarchy; to be used with out-of-order class hierarchy cons...
QoreClass::getStaticMethodList
DLLEXPORT QoreListNode * getStaticMethodList() const
returns a list strings of all static methods in the class, the caller owns the reference count return...
QoreClass::setFinal
DLLEXPORT void setFinal()
sets the final flag of the class
QoreClass::findConstant
DLLEXPORT const QoreExternalConstant * findConstant(const char *name) const
Finds the given constant or returns nullptr if not found.
QoreClass::getConstructor
DLLEXPORT const QoreMethod * getConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set
QoreClass::setSystem
DLLEXPORT void setSystem()
marks the class as a builtin class
QoreClass::setGateAccessFlag
DLLEXPORT void setGateAccessFlag()
sets the class's gate access flag so that memberGate() and methodGate() methods will be called with a...
QoreClass::numStaticUserMethods
DLLEXPORT int numStaticUserMethods() const
returns the number of static user methods in this class
QoreClass::getCopyMethod
DLLEXPORT const QoreMethod * getCopyMethod() const
returns a const pointer to the QoreMethod object of the destructor method, if any is set
QoreClass::findMethod
DLLEXPORT const QoreMethod * findMethod(const char *nme) const
finds a normal (non-static) method in the class hierarchy
QoreClass::getMemberGateMethod
DLLEXPORT const QoreMethod * getMemberGateMethod() const
returns a const pointer to the QoreMethod object of the memberGate method, if any is set
QoreClass::findLocalMethod
DLLEXPORT const QoreMethod * findLocalMethod(const char *name) const
finds a normal (non-static) method in the class hierarchy
QoreClass::execConstructor
DLLEXPORT QoreObject * execConstructor(const QoreListNode *args, ExceptionSink *xsink) const
creates a new object and executes the constructor on it and returns the new object
QoreClass::execConstructorVariant
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
QoreClass::isModulePublic
DLLEXPORT bool isModulePublic() const
returns true if the class has its module public flag set
QoreClass::getInjectedAsClass
DLLEXPORT QoreClass * getInjectedAsClass()
returns the class pointer for any injection target class if this class was injected,...
QoreClass::addBuiltinStaticVar
DLLEXPORT void addBuiltinStaticVar(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a static variable to the class
QoreClass::recheckBuiltinMethodHierarchy
DLLEXPORT void recheckBuiltinMethodHierarchy()
rechecks for inherited methods in base classes when adding builtin classes
QoreClass::getID
DLLEXPORT qore_classid_t getID() const
returns the class ID of this class
QoreClass::hasMemberGate
DLLEXPORT bool hasMemberGate() const
returns true if the class implements a "memberGate" method
QoreClass::getBinaryHash
DLLEXPORT BinaryNode * getBinaryHash() const
returns a binary hash for the class's API
QoreClass::numMethods
DLLEXPORT int numMethods() const
returns the number of non-static methods in this class (user and builtin)
QoreClass::getUserData
DLLEXPORT const void * getUserData() const
retrieves the user-specific data pointer
QoreClass::addMember
DLLEXPORT void addMember(const char *mem, ClassAccess access, const QoreTypeInfo *n_typeInfo, QoreValue initial_value=QoreValue())
adds a member
QoreClass::getPseudoClassType
DLLEXPORT qore_type_t getPseudoClassType() const
returns a pseudo-classes base type
QoreClass::hasCopy
DLLEXPORT bool hasCopy() const
returns true if the class implements a copy method
QoreClass::hasMethodGate
DLLEXPORT bool hasMethodGate() const
returns true if the class implements a "methodGate" method
QoreClass::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information structure for this class
QoreClass::getDeserializer
DLLEXPORT q_deserializer_t getDeserializer() const
returns the deserializer method or nullptr if not present
QoreClass::addBuiltinBaseClass
DLLEXPORT void addBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class
QoreClass::addBaseClass
DLLEXPORT void addBaseClass(QoreClass *qc, bool virt=false)
Adds a base class to the current class.
QoreClass::setPublicMemberFlag
DLLEXPORT void setPublicMemberFlag()
sets the class's public member flag so that undeclared member references will fail
QoreClass::getPath
DLLEXPORT const char * getPath() const
Returns the root-justified namespace path of the class including the class name.
QoreClass::setKeyValue
DLLEXPORT QoreValue setKeyValue(const std::string &key, QoreValue val)
Sets a key value in the class's key-value store unconditionally.
QoreClass::getManagedUserData
DLLEXPORT AbstractQoreClassUserData * getManagedUserData() const
retrieves the user-specific data pointer
QoreClass::isSystem
DLLEXPORT bool isSystem() const
returns true if the class is a builtin class
QoreClass::copyImport
virtual DLLEXPORT QoreClass * copyImport()
Called when a class is copied for import.
QoreClass::numStaticMethods
DLLEXPORT int numStaticMethods() const
returns the number of static methods in this class (user and builtin)
QoreClass::findLocalStaticMethod
DLLEXPORT const QoreMethod * findLocalStaticMethod(const char *name) const
finds a static method in the class hierarchy
QoreClass::hasMemberNotification
DLLEXPORT bool hasMemberNotification() const
returns true if the class implements a "memberNotification" method
QoreClass::addMethod
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
QoreClass::getOrNothingTypeInfo
DLLEXPORT const QoreTypeInfo * getOrNothingTypeInfo() const
returns the "or nothing" type information structure for this class
QoreClass::getModuleName
DLLEXPORT const char * getModuleName() const
Returns the module name the class was loaded from or nullptr if it is a builtin class.
QoreClass::getSerializer
DLLEXPORT q_serializer_t getSerializer() const
returns the serializer method or nullptr if not present
QoreClass::evalPseudoMethod
DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char *nme, const QoreListNode *args, ExceptionSink *xsink) const
evaluates a pseudo-method on a pseudo-class
QoreClass::getLanguage
DLLEXPORT const char * getLanguage() const
Returns the language this class is written in.
QoreClass::isInjected
DLLEXPORT bool isInjected() const
returns true if the class has been injected as a dependency injection
QoreClass::getName
DLLEXPORT const char * getName() const
returns the class name
QoreClass::setCopy
DLLEXPORT void setCopy(q_copy_t m)
sets the builtin copy method for the class
QoreClass::addConstructor
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,...
QoreClass::getSystemConstructor
DLLEXPORT const QoreMethod * getSystemConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set
QoreClass::getMemberNotificationMethod
DLLEXPORT const QoreMethod * getMemberNotificationMethod() const
returns a const pointer to the QoreMethod object of the memberNotification method,...
QoreClass::getNamespacePath
DLLEXPORT std::string getNamespacePath(bool anchored=false) const
returns the full namespace path of the class
QoreClass::findUserMethodVariant
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
QoreClass::hasParentClass
DLLEXPORT bool hasParentClass() const
returns true if the class has one or more parent classes
QoreClass::setSystemConstructor
DLLEXPORT void setSystemConstructor(q_system_constructor_t m)
sets the builtin constructor for system objects (ex: used as constant values)
QoreClass::isFinal
DLLEXPORT bool isFinal() const
returns true if the class is final
QoreClass::getDestructor
DLLEXPORT const QoreMethod * getDestructor() const
returns a const pointer to the QoreMethod object of the constructor method, if any is set
QoreClass::setSynchronousClass
DLLEXPORT void setSynchronousClass()
call this function if your builtin class requires *all* methods (except the constructor) to be run in...
QoreClass::addStaticMethod
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,...
QoreClassMemberIterator
iterates normal (non-static) members of a class
Definition: QoreClass.h:1212
QoreClassMemberIterator::getMember
DLLEXPORT const QoreExternalNormalMember & getMember() const
returns the member
QoreClassMemberIterator::getName
DLLEXPORT const char * getName() const
returns the member's name
QoreClassMemberIterator::~QoreClassMemberIterator
DLLEXPORT ~QoreClassMemberIterator()
destroys the object
QoreClassMemberIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreClassMemberIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreClassMemberIterator::QoreClassMemberIterator
DLLEXPORT QoreClassMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreClassStaticMemberIterator
iterates static members of a class
Definition: QoreClass.h:1239
QoreClassStaticMemberIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreClassStaticMemberIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreClassStaticMemberIterator::getName
DLLEXPORT const char * getName() const
returns the member's name
QoreClassStaticMemberIterator::QoreClassStaticMemberIterator
DLLEXPORT QoreClassStaticMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreClassStaticMemberIterator::getMember
DLLEXPORT const QoreExternalStaticMember & getMember() const
returns the member
QoreClassStaticMemberIterator::~QoreClassStaticMemberIterator
DLLEXPORT ~QoreClassStaticMemberIterator()
destroys the object
QoreExternalConstant
external wrapper class for constants
Definition: QoreReflection.h:200
QoreExternalMemberVarBase
external wrapper base class for class members
Definition: QoreReflection.h:137
QoreExternalMethodVariant
external wrapper class for method variants
Definition: QoreReflection.h:90
QoreExternalNormalMember
external wrapper base class for class normal members
Definition: QoreReflection.h:174
QoreExternalProgramLocation
external wrapper class for source code location information
Definition: QoreReflection.h:187
QoreExternalStaticMember
external wrapper base class for class static members
Definition: QoreReflection.h:153
QoreExternalVariant
external wrapper class for function and call variants
Definition: QoreReflection.h:38
QoreListNode
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
QoreMethod
a method in a QoreClass
Definition: QoreClass.h:135
QoreMethod::execManaged
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
QoreMethod::isBuiltin
DLLEXPORT bool isBuiltin() const
returns true if all variants of the method are builtin variants
QoreMethod::existsVariant
DLLEXPORT bool existsVariant(const type_vec_t &paramTypeInfo) const
returns true if a variant with the given parameter signature already exists in the method
QoreMethod::isStatic
DLLEXPORT bool isStatic() const
returns true if the method is static
QoreMethod::getFunction
DLLEXPORT const QoreExternalMethodFunction * getFunction() const
returns the function for the method
QoreMethod::isUser
DLLEXPORT bool isUser() const
returns true if all variants of the method are user variants
QoreMethod::getAccess
DLLEXPORT ClassAccess getAccess() const
returns the lowest access code of all variants in the method
QoreMethod::getNameStr
DLLEXPORT const std::string & getNameStr() const
returns the method's name
QoreMethod::isPrivate
DLLEXPORT bool isPrivate() const
returns true if all overloaded variants of a methods are private or class internal,...
QoreMethod::getClassName
DLLEXPORT const char * getClassName() const
returns the class name for the method
QoreMethod::getName
DLLEXPORT const char * getName() const
returns the method's name
QoreMethod::getMethodType
DLLEXPORT method_type_e getMethodType() const
returns the type of method
QoreMethod::getClass
DLLEXPORT const QoreClass * getClass() const
returns a pointer to the parent class
QoreMethodIterator
To be used to iterate through a class's normal (non-static) methods.
Definition: QoreClass.h:1108
QoreNamespace
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:65
QoreObject
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition: QoreObject.h:60
QoreParentClassIterator
iterates parent classes for a class with inheritance access information
Definition: QoreClass.h:1185
QoreParentClassIterator::getParentClass
DLLEXPORT const QoreClass & getParentClass() const
returns the parent class
QoreParentClassIterator::~QoreParentClassIterator
DLLEXPORT ~QoreParentClassIterator()
destroys the object
QoreParentClassIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
QoreParentClassIterator::next
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
QoreParentClassIterator::QoreParentClassIterator
DLLEXPORT QoreParentClassIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
QoreParentClassIterator::getAccess
DLLEXPORT ClassAccess getAccess() const
returns the access of the parent class
QoreProgram
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition: QoreProgram.h:127
QoreStaticMethodIterator
To be used to iterate through a class's static methods.
Definition: QoreClass.h:1120
q_external_method_t
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
q_serializer_t
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
q_external_destructor_t
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
qore_type_t
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition: common.h:70
q_external_static_method_t
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
q_func_n_t
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
q_copy_t
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
q_system_constructor_t
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
q_method_n_t
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
q_external_constructor_t
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
type_vec_t
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:251
q_destructor_t
void(* q_destructor_t)(QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures
Definition: common.h:398
q_external_copy_t
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
qore_classid_t
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:79
name_vec_t
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition: common.h:257
q_deserializer_t
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
int64
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
q_constructor_n_t
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
arg_vec_t
std::vector< QoreValue > arg_vec_t
vector of value information for default argument lists
Definition: common.h:254
num_params
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:54
QoreValue
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275