Qore Programming Language 2.0.0
Loading...
Searching...
No Matches
QoreClass.h
1/* -*- mode: c++; indent-tabs-mode: nil -*- */
2/*
3 QoreClass.h
4
5 Qore Programming Language
6
7 Copyright (C) 2003 - 2024 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
41DLLEXPORT extern qore_classid_t CID_AUTOGATE;
42DLLEXPORT extern qore_classid_t CID_AUTOLOCK;
43DLLEXPORT extern qore_classid_t CID_AUTOREADLOCK;
44DLLEXPORT extern qore_classid_t CID_AUTOWRITELOCK;
45DLLEXPORT extern qore_classid_t CID_CONDITION;
46DLLEXPORT extern qore_classid_t CID_COUNTER;
47DLLEXPORT extern qore_classid_t CID_DATASOURCE;
48DLLEXPORT extern qore_classid_t CID_DATASOURCEPOOL;
49DLLEXPORT extern qore_classid_t CID_FILE;
50DLLEXPORT extern qore_classid_t CID_FTPCLIENT;
51DLLEXPORT extern qore_classid_t CID_GATE;
52DLLEXPORT extern qore_classid_t CID_GETOPT;
53DLLEXPORT extern qore_classid_t CID_HTTPCLIENT;
54DLLEXPORT extern qore_classid_t CID_MUTEX;
55DLLEXPORT extern qore_classid_t CID_PROGRAM;
56DLLEXPORT extern qore_classid_t CID_PROGRAMDEBUG;
57DLLEXPORT extern qore_classid_t CID_QUEUE;
58DLLEXPORT extern qore_classid_t CID_RWLOCK;
59DLLEXPORT extern qore_classid_t CID_SSLCERTIFICATE;
60DLLEXPORT extern qore_classid_t CID_SSLPRIVATEKEY;
61DLLEXPORT extern qore_classid_t CID_SEQUENCE;
62DLLEXPORT extern qore_classid_t CID_SOCKET;
63DLLEXPORT extern qore_classid_t CID_TERMIOS;
64DLLEXPORT extern qore_classid_t CID_INPUTSTREAM;
65DLLEXPORT extern qore_classid_t CID_OUTPUTSTREAM;
66DLLEXPORT extern qore_classid_t CID_INPUTSTREAMBASE;
67DLLEXPORT extern qore_classid_t CID_OUTPUTSTREAMBASE;
68DLLEXPORT extern qore_classid_t CID_PROGRAM;
69DLLEXPORT extern qore_classid_t CID_SERIALIZABLE;
70DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLABLEIOOBJECT;
71DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLABLEIOOBJECTBASE;
72DLLEXPORT extern qore_classid_t CID_ABSTRACTPOLLOPERATION;
73DLLEXPORT extern qore_classid_t CID_SOCKETPOLLOPERATIONBASE;
74DLLEXPORT extern qore_classid_t CID_SOCKETPOLLOPERATION;
75DLLEXPORT extern qore_classid_t CID_FILEPOLLOPERATIONBASE;
76DLLEXPORT extern qore_classid_t CID_FILEPOLLOPERATION;
77
78DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLABLEIOOBJECT;
79DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLABLEIOOBJECTBASE;
80DLLEXPORT extern QoreClass* QC_ABSTRACTPOLLOPERATION;
81DLLEXPORT extern QoreClass* QC_CONDITION;
82DLLEXPORT extern QoreClass* QC_COUNTER;
83DLLEXPORT extern QoreClass* QC_FILEPOLLOPERATIONBASE;
84DLLEXPORT extern QoreClass* QC_FILEPOLLOPERATION;
85DLLEXPORT extern QoreClass* QC_HTTPCLIENT;
86DLLEXPORT extern QoreClass* QC_MUTEX;
87DLLEXPORT extern QoreClass* QC_QUEUE;
88DLLEXPORT extern QoreClass* QC_PROGRAM;
89DLLEXPORT extern QoreClass* QC_RWLOCK;
90DLLEXPORT extern QoreClass* QC_SERIALIZABLE;
91DLLEXPORT extern QoreClass* QC_SOCKETPOLLOPERATIONBASE;
92DLLEXPORT extern QoreClass* QC_SOCKETPOLLOPERATION;
93DLLEXPORT extern QoreClass* QC_SSLCERTIFICATE;
94DLLEXPORT extern QoreClass* QC_SSLPRIVATEKEY;
95
96class BCList;
97class BCSMList;
98class BCAList;
99class QoreObject;
100class QoreClass;
101class BCEAList;
102class ParamList;
103class QoreMemberInfo;
104class BuiltinMethod;
105class AbstractQoreFunctionVariant;
106class AbstractFunctionSignature;
107class UserMethod;
108class BCANode;
109class qore_method_private;
110class MethodFunctionBase;
111class NamedScope;
112class ConstantList;
113class MethodVariantBase;
114
120class QoreExternalMethodFunction;
125
127
129enum method_type_e {
130 MT_None = 0, // not a method function/variant
131 MT_Normal = 1,
132 MT_Static = 2,
133 MT_Constructor = 3,
134 MT_Destructor = 4,
135 MT_Copy = 5,
136 MT_Pseudo = 6,
137};
138
140
144 friend class StaticMethodCallNode;
145 friend class QoreObject;
146 friend class qore_class_private;
147 friend class qore_method_private;
148 friend class BCList;
149
150private:
152 class qore_method_private* priv;
153
155 DLLLOCAL QoreMethod(const QoreMethod&);
156
158 DLLLOCAL QoreMethod& operator=(const QoreMethod&);
159
160public:
162
164 DLLEXPORT bool isUser() const;
165
167
169 DLLEXPORT bool isBuiltin() const;
170
172
174 DLLEXPORT bool isPrivate() const;
175
177 DLLEXPORT ClassAccess getAccess() const;
178
180
183 DLLEXPORT bool isStatic() const;
184
186
189 DLLEXPORT const char* getName() const;
190
192
195 DLLEXPORT const std::string& getNameStr() const;
196
198 DLLEXPORT const QoreClass* getClass() const;
199
201 DLLEXPORT const char* getClassName() const;
202
204 DLLEXPORT bool existsVariant(const type_vec_t& paramTypeInfo) const;
205
206 /* returns the return type information for the method if it is available and if
207 there is only one return type (there can be more return types if the method is
208 overloaded)
209 */
210 DLLEXPORT const QoreTypeInfo* getUniqueReturnTypeInfo() const;
211
213
217 DLLEXPORT QoreValue execManaged(QoreObject* self, const QoreListNode* args, ExceptionSink* xsink) const;
218
220
222 DLLEXPORT method_type_e getMethodType() const;
223
225
227 DLLEXPORT const QoreExternalMethodFunction* getFunction() const;
228
229 DLLLOCAL QoreMethod(const QoreClass* p_class, MethodFunctionBase* n_func, bool n_static = false);
230
231 DLLLOCAL bool inMethod(const QoreObject* self) const;
232 DLLLOCAL QoreMethod* copy(const QoreClass* p_class) const;
233 DLLLOCAL void assign_class(const QoreClass* p_class);
234 // non-exported destructor
235 DLLLOCAL ~QoreMethod();
236};
237
239
242public:
243 DLLEXPORT virtual ~AbstractQoreClassUserData();
244
246 virtual AbstractQoreClassUserData* copy() const = 0;
247
249 virtual void doDeref() = 0;
250};
251
253
256public:
260
263 if (d) {
264 d->doDeref();
265 }
266 }
267
271 d = nullptr;
272 return rv;
273 }
274
276 DLLLOCAL operator bool() const {
277 return d ? true : false;
278 }
279
281 DLLLOCAL const AbstractQoreClassUserData* operator*() const {
282 return d;
283 }
284
287 return d;
288 }
289
291 DLLLOCAL const AbstractQoreClassUserData* operator->() const {
292 return d;
293 }
294
297 return d;
298 }
299
300private:
303};
304
306
311 friend class BCList;
312 friend class BCNode;
313 friend class BCSMList;
314 friend class qore_object_private;
315 friend class qore_class_private;
316 friend class QoreObject;
317 friend class BCANode;
318 friend class qore_method_private;
319 friend class QoreMethodIterator;
320 friend class QoreStaticMethodIterator;
321 friend class ConstructorMethodFunction;
322 friend class QoreBuiltinClass;
323 friend class QoreParseClass;
324
325public:
327
335 DLLEXPORT QoreClass(std::string&& n_name, std::string&& ns_path, int64 n_domain = QDOM_DEFAULT);
336
338
346 DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain = QDOM_DEFAULT);
347
349
364 DLLEXPORT QoreClass(const char* n_name, const char* ns_path, int64 n_domain, const QoreTypeInfo* n_typeInfo);
365
367
369 DLLEXPORT QoreClass(const QoreClass& old);
370
372
374 DLLEXPORT virtual QoreClass* copyImport();
375
377
379 DLLEXPORT virtual QoreClass* copy();
380
382
384 DLLEXPORT QoreProgram* getProgram() const;
385
387
416 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, ...);
417
419
453 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());
454
456 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, ...);
457
459
461 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());
462
464 DLLEXPORT void addAbstractMethod(const char* n_name, ClassAccess access = Public, int64 n_flags = QCF_NO_FLAGS, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
465
467 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());
468
470
481 DLLEXPORT void setDestructor(q_destructor_t m);
482
484
496 DLLEXPORT void setDestructor(const void* ptr, q_external_destructor_t m);
497
499 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, ...);
500
502
504 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());
505
507
511
513
524 DLLEXPORT void setCopy(q_copy_t m);
525
527
539 DLLEXPORT void setCopy(const void* ptr, q_external_copy_t m);
540
542
546 DLLEXPORT void setSerializer(q_serializer_t m);
547
549
554
556
558 DLLEXPORT q_serializer_t getSerializer() const;
559
561
564
566 DLLEXPORT void setFinal();
567
569
573 DLLEXPORT bool isPrivateMember(const char* str) const;
574
576
581 DLLEXPORT bool isPublicOrPrivateMember(const char* str, bool& priv) const;
582
584
590 DLLEXPORT QoreObject* execConstructor(const QoreListNode* args, ExceptionSink* xsink) const;
591
593
606 DLLEXPORT QoreObject* execConstructor(const QoreClass& obj_cls, const QoreListNode* args, bool allow_abstract,
607 ExceptionSink* xsink) const;
608
610
618
620
624 DLLEXPORT QoreObject* execSystemConstructor(int code = 0, ...) const;
625
627
631 DLLEXPORT QoreObject* execCopy(QoreObject* old, ExceptionSink* xsink) const;
632
634
637 DLLEXPORT QoreListNode* getMethodList() const;
638
640
644
646
655 DLLEXPORT const QoreClass* getClass(qore_classid_t cid) const;
656
658
667 DLLEXPORT const QoreClass* getClass(qore_classid_t cid, bool& priv) const;
668
670
679 DLLEXPORT const QoreClass* getClass(const QoreClass& qc, bool& priv) const;
680
682 DLLEXPORT int numMethods() const;
683
685 DLLEXPORT int numStaticMethods() const;
686
688 DLLEXPORT int numUserMethods() const;
689
691 DLLEXPORT int numStaticUserMethods() const;
692
694 DLLEXPORT bool hasCopy() const;
695
697 DLLEXPORT qore_classid_t getID() const;
698
700 DLLEXPORT bool isSystem() const;
701
703
705 DLLEXPORT bool isModulePublic() const;
706
708
710 DLLEXPORT bool isAbstract() const;
711
713
715 DLLEXPORT bool isFinal() const;
716
718
720 DLLEXPORT bool isInjected() const;
721
723
725 DLLEXPORT bool isPseudoClass() const;
726
728
733
735
739 DLLEXPORT const QoreClass* getInjectedAsClass() const;
740
742
747
749
753 DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char* nme, const QoreListNode* args, ExceptionSink* xsink) const;
754
756
770 DLLEXPORT QoreValue evalPseudoMethod(const QoreMethod* m, const QoreExternalMethodVariant* variant, const QoreValue n, const QoreListNode* args, ExceptionSink* xsink) const;
771
773 DLLEXPORT void setSystem();
774
776 DLLEXPORT bool hasMemberGate() const;
777
779 DLLEXPORT bool hasMethodGate() const;
780
782 DLLEXPORT bool hasMemberNotification() const;
783
785
787 DLLEXPORT int64 getDomain() const;
788
790 DLLEXPORT const char* getName() const;
791
793
797 DLLEXPORT const QoreMethod* findMethod(const char* nme) const;
798
800
804 DLLEXPORT const QoreMethod* findStaticMethod(const char* nme) const;
805
807
811 DLLEXPORT const QoreMethod* findMethod(const char* nme, ClassAccess& access) const;
812
814
818 DLLEXPORT const QoreMethod* findStaticMethod(const char* nme, ClassAccess& access) const;
819
821
825 DLLEXPORT const QoreMethod* findLocalMethod(const char* name) const;
826
828
832 DLLEXPORT const QoreMethod* findLocalStaticMethod(const char* name) const;
833
835
838 DLLEXPORT void addBuiltinBaseClass(QoreClass* qc);
839
841
846
848
855
857
862 DLLEXPORT void addBaseClass(QoreClass* qc, bool virt = false);
863
865
867 DLLEXPORT void setSynchronousClass();
868
870
873 DLLEXPORT const QoreMethod* getConstructor() const;
874
876
879 DLLEXPORT const QoreMethod* getSystemConstructor() const;
880
882
885 DLLEXPORT const QoreMethod* getDestructor() const;
886
888
891 DLLEXPORT const QoreMethod* getCopyMethod() const;
892
894
897 DLLEXPORT const QoreMethod* getMemberGateMethod() const;
898
900
903 DLLEXPORT const QoreMethod* getMethodGate() const;
904
906
909 DLLEXPORT const QoreMethod* getMemberNotificationMethod() const;
910
912 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
913
915 DLLEXPORT const QoreTypeInfo* getOrNothingTypeInfo() const;
916
918 DLLEXPORT void addMember(const char* mem, ClassAccess access, const QoreTypeInfo* n_typeInfo, QoreValue initial_value = QoreValue());
919
921
923 DLLEXPORT void setUserData(const void* ptr);
924
926
928 DLLEXPORT const void* getUserData() const;
929
931
934
936
939
941
943 template <typename T>
944 DLLLOCAL T* getManagedUserData() const {
945 return static_cast<T*>(getManagedUserData());
946 }
947
950
952
954 DLLEXPORT const QoreExternalMethodVariant* findUserMethodVariant(const char* name, const QoreMethod*& method, const type_vec_t& argTypeList) const;
955
957
962 DLLEXPORT void addBuiltinConstant(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
963
965
970 DLLEXPORT void addBuiltinStaticVar(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = nullptr);
971
973
979 DLLEXPORT void rescanParents();
980
982
984 DLLEXPORT void setPublicMemberFlag();
985
987
989 DLLEXPORT void setGateAccessFlag();
990
992
994 DLLEXPORT void setLanguage(const char* lang);
995
997
1001 DLLEXPORT const char* getLanguage() const;
1002
1004
1008 DLLEXPORT void setRelaxedAbstractMatch();
1009
1011
1017 DLLEXPORT bool getRelaxedAbstractMatch() const;
1018
1020
1022 DLLEXPORT const QoreExternalNormalMember* findLocalMember(const char* name) const;
1023
1025
1027 DLLEXPORT const QoreExternalStaticMember* findLocalStaticMember(const char* name) const;
1028
1030
1034 DLLEXPORT std::string getNamespacePath(bool anchored = false) const;
1035
1037
1041 DLLEXPORT const char* getPath() const;
1042
1044
1046 DLLEXPORT bool isEqual(const QoreClass& cls) const;
1047
1049
1051 DLLEXPORT BinaryNode* getBinaryHash() const;
1052
1054
1056 DLLEXPORT int runtimeCheckInstantiateClass(ExceptionSink* xsink) const;
1057
1059
1061 DLLEXPORT const QoreExternalConstant* findConstant(const char* name) const;
1062
1064
1066 DLLEXPORT const QoreNamespace* getNamespace() const;
1067
1069
1071 DLLEXPORT bool inHierarchy(const QoreClass& cls, ClassAccess& n_access) const;
1072
1074
1076 DLLEXPORT bool inHierarchyStrict(const QoreClass& cls, ClassAccess& n_access) const;
1077
1079
1081 DLLEXPORT bool hasTransientMember() const;
1082
1084
1086 DLLEXPORT const char* getModuleName() const;
1087
1089
1098 DLLEXPORT QoreValue setKeyValue(const std::string& key, QoreValue val);
1099
1101
1112 DLLEXPORT QoreValue setKeyValueIfNotSet(const std::string& key, QoreValue val);
1113
1115
1124 DLLEXPORT bool setKeyValueIfNotSet(const std::string& key, const char* str);
1125
1127
1135 DLLEXPORT QoreValue getReferencedKeyValue(const std::string& key) const;
1136
1138
1146 DLLEXPORT QoreValue getReferencedKeyValue(const char* key) const;
1147
1149 DLLEXPORT bool hasParentClass() const;
1150
1152 DLLEXPORT bool hasPublicMembersInHierarchy() const;
1153
1155
1157 DLLEXPORT AbstractQoreNode* getNewObjectExpression(QoreListNode* args = nullptr) const;
1158
1159protected:
1161 DLLEXPORT virtual ~QoreClass();
1162
1164 DLLEXPORT QoreClass();
1165
1166private:
1167 QoreClass& operator=(const QoreClass&) = delete;
1168
1170 class qore_class_private* priv;
1171};
1172
1175private:
1176 void* priv;
1177
1178public:
1179 DLLEXPORT QoreMethodIterator(const QoreClass& qc);
1180 DLLEXPORT ~QoreMethodIterator();
1181 DLLEXPORT bool next();
1182 DLLEXPORT const QoreMethod* getMethod() const;
1183};
1184
1187private:
1188 void* priv;
1189
1190public:
1191 DLLEXPORT QoreStaticMethodIterator(const QoreClass& qc);
1192 DLLEXPORT ~QoreStaticMethodIterator();
1193 DLLEXPORT bool next();
1194 DLLEXPORT const QoreMethod* getMethod() const;
1195};
1196
1198
1201public:
1203 DLLLOCAL QoreClassHolder(QoreClass* c) : c(c) {
1204 }
1205
1207 DLLEXPORT ~QoreClassHolder();
1208
1210 DLLLOCAL operator QoreClass*() const {
1211 return c;
1212 }
1213
1215 DLLLOCAL QoreClass* release() {
1216 auto rv = c;
1217 c = 0;
1218 return rv;
1219 }
1220
1221private:
1223 QoreClass* c;
1224};
1225
1228public:
1230
1235 DLLEXPORT QoreBuiltinClass(QoreProgram* pgm, const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1236
1238 DLLEXPORT QoreBuiltinClass(const char* name, const char* path, int64 n_domain = QDOM_DEFAULT);
1239
1241 DLLEXPORT QoreBuiltinClass(const QoreBuiltinClass& old);
1242
1244 DLLEXPORT void setModulePublic(bool v);
1245
1246protected:
1248 DLLEXPORT QoreBuiltinClass();
1249};
1250
1252
1255public:
1257 DLLEXPORT QoreParentClassIterator(const QoreClass& cls);
1258
1261
1263 DLLEXPORT bool next();
1264
1266 DLLEXPORT bool valid() const;
1267
1269 DLLEXPORT const QoreClass& getParentClass() const;
1270
1272 DLLEXPORT ClassAccess getAccess() const;
1273
1274private:
1275 std::unique_ptr<class qore_parent_class_iterator_private> priv;
1276};
1277
1279
1282public:
1284 DLLEXPORT QoreClassMemberIterator(const QoreClass& cls);
1285
1288
1290 DLLEXPORT bool next();
1291
1293 DLLEXPORT bool valid() const;
1294
1296 DLLEXPORT const QoreExternalNormalMember& getMember() const;
1297
1299 DLLEXPORT const char* getName() const;
1300
1301private:
1302 std::unique_ptr<class qore_class_member_iterator_private> priv;
1303};
1304
1306
1309public:
1312
1315
1317 DLLEXPORT bool next();
1318
1320 DLLEXPORT bool valid() const;
1321
1323 DLLEXPORT const QoreExternalStaticMember& getMember() const;
1324
1326 DLLEXPORT const char* getName() const;
1327
1328private:
1329 std::unique_ptr<class qore_class_static_member_iterator_private> priv;
1330};
1331
1333
1336public:
1339
1342
1344 DLLEXPORT bool next();
1345
1347 DLLEXPORT bool valid() const;
1348
1350 DLLEXPORT const QoreExternalConstant& get() const;
1351
1352private:
1353 std::unique_ptr<class qore_class_constant_iterator> priv;
1354};
1355
1357
1362public:
1365
1368
1370 DLLEXPORT bool next();
1371
1373 DLLEXPORT bool valid() const;
1374
1376 DLLEXPORT const QoreClass& get() const;
1377
1379
1381 DLLEXPORT bool isVirtual() const;
1382
1383private:
1384 std::unique_ptr<class qore_class_hierarchy_iterator> priv;
1385};
1386
1388
1393public:
1396
1399
1401 DLLEXPORT bool next();
1402
1404 DLLEXPORT bool valid() const;
1405
1407 DLLEXPORT const QoreClass* get() const;
1408
1410
1412 DLLEXPORT bool isVirtual() const;
1413
1414private:
1415 class qore_class_destructor_hierarchy_iterator* priv;
1416};
1417
1418DLLEXPORT const char* get_access_string(ClassAccess access);
1419
1420#endif // _QORE_QORECLASS_H
#define QDOM_DEFAULT
the default domain (no domain)
Definition Restrictions.h:172
an abstract class for class-specific external user data
Definition QoreClass.h:241
virtual AbstractQoreClassUserData * copy() const =0
for reference-counted classes, returns the same object with the reference count incremented
virtual void doDeref()=0
for non-reference counted classes, deletes the object immediately
The base class for all value and parse types in Qore expression trees.
Definition AbstractQoreNode.h:57
holds arbitrary binary data
Definition BinaryNode.h:41
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition ExceptionSink.h:50
creates a builtin class
Definition QoreClass.h:1227
DLLEXPORT QoreBuiltinClass(QoreProgram *pgm, const char *name, const char *path, int64 n_domain=QDOM_DEFAULT)
Creates the object and marks it as a builtin class.
DLLEXPORT QoreBuiltinClass(const char *name, const char *path, int64 n_domain=QDOM_DEFAULT)
creates the object and marks it as a builtin class
DLLEXPORT QoreBuiltinClass(const QoreBuiltinClass &old)
copies the object
DLLEXPORT void setModulePublic(bool v)
Sets the module public flag (default true)
DLLEXPORT QoreBuiltinClass()
for use with QoreClass::copyImport()
iterates class constants
Definition QoreClass.h:1335
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT QoreClassConstantIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT ~QoreClassConstantIterator()
destroys the object
DLLEXPORT const QoreExternalConstant & get() const
returns the
iterates the class hierarchy in the order of destructor execution
Definition QoreClass.h:1392
DLLEXPORT ~QoreClassDestructorHierarchyIterator()
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 bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
DLLEXPORT const QoreClass * get() const
returns the parent class
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT QoreClassDestructorHierarchyIterator(const QoreClass *cls)
creates the iterator; call next() to start iterating
iterates the class hierarchy in the order of constructor execution
Definition QoreClass.h:1361
DLLEXPORT QoreClassHierarchyIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT bool isVirtual() const
returns true if the class has virtual inheritance, meaning that it is a builtin class without its own...
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT ~QoreClassHierarchyIterator()
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 const QoreClass & get() const
returns the parent class
allows for temporary storage of a QoreClass pointer
Definition QoreClass.h:1200
DLLLOCAL QoreClassHolder(QoreClass *c)
creates the object
Definition QoreClass.h:1203
DLLLOCAL QoreClass * release()
releases the QoreClass*
Definition QoreClass.h:1215
DLLEXPORT ~QoreClassHolder()
deletes the QoreClass object if still managed
defines a Qore-language class
Definition QoreClass.h:310
DLLEXPORT bool isPseudoClass() const
returns true if the class is a pseudo class
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())
adds a builtin static method with extended information; additional functional domain info,...
virtual DLLEXPORT QoreClass * copy()
Called when a class is copied.
DLLEXPORT const char * getLanguage() const
Returns the language this class is written in.
DLLEXPORT QoreListNode * getStaticMethodList() const
returns a list strings of all static methods in the class, the caller owns the reference count return...
DLLEXPORT const QoreMethod * getMemberGateMethod() const
returns a const pointer to the QoreMethod object of the memberGate method, if any is set
DLLLOCAL T * getManagedUserData() const
retrieves the user-specific data pointer
Definition QoreClass.h:944
DLLEXPORT QoreProgram * getProgram() const
Returns the owning QoreProgram object (if not the static system namespace)
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information structure for this class
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.
DLLEXPORT const QoreExternalNormalMember * findLocalMember(const char *name) const
Finds the given local member or returns nullptr.
DLLEXPORT void setDestructor(q_destructor_t m)
sets the builtin destructor method for the class
DLLEXPORT QoreValue getReferencedKeyValue(const char *key) const
Returns a referenced key value from the class's key-value store.
DLLEXPORT AbstractQoreClassUserData * getManagedUserData() const
retrieves the user-specific data pointer
virtual DLLEXPORT ~QoreClass()
Deletes the object and frees all memory.
DLLEXPORT void setLanguage(const char *lang)
Sets the language for classes imported from another programming language.
DLLEXPORT bool hasTransientMember() const
Returns true if the class has at least one locally-declared transient member.
DLLEXPORT int64 getDomain() const
returns the functional domain of 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...
DLLEXPORT void addBuiltinConstant(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a class constant to the class
virtual DLLEXPORT QoreClass * copyImport()
Called when a class is copied for import.
DLLEXPORT bool getRelaxedAbstractMatch() const
Returns the relaxed abstract matching flag.
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,...
DLLEXPORT bool hasPublicMembersInHierarchy() const
returns true if the class has any publicly-declared members
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 void setSerializer(q_serializer_t m)
sets the serializer method for builtin classes
DLLEXPORT const QoreMethod * getDestructor() const
returns a const pointer to the QoreMethod object of the constructor method, if any is set
DLLEXPORT bool isAbstract() const
returns true if the class has at least one unimplemented abstract method variant
DLLEXPORT bool isPublicOrPrivateMember(const char *str, bool &priv) const
returns true if the member is private or public
DLLEXPORT void setManagedUserData(AbstractQoreClassUserData *cud)
sets a pointer to user-specific data in the class
DLLEXPORT QoreObject * execConstructor(const QoreClass &obj_cls, const QoreListNode *args, bool allow_abstract, ExceptionSink *xsink) const
Creates a new object and executes the constructor and returns the new object.
DLLEXPORT bool isPrivateMember(const char *str) const
returns true if the member is private
DLLEXPORT QoreValue getReferencedKeyValue(const std::string &key) const
Returns a referenced key value from the class's key-value store.
DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class and ensures that the given class's private data...
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...
DLLEXPORT QoreClass()
For use with QoreClass::copyImport()
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 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,...
DLLEXPORT void setRelaxedAbstractMatch()
Sets relaxed abstract matching.
DLLEXPORT bool isEqual(const QoreClass &cls) const
returns true if the classes are equal
DLLEXPORT int numUserMethods() const
returns the number of non-static user methods in this class
DLLEXPORT void setDeserializer(q_deserializer_t m)
sets the deserializer method for builtin classes
DLLEXPORT QoreClass(const char *n_name, const char *ns_path, int64 n_domain, const QoreTypeInfo *n_typeInfo)
creates the QoreClass object and assigns the name, the functional domain, and a custom QoreTypeInfo o...
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.
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 const QoreExternalStaticMember * findLocalStaticMember(const char *name) const
Finds the given local static member or returns nullptr.
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 * getMethodList() const
returns a list strings of all non-static methods in the class, the caller owns the reference count re...
DLLEXPORT void setCopy(const void *ptr, q_external_copy_t m)
sets the builtin copy method for the class using the new generic calling convention
DLLEXPORT void setSystem()
marks the class as a builtin class
DLLEXPORT void setGateAccessFlag()
sets the class's gate access flag so that memberGate() and methodGate() methods will be called with a...
DLLEXPORT const char * getPath() const
Returns the root-justified namespace path of the class including the class name.
DLLEXPORT int numStaticUserMethods() const
returns the number of static user methods in this class
DLLEXPORT QoreClass * getInjectedAsClass()
returns the class pointer for any injection target class if this class was injected,...
DLLEXPORT const QoreTypeInfo * getOrNothingTypeInfo() const
returns the "or nothing" type information structure for this class
DLLEXPORT const QoreMethod * findMethod(const char *nme) const
finds a normal (non-static) method in the class hierarchy
DLLEXPORT bool isModulePublic() const
returns true if the class has its module public flag set
DLLEXPORT const QoreMethod * getMethodGate() const
returns a const pointer to the QoreMethod object of the methodGate method, if any is set
DLLEXPORT const char * getModuleName() const
Returns the module name the class was loaded from or nullptr if it is a builtin class.
DLLEXPORT const QoreMethod * findStaticMethod(const char *nme, ClassAccess &access) const
finds a static method in the class hierarchy and sets the priv flag if it's a private method or not
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())
adds a constructor method variant with the external calling convention and includes the access specif...
DLLEXPORT const QoreMethod * getMemberNotificationMethod() const
returns a const pointer to the QoreMethod object of the memberNotification method,...
DLLEXPORT QoreClass(const char *n_name, const char *ns_path, int64 n_domain=QDOM_DEFAULT)
creates the QoreClass object and assigns the name and the functional domain
DLLEXPORT void addBuiltinStaticVar(const char *name, QoreValue value, ClassAccess access=Public, const QoreTypeInfo *typeInfo=nullptr)
adds a static variable to the class
DLLEXPORT void recheckBuiltinMethodHierarchy()
rechecks for inherited methods in base classes when adding builtin classes
DLLEXPORT qore_classid_t getID() const
returns the class ID of this class
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
DLLEXPORT const void * getUserData() const
retrieves the user-specific data pointer
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 QoreValue evalPseudoMethod(const QoreMethod *m, const QoreExternalMethodVariant *variant, const QoreValue n, 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)
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 void addMember(const char *mem, ClassAccess access, const QoreTypeInfo *n_typeInfo, QoreValue initial_value=QoreValue())
adds a member
DLLEXPORT qore_type_t getPseudoClassType() const
returns a pseudo-classes base type
DLLEXPORT bool hasCopy() const
returns true if the class implements a copy method
DLLEXPORT const QoreMethod * getCopyMethod() const
returns a const pointer to the QoreMethod object of the destructor method, if any is set
DLLEXPORT bool hasMethodGate() const
returns true if the class implements a "methodGate" method
DLLEXPORT q_deserializer_t getDeserializer() const
returns the deserializer method or nullptr if not present
DLLEXPORT void addBuiltinBaseClass(QoreClass *qc)
make a builtin class a child of another builtin class
DLLEXPORT void addBaseClass(QoreClass *qc, bool virt=false)
Adds a base class to the current class.
DLLEXPORT void setPublicMemberFlag()
sets the class's public member flag so that undeclared member references will fail
DLLEXPORT AbstractQoreNode * getNewObjectExpression(QoreListNode *args=nullptr) const
Returns an expression that can be used to create a new object when executed.
DLLEXPORT QoreClass(const QoreClass &old)
copy constructor
DLLEXPORT const QoreClass * getClass(const QoreClass &qc, bool &priv) const
returns a pointer to the QoreClass object representing the class ID passed if it exists in the class ...
DLLEXPORT QoreValue setKeyValue(const std::string &key, QoreValue val)
Sets a key value in the class's key-value store unconditionally.
DLLEXPORT const QoreMethod * findLocalStaticMethod(const char *name) const
finds a static method in the class hierarchy
DLLEXPORT bool isSystem() const
returns true if the class is a builtin class
DLLEXPORT const QoreClass * getInjectedAsClass() const
returns the class pointer for any injection target class if this class was injected,...
DLLEXPORT int numStaticMethods() const
returns the number of static methods in this class (user and builtin)
DLLEXPORT QoreClass(std::string &&n_name, std::string &&ns_path, int64 n_domain=QDOM_DEFAULT)
creates the QoreClass object and assigns the name and the functional domain
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())
adds a builtin method variant to a class with the calling convention for external modules
DLLEXPORT bool hasMemberNotification() const
returns true if the class implements a "memberNotification" method
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
DLLEXPORT const QoreExternalConstant * findConstant(const char *name) const
Finds the given constant or returns nullptr if not found.
DLLEXPORT void setDestructor(const void *ptr, q_external_destructor_t m)
sets the builtin destructor method for the class with the external calling convention
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())
adds an unimplemented abstract method variant to the class with return and parameter type info
DLLEXPORT const char * getName() const
returns the class name
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 const QoreMethod * findMethod(const char *nme, ClassAccess &access) const
finds a normal (non-static) method in the class hierarchy at runtime and sets the access code
DLLEXPORT const QoreMethod * findStaticMethod(const char *nme) const
finds a static method in the class hierarchy
DLLEXPORT q_serializer_t getSerializer() const
returns the serializer method or nullptr if not present
DLLEXPORT QoreValue evalPseudoMethod(const QoreValue n, const char *nme, const QoreListNode *args, ExceptionSink *xsink) const
evaluates a pseudo-method on a pseudo-class
DLLEXPORT const QoreMethod * getConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set
DLLEXPORT bool isInjected() const
returns true if the class has been injected as a dependency injection
DLLEXPORT void setCopy(q_copy_t m)
sets the builtin copy method for the class
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 std::string getNamespacePath(bool anchored=false) const
returns the full namespace path of the class
DLLEXPORT const QoreMethod * findLocalMethod(const char *name) const
finds a normal (non-static) method in the class hierarchy
DLLEXPORT BinaryNode * getBinaryHash() const
returns a binary hash for the class's API
DLLEXPORT bool hasParentClass() const
returns true if the class has one or more parent classes
DLLEXPORT void setSystemConstructor(q_system_constructor_t m)
sets the builtin constructor for system objects (ex: used as constant values)
DLLEXPORT const QoreClass * getClass(qore_classid_t cid, bool &priv) const
returns a pointer to the QoreClass object representing the class ID passed if it exists in the class ...
DLLEXPORT bool isFinal() const
returns true if the class is final
DLLEXPORT bool setKeyValueIfNotSet(const std::string &key, const char *str)
Sets a key value in the class's key-value store only if no value exists for the given key.
DLLEXPORT const QoreNamespace * getNamespace() const
Returns the namespace that owns this class.
DLLEXPORT void setSynchronousClass()
call this function if your builtin class requires *all* methods (except the constructor) to be run in...
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,...
iterates normal (non-static) members of a class
Definition QoreClass.h:1281
DLLEXPORT const QoreExternalNormalMember & getMember() const
returns the member
DLLEXPORT ~QoreClassMemberIterator()
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 bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT const char * getName() const
returns the member's name
DLLEXPORT QoreClassMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
iterates static members of a class
Definition QoreClass.h:1308
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT QoreClassStaticMemberIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT const char * getName() const
returns the member's name
DLLEXPORT ~QoreClassStaticMemberIterator()
destroys the object
DLLEXPORT const QoreExternalStaticMember & getMember() const
returns the member
A holder class for AbstractQoreClassUserData objects.
Definition QoreClass.h:255
DLLLOCAL AbstractQoreClassUserData * release()
Returns the user data object if still managed.
Definition QoreClass.h:269
DLLLOCAL const AbstractQoreClassUserData * operator*() const
Returns the user data object, if any.
Definition QoreClass.h:281
DLLLOCAL ~QoreClassUserDataHolder()
Destroys the object by calling doDeref() on the user data object if it's still managed.
Definition QoreClass.h:262
DLLLOCAL AbstractQoreClassUserData * operator->()
Returns the user data object, if any.
Definition QoreClass.h:296
DLLLOCAL const AbstractQoreClassUserData * operator->() const
Returns the user data object, if any.
Definition QoreClass.h:291
DLLLOCAL AbstractQoreClassUserData * operator*()
Returns the user data object, if any.
Definition QoreClass.h:286
DLLLOCAL QoreClassUserDataHolder(AbstractQoreClassUserData *d)
Creates the object.
Definition QoreClass.h:258
external wrapper class for constants
Definition QoreReflection.h:200
external wrapper base class for class members
Definition QoreReflection.h:137
external wrapper class for method variants
Definition QoreReflection.h:90
external wrapper base class for class normal members
Definition QoreReflection.h:174
external wrapper class for source code location information
Definition QoreReflection.h:187
external wrapper base class for class static members
Definition QoreReflection.h:153
external wrapper class for function and call variants
Definition QoreReflection.h:38
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition QoreListNode.h:52
a method in a QoreClass
Definition QoreClass.h:143
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 std::string & getNameStr() const
returns the method's name
DLLEXPORT bool isBuiltin() const
returns true if all variants of the method are builtin variants
DLLEXPORT const char * getClassName() const
returns the class name for the method
DLLEXPORT const char * getName() const
returns the method's name
DLLEXPORT bool existsVariant(const type_vec_t &paramTypeInfo) const
returns true if a variant with the given parameter signature already exists in the method
DLLEXPORT bool isStatic() const
returns true if the method is static
DLLEXPORT bool isUser() const
returns true if all variants of the method are user variants
DLLEXPORT ClassAccess getAccess() const
returns the lowest access code of all variants in the method
DLLEXPORT bool isPrivate() const
returns true if all overloaded variants of a methods are private or class internal,...
DLLEXPORT const QoreExternalMethodFunction * getFunction() const
returns the function for the method
DLLEXPORT method_type_e getMethodType() const
returns the type of method
DLLEXPORT const QoreClass * getClass() const
returns a pointer to the parent class
To be used to iterate through a class's normal (non-static) methods.
Definition QoreClass.h:1174
contains constants, classes, and subnamespaces in QoreProgram objects
Definition QoreNamespace.h:65
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition QoreObject.h:61
iterates parent classes for a class with inheritance access information
Definition QoreClass.h:1254
DLLEXPORT const QoreClass & getParentClass() const
returns the parent class
DLLEXPORT ~QoreParentClassIterator()
destroys the object
DLLEXPORT bool valid() const
returns true if the iterator is pointing at a valid element
DLLEXPORT bool next()
returns advances to the next element (or to the first element if starting to iterate) and returns tru...
DLLEXPORT QoreParentClassIterator(const QoreClass &cls)
creates the iterator; call next() to start iterating
DLLEXPORT ClassAccess getAccess() const
returns the access of the parent class
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition QoreProgram.h:128
To be used to iterate through a class's static methods.
Definition QoreClass.h:1186
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:393
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:456
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition common.h:76
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:406
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:355
void(* q_copy_t)(QoreObject *self, QoreObject *old, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass copy signatures
Definition common.h:465
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:438
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:378
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:426
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition common.h:257
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:486
void(* q_destructor_t)(QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures
Definition common.h:446
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:476
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition common.h:85
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition common.h:263
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:498
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:266
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:414
std::vector< QoreValue > arg_vec_t
vector of value information for default argument lists
Definition common.h:260
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition params.h:54
The main value class in Qore, designed to be passed by value.
Definition QoreValue.h:279