32 #ifndef _QORE_QORECLASSLIST_H
34 #define _QORE_QORECLASSLIST_H
38 #include <qore/QoreClass.h>
50 DLLLOCAL cl_rec_t(
QoreClass* c,
bool p) : cls(c), priv(p) {
59 #ifdef HAVE_QORE_HASH_MAPX
61 #include <qore/hash_map_include.h>
62 #include "qore/intern/xxhash.h"
64 typedef HASH_MAP<const char*, cl_rec_t, qore_hash_str, eqstr> hm_qc_t;
67 typedef std::map<const char*, cl_rec_t, ltstr> hm_qc_t;
71 class QoreNamespaceList;
73 class ClassListIterator;
74 class ConstClassListIterator;
77 friend class ClassListIterator;
78 friend class ConstClassListIterator;
85 DLLLOCAL
void deleteAll();
87 DLLLOCAL
void addInternal(
QoreClass* ot,
bool priv);
90 DLLLOCAL QoreClassList() : ns_const(false), ns_vars(false) {}
91 DLLLOCAL ~QoreClassList();
92 DLLLOCAL QoreClassList(
const QoreClassList& old,
int64 po, qore_ns_private* ns);
94 DLLLOCAL
void mergeUserPublic(
const QoreClassList& old, qore_ns_private* ns);
97 DLLLOCAL
int importSystemClasses(
const QoreClassList& source, qore_ns_private* ns,
ExceptionSink* xsink);
100 DLLLOCAL
QoreClass* find(
const char* name);
101 DLLLOCAL
const QoreClass* find(
const char* name)
const;
102 DLLLOCAL
void resolveCopy();
103 DLLLOCAL
void parseResolveHierarchy();
104 DLLLOCAL
void parseResolveClassMembers();
105 DLLLOCAL
int parseInit();
106 DLLLOCAL
void parseResolveAbstract();
107 DLLLOCAL
void parseRollback();
108 DLLLOCAL
void parseCommit();
110 DLLLOCAL
void reset();
111 DLLLOCAL
void assimilate(QoreClassList& n, qore_ns_private& ns);
118 DLLLOCAL
bool empty()
const {
126 DLLLOCAL
void deleteClassData(
bool deref_vars,
ExceptionSink* xsink);
129 class ClassListIterator {
135 DLLLOCAL ClassListIterator(QoreClassList& n_cl) : cl(n_cl.hm), i(cl.end()) {
138 DLLLOCAL
bool next() {
143 return i != cl.end();
146 DLLLOCAL
const char* getName()
const {
151 return i->second.cls;
154 DLLLOCAL
bool isPublic()
const;
156 DLLLOCAL
bool isUserPublic()
const;
159 class ConstClassListIterator {
162 hm_qc_t::const_iterator i;
165 DLLLOCAL ConstClassListIterator(
const QoreClassList& n_cl) : cl(n_cl.hm), i(cl.end()) {
168 DLLLOCAL
bool next() {
173 return i != cl.end();
176 DLLLOCAL
const char* getName()
const {
181 return i->second.cls;
184 DLLLOCAL
bool isPublic()
const;
186 DLLLOCAL
bool isUserPublic()
const;
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
defines a Qore-language class
Definition: QoreClass.h:249
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
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