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) {
55 #include <qore/vector_map>
56 typedef vector_map_t<const char*, cl_rec_t> hm_qc_t;
70 class QoreNamespaceList;
72 class ClassListIterator;
73 class ConstClassListIterator;
76 friend class ClassListIterator;
77 friend class ConstClassListIterator;
84 DLLLOCAL
void deleteAll();
86 DLLLOCAL
void remove(hm_qc_t::iterator i);
88 DLLLOCAL
void addInternal(
QoreClass* ot,
bool priv);
91 DLLLOCAL QoreClassList() : ns_const(false), ns_vars(false) {}
92 DLLLOCAL ~QoreClassList();
93 DLLLOCAL QoreClassList(
const QoreClassList& old,
int64 po, qore_ns_private* ns);
95 DLLLOCAL
void mergeUserPublic(
const QoreClassList& old, qore_ns_private* ns);
98 DLLLOCAL
int importSystemClasses(
const QoreClassList& source, qore_ns_private* ns,
ExceptionSink* xsink);
101 DLLLOCAL
QoreClass* find(
const char* name);
102 DLLLOCAL
const QoreClass* find(
const char* name)
const;
103 DLLLOCAL
void resolveCopy();
104 DLLLOCAL
void parseResolveHierarchy();
105 DLLLOCAL
void parseResolveClassMembers();
106 DLLLOCAL
void parseInit();
107 DLLLOCAL
void parseResolveAbstract();
108 DLLLOCAL
void parseRollback();
109 DLLLOCAL
void parseCommit();
111 DLLLOCAL
void reset();
112 DLLLOCAL
void assimilate(QoreClassList& n, qore_ns_private& ns);
119 DLLLOCAL
bool empty()
const {
127 DLLLOCAL
void deleteClassData(
bool deref_vars,
ExceptionSink* xsink);
130 class ClassListIterator {
136 DLLLOCAL ClassListIterator(QoreClassList& n_cl) : cl(n_cl.hm), i(cl.end()) {
139 DLLLOCAL
bool next() {
144 return i != cl.end();
147 DLLLOCAL
const char* getName()
const {
152 return i->second.cls;
155 DLLLOCAL
bool isPublic()
const;
157 DLLLOCAL
bool isUserPublic()
const;
160 class ConstClassListIterator {
163 hm_qc_t::const_iterator i;
166 DLLLOCAL ConstClassListIterator(
const QoreClassList& n_cl) : cl(n_cl.hm), i(cl.end()) {
169 DLLLOCAL
bool next() {
174 return i != cl.end();
177 DLLLOCAL
const char* getName()
const {
182 return i->second.cls;
185 DLLLOCAL
bool isPublic()
const;
187 DLLLOCAL
bool isUserPublic()
const;
190 #endif // _QORE_QORECLASSLIST_H