42 #ifndef _QORE_QORENAMESPACE_H
44 #define _QORE_QORENAMESPACE_H
52 class AbstractQoreFunctionVariant;
64 friend class QoreNamespaceList;
66 friend class qore_ns_private;
67 friend class qore_root_ns_private;
68 friend struct NSOInfoBase;
75 DLLLOCAL QoreNamespace& operator=(
const QoreNamespace&);
78 class qore_ns_private* priv;
81 DLLLOCAL QoreNamespace(qore_ns_private* p);
88 DLLEXPORT QoreNamespace(
const char* n);
136 DLLEXPORT QoreNamespace*
copy(
int po)
const;
173 DLLEXPORT
const char*
getName()
const;
224 DLLEXPORT
const QoreNamespace*
getParent()
const;
230 DLLEXPORT
void addBuiltinVariant(
const char* name,
q_func_n_t f,
int64 code_flags = QC_NO_FLAGS,
int64 functional_domain =
QDOM_DEFAULT,
const QoreTypeInfo* returnTypeInfo = 0,
unsigned num_params = 0, ...);
233 DLLEXPORT
void addBuiltinVariant(
const char* name,
q_func_t f,
int64 code_flags = QC_NO_FLAGS,
int64 functional_domain =
QDOM_DEFAULT,
const QoreTypeInfo* returnTypeInfo = 0,
unsigned num_params = 0, ...);
251 friend class qore_ns_private;
252 friend class qore_root_ns_private;
253 friend class StaticSystemNamespace;
260 class qore_root_ns_private* rpriv;
273 class QorePrivateNamespaceIterator;
280 QorePrivateNamespaceIterator* priv;
286 DLLEXPORT
bool next();
308 QorePrivateNamespaceIterator* priv;
314 DLLEXPORT
bool next();
324 #endif // QORE_NAMESPACE_H
DLLEXPORT const QoreNamespace * getParent() const
returns a pointer to the parent namespace or 0 if there is no parent
#define PO_DEFAULT
no parse options set by default
Definition: Restrictions.h:98
allows namespaces to be iterated
Definition: QoreNamespace.h:278
DLLEXPORT const QoreNamespace * operator->() const
returns the namespace
This is the hash or associative list container type in Qore, dynamically allocated only...
Definition: QoreHashNode.h:50
DLLEXPORT void setClassHandler(q_ns_class_handler_t class_handler)
sets the namespace class handler
DLLEXPORT ~QoreNamespace()
destroys the object and frees all associated memory
DLLEXPORT QoreNamespace * findLocalNamespace(const char *nsname) const
finds a subnamespace in this namespace, does not search child namespaces
DLLEXPORT void addNamespace(QoreNamespace *ns)
adds a namespace to the namespace tree
DLLEXPORT QoreNamespace * operator*()
returns the namespace
DLLEXPORT void clear(ExceptionSink *xsink)
clears the contents of the namespace before deleting
DLLEXPORT const QoreNamespace * operator*() const
returns the namespace
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:54
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:63
int64(* q_func_int64_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning an integer value
Definition: common.h:264
DLLEXPORT bool next()
moves to the next position; returns true if on a valid position
DLLEXPORT QoreHashNode * getConstantInfo() const
a hash of all constants in the namespace, the hash keys are the constant names and the values are the...
DLLEXPORT const char * getName() const
returns the name of the namespace
DLLEXPORT QoreNamespace * copy(int po) const
returns a deep copy of the namespace; DEPRECATED: use copy(int64) instead
DLLEXPORT QoreNamespaceIterator(QoreNamespace *ns)
creates the iterator
allows namespaces to be iterated
Definition: QoreNamespace.h:306
DLLEXPORT QoreHashNode * getClassInfo() const
gets a hash of all classes in the namespace, the hash keys are the class names and the values are lis...
DLLEXPORT QoreNamespace * rootGetQoreNamespace() const
returns a pointer to the QoreNamespace for the "Qore" namespace
AbstractQoreNode *(* q_func_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:261
the root namespace of a QoreProgram object
Definition: QoreNamespace.h:250
double(* q_func_double_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning an double value
Definition: common.h:270
defines a Qore-language class
Definition: QoreClass.h:214
DLLEXPORT QoreNamespace * operator->()
returns the namespace
DLLEXPORT void addInitialNamespace(QoreNamespace *ns)
adds a subnamespace to the namespace
DLLEXPORT QoreNamespace * findCreateNamespacePath(const char *nspath)
finds a Namespace based on the argument; creates it (or the whole path) if necessary ...
DLLEXPORT QoreNamespaceConstIterator(const QoreNamespace *ns)
creates the iterator
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:62
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:47
DLLEXPORT void addSystemHashDecl(TypedHashDecl *hashdecl)
adds a hashdecl to a namespace
DLLEXPORT QoreClass * findLocalClass(const char *cname) const
finds a class in this namespace, does not search child namespaces
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:241
DLLEXPORT QoreHashNode * getInfo() const
returns a hash giving information about the definitions in the namespace
typed hash declaration
Definition: TypedHashDecl.h:42
QoreValue(* q_func_n_t)(const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:253
DLLEXPORT void deleteData(ExceptionSink *xsink)
this function must be called before the QoreNamespace object is deleted or a crash could result due i...
DLLEXPORT bool next()
moves to the next position; returns true if on a valid position
DLLEXPORT void addSystemClass(QoreClass *oc)
adds a class to a namespace
DLLEXPORT void addConstant(const char *name, AbstractQoreNode *value)
adds a constant definition to the namespace
DLLLOCAL ~RootQoreNamespace()
destructor is not exported in the library's public API
bool(* q_func_bool_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures returning a boolean value
Definition: common.h:267
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:146