All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
QoreClass.h
/* -*- mode: c++; indent-tabs-mode: nil -*- */
/*
QoreClass.h
Qore Programming Language
Copyright (C) 2003 - 2017 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Note that the Qore library is released under a choice of three open-source
licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
information.
*/
#ifndef _QORE_QORECLASS_H
#define _QORE_QORECLASS_H
#include <stdarg.h>
#include <string>
// all qore class IDs
DLLEXPORT extern qore_classid_t CID_AUTOGATE;
DLLEXPORT extern qore_classid_t CID_AUTOLOCK;
DLLEXPORT extern qore_classid_t CID_AUTOREADLOCK;
DLLEXPORT extern qore_classid_t CID_AUTOWRITELOCK;
DLLEXPORT extern qore_classid_t CID_CONDITION;
DLLEXPORT extern qore_classid_t CID_COUNTER;
DLLEXPORT extern qore_classid_t CID_DATASOURCE;
DLLEXPORT extern qore_classid_t CID_DATASOURCEPOOL;
DLLEXPORT extern qore_classid_t CID_FILE;
DLLEXPORT extern qore_classid_t CID_FTPCLIENT;
DLLEXPORT extern qore_classid_t CID_GATE;
DLLEXPORT extern qore_classid_t CID_GETOPT;
DLLEXPORT extern qore_classid_t CID_HTTPCLIENT;
DLLEXPORT extern qore_classid_t CID_MUTEX;
DLLEXPORT extern qore_classid_t CID_PROGRAM;
DLLEXPORT extern qore_classid_t CID_PROGRAMDEBUG;
DLLEXPORT extern qore_classid_t CID_QUEUE;
DLLEXPORT extern qore_classid_t CID_RWLOCK;
DLLEXPORT extern qore_classid_t CID_SSLCERTIFICATE;
DLLEXPORT extern qore_classid_t CID_SSLPRIVATEKEY;
DLLEXPORT extern qore_classid_t CID_SEQUENCE;
DLLEXPORT extern qore_classid_t CID_SOCKET;
DLLEXPORT extern qore_classid_t CID_TERMIOS;
DLLEXPORT extern qore_classid_t CID_INPUTSTREAM;
DLLEXPORT extern qore_classid_t CID_OUTPUTSTREAM;
DLLEXPORT extern QoreClass* QC_QUEUE;
DLLEXPORT extern QoreClass* QC_HTTPCLIENT;
class BCList;
class BCSMList;
class BCAList;
class QoreObject;
class QoreClass;
class BCEAList;
class ParamList;
class QoreMemberInfo;
class BuiltinMethod;
class AbstractQoreFunctionVariant;
class AbstractFunctionSignature;
class UserMethod;
class BCANode;
class qore_method_private;
class MethodFunctionBase;
class QoreExternalMethodVariant;
class QoreExternalStaticMethodVariant;
class NamedScope;
class ConstantList;
class MethodVariantBase;
class QoreMethod {
friend class StaticMethodCallNode;
friend class QoreObject;
friend class qore_class_private;
friend class qore_method_private;
friend class BCList;
private:
class qore_method_private* priv;
DLLLOCAL QoreMethod(const QoreMethod&);
DLLLOCAL QoreMethod& operator=(const QoreMethod&);
public:
DLLEXPORT bool isSynchronized() const;
DLLEXPORT bool newCallingConvention() const;
DLLEXPORT bool isUser() const;
DLLEXPORT bool isBuiltin() const;
DLLEXPORT bool isPrivate() const;
DLLEXPORT ClassAccess getAccess() const;
DLLEXPORT bool isStatic() const;
DLLEXPORT const char* getName() const;
DLLEXPORT const std::string& getNameStr() const;
DLLEXPORT const QoreClass* getClass() const;
DLLEXPORT const char* getClassName() const;
DLLEXPORT bool existsVariant(const type_vec_t& paramTypeInfo) const;
/* returns the return type information for the method if it is available and if
there is only one return type (there can be more return types if the method is
overloaded)
*/
DLLEXPORT const QoreTypeInfo* getUniqueReturnTypeInfo() const;
DLLEXPORT QoreValue execManaged(QoreObject* self, const QoreListNode* args, ExceptionSink* xsink) const;
DLLLOCAL QoreMethod(const QoreClass* p_class, MethodFunctionBase* n_func, bool n_static = false);
DLLLOCAL ~QoreMethod();
DLLLOCAL bool inMethod(const QoreObject* self) const;
DLLLOCAL QoreMethod* copy(const QoreClass* p_class) const;
DLLLOCAL void assign_class(const QoreClass* p_class);
DLLLOCAL MethodFunctionBase* getFunction() const;
};
class AbstractQoreClassUserData {
public:
DLLEXPORT virtual ~AbstractQoreClassUserData();
virtual AbstractQoreClassUserData* copy() const = 0;
virtual void doDeref() = 0;
};
class QoreClass {
friend class BCList;
friend class BCNode;
friend class BCSMList;
friend class qore_object_private;
friend class qore_class_private;
friend class QoreObject;
friend class BCANode;
friend class qore_method_private;
friend class QoreMethodIterator;
friend class QoreStaticMethodIterator;
friend class ConstructorMethodFunction;
public:
DLLEXPORT QoreClass(const char* n_name, int64 n_domain = QDOM_DEFAULT);
DLLEXPORT explicit QoreClass(const char* n_name, int n_domain);
DLLEXPORT QoreClass(const char* n_name, int64 n_domain, const QoreTypeInfo* n_typeInfo);
DLLEXPORT QoreClass(const QoreClass &old);
DLLEXPORT void addMethod(const char* n_name, q_method_n_t meth, ClassAccess access = Public, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodVariant(const void* ptr, const char* n_name, q_external_method_t meth, ClassAccess access = Public, int64 n_flags = QC_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());
DLLEXPORT void addStaticMethod(const char* n_name, q_func_n_t meth, ClassAccess access = Public, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodVariant(const void* ptr, const char* n_name, q_external_static_method_t meth, ClassAccess access = Public, int64 n_flags = QC_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());
DLLEXPORT void addMethod(const char* n_name, q_method_n_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethod(const char* n_name, q_func_n_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethod(const char* n_name, q_method_t meth, bool priv = false);
DLLEXPORT void addMethodExtended(const char* n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtended(const char* n_name, q_method_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtendedList(const char* n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addMethod2(const char* n_name, q_method2_t meth, bool priv = false);
DLLEXPORT void addMethodExtended2(const char* n_name, q_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtendedList2(const char* n_name, q_method2_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addMethodExtendedList3(const void* ptr, const char* n_name, q_method3_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addMethodExtended3(const char* n_name, q_method_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtended3(const char* n_name, q_method_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtended3(const char* n_name, q_method_bool_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addMethodExtended3(const char* n_name, q_method_double_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addAbstractMethodVariant(const char* n_name, ClassAccess access = Public, int64 n_flags = QC_NO_FLAGS, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addAbstractMethodVariant(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());
DLLEXPORT void addAbstractMethodVariantExtended3(const char* n_name, bool priv = false, int64 n_flags = QC_NO_FLAGS, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethod(const char* n_name, q_func_t meth, bool priv = false);
DLLEXPORT void addStaticMethodExtended(const char* n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodExtendedList(const char* n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addStaticMethod2(const char* n_name, q_static_method2_t meth, bool priv = false);
DLLEXPORT void addStaticMethodExtended2(const char* n_name, q_static_method2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodExtendedList2(const char* n_name, q_static_method2_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addStaticMethodExtendedList3(const void* ptr, const char* n_name, q_static_method3_t meth, bool priv = false, int64 n_flags = QC_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());
DLLEXPORT void addStaticMethodExtended3(const char* n_name, q_func_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodExtended3(const char* n_name, q_func_int64_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodExtended3(const char* n_name, q_func_bool_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void addStaticMethodExtended3(const char* n_name, q_func_double_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const QoreTypeInfo* returnTypeInfo = 0, unsigned num_params = 0, ...);
DLLEXPORT void setDestructor(q_destructor_t m);
DLLEXPORT void setDestructor2(q_destructor2_t m);
DLLEXPORT void setDestructor3(const void* ptr, q_destructor3_t m);
DLLEXPORT void addConstructor(q_constructor_n_t meth, ClassAccess access = Public, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
DLLEXPORT void addConstructorVariant(const void* ptr, q_external_constructor_t meth, ClassAccess access = Public, int64 n_flags = QC_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());
DLLEXPORT void addConstructor(q_constructor_n_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
DLLEXPORT void setConstructor(q_constructor_t m);
/*
@deprecated use addConstructor(q_constructor_n_t, ClassAccess, int64, int64, unsigned, ...) instead
*/
DLLEXPORT void setConstructorExtended(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
/*
@deprecated use addConstructor(q_constructor_n_t, ClassAccess, int64, int64, unsigned, ...) instead
*/
DLLEXPORT void setConstructorExtendedList(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t& n_typeList = type_vec_t(), const arg_vec_t& defaultArgList = arg_vec_t());
DLLEXPORT void setConstructor2(q_constructor2_t m);
/*
@deprecated use addConstructor(q_constructor_n_t, ClassAccess, int64, int64, unsigned, ...) instead
*/
DLLEXPORT void setConstructorExtended2(q_constructor2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
/*
@deprecated use addConstructor(q_constructor_n_t, ClassAccess, int64, int64, unsigned, ...) instead
*/
DLLEXPORT void setConstructorExtendedList2(q_constructor2_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t& n_typeList = type_vec_t(), const arg_vec_t& defaultArgList = arg_vec_t());
DLLEXPORT void setConstructorExtendedList3(const void* ptr, q_constructor3_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, const type_vec_t& n_typeList = type_vec_t(), const arg_vec_t& defaultArgList = arg_vec_t());
/*
@deprecated use addConstructor(q_constructor_n_t, ClassAccess, int64, int64, unsigned, ...) instead
*/
DLLEXPORT void setConstructorExtended3(q_constructor_t meth, bool priv = false, int64 n_flags = QC_NO_FLAGS, int64 n_domain = QDOM_DEFAULT, unsigned num_params = 0, ...);
DLLEXPORT void setSystemConstructor(q_system_constructor_t m);
DLLEXPORT void setSystemConstructor2(q_system_constructor2_t m);
DLLEXPORT void setCopy(q_copy_t m);
DLLEXPORT void setCopy2(q_copy2_t m);
DLLEXPORT void setCopy3(const void* ptr, q_copy3_t m);
DLLEXPORT void setDeleteBlocker(q_delete_blocker_t m);
DLLEXPORT void setFinal();
DLLEXPORT bool isPrivateMember(const char* str) const;
DLLEXPORT bool isPublicOrPrivateMember(const char* str, bool& priv) const;
DLLEXPORT QoreObject* execConstructor(const QoreValueList* args, ExceptionSink* xsink) const;
DLLEXPORT QoreObject* execConstructor(const QoreListNode* args, ExceptionSink* xsink) const;
DLLEXPORT QoreObject* execSystemConstructor(int code = 0, ...) const;
DLLEXPORT QoreObject* execCopy(QoreObject* old, ExceptionSink* xsink) const;
DLLEXPORT const QoreMethod* findLocalMethod(const char* name) const;
DLLEXPORT const QoreMethod* findLocalStaticMethod(const char* name) const;
DLLEXPORT QoreListNode* getMethodList() const;
DLLEXPORT QoreListNode* getStaticMethodList() const;
DLLEXPORT QoreClass* getClass(qore_classid_t cid) const;
DLLEXPORT const QoreClass* getClass(qore_classid_t cid, bool& priv) const;
DLLEXPORT const QoreClass* getClass(const QoreClass& qc, bool& priv) const;
DLLEXPORT int numMethods() const;
DLLEXPORT int numStaticMethods() const;
DLLEXPORT int numUserMethods() const;
DLLEXPORT int numStaticUserMethods() const;
DLLEXPORT bool hasCopy() const;
DLLEXPORT qore_classid_t getID() const;
DLLEXPORT bool isSystem() const;
DLLEXPORT void setSystem();
DLLEXPORT bool hasMemberGate() const;
DLLEXPORT bool hasMethodGate() const;
DLLEXPORT bool hasMemberNotification() const;
DLLEXPORT int getDomain() const;
DLLEXPORT int64 getDomain64() const;
DLLEXPORT const char* getName() const;
// used at run-time
DLLEXPORT const QoreMethod* findMethod(const char* nme) const;
// used at run-time
DLLEXPORT const QoreMethod* findStaticMethod(const char* nme) const;
DLLEXPORT const QoreMethod* findMethod(const char* nme, bool& priv) const;
DLLEXPORT const QoreMethod* findMethod(const char* nme, ClassAccess& access) const;
DLLEXPORT const QoreMethod* findStaticMethod(const char* nme, bool& priv) const;
DLLEXPORT const QoreMethod* findStaticMethod(const char* nme, ClassAccess& access) const;
DLLEXPORT void addBuiltinBaseClass(QoreClass* qc, QoreListNode* xargs = 0);
DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass* qc, QoreListNode* xargs = 0);
DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass* qc);
DLLEXPORT void setSynchronousClass();
DLLEXPORT const QoreMethod* getConstructor() const;
DLLEXPORT const QoreMethod* getSystemConstructor() const;
DLLEXPORT const QoreMethod* getDestructor() const;
DLLEXPORT const QoreMethod* getCopyMethod() const;
DLLEXPORT const QoreMethod* getMemberGateMethod() const;
DLLEXPORT const QoreMethod* getMethodGate() const;
DLLEXPORT const QoreMethod* getMemberNotificationMethod() const;
DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
DLLEXPORT const QoreTypeInfo* getOrNothingTypeInfo() const;
DLLEXPORT void addMember(const char* mem, ClassAccess access, const QoreTypeInfo* n_typeInfo, AbstractQoreNode* initial_value = 0);
DLLEXPORT void addPublicMember(const char* mem, const QoreTypeInfo* n_typeInfo, AbstractQoreNode* initial_value = 0);
DLLEXPORT void addPrivateMember(const char* mem, const QoreTypeInfo* n_typeInfo, AbstractQoreNode* initial_value = 0);
DLLEXPORT void setUserData(const void* ptr);
DLLEXPORT const void* getUserData() const;
DLLEXPORT void setManagedUserData(AbstractQoreClassUserData* cud);
DLLEXPORT AbstractQoreClassUserData* getManagedUserData() const;
template <typename T>
DLLLOCAL T* getManagedUserData() const {
return static_cast<T*>(getManagedUserData());
}
DLLEXPORT void recheckBuiltinMethodHierarchy();
DLLEXPORT const QoreExternalMethodVariant* findUserMethodVariant(const char* name, const QoreMethod*& method, const type_vec_t& argTypeList) const;
DLLEXPORT void addBuiltinConstant(const char* name, AbstractQoreNode* value, bool priv = false, const QoreTypeInfo* typeInfo = 0);
DLLEXPORT void addBuiltinStaticVar(const char* name, AbstractQoreNode* value, bool priv = false, const QoreTypeInfo* typeInfo = 0);
DLLEXPORT void addBuiltinConstant(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = 0);
DLLEXPORT void addBuiltinStaticVar(const char* name, QoreValue value, ClassAccess access = Public, const QoreTypeInfo* typeInfo = 0);
DLLEXPORT bool hasAbstract() const;
DLLEXPORT void rescanParents();
DLLEXPORT void setPublicMemberFlag();
DLLEXPORT void setGateAccessFlag();
DLLLOCAL QoreClass();
// used when parsing, finds committed non-static methods within the entire class hierarchy (local class plus base classes)
DLLLOCAL const QoreMethod* parseFindCommittedMethod(const char* nme);
// returns 0 for success, -1 for error
DLLLOCAL int parseAddBaseClassArgumentList(BCAList* bcal);
// only called when parsing, sets the name of the class
DLLLOCAL void setName(const char* n);
DLLLOCAL qore_classid_t getIDForMethod() const;
// get base class list to add virtual class indexes for private data
DLLLOCAL BCSMList* getBCSMList() const;
// returns true if the class has a delete_blocker function (somewhere in the hierarchy)
DLLLOCAL bool has_delete_blocker() const;
DLLLOCAL bool parseHasPublicMembersInHierarchy() const;
DLLLOCAL bool runtimeHasPublicMembersInHierarchy() const;
// returns true if the class has one or more parent classes
DLLLOCAL bool hasParentClass() const;
DLLLOCAL bool hasPrivateCopyMethod() const;
// returns the status including the pending variant (if any)
DLLLOCAL bool parseHasPrivateCopyMethod() const;
DLLLOCAL const QoreMethod* parseGetConstructor() const;
// returns true if the class implements a "methodGate" method, also in pending uncommitted methods
DLLLOCAL bool parseHasMethodGate() const;
// called when there is an empty public member declaration or a "no_public" declaration
DLLLOCAL void parseSetEmptyPublicMemberDeclaration();
// unsets the public member flag for builtin classes
DLLLOCAL void unsetPublicMemberFlag();
protected:
DLLEXPORT ~QoreClass();
private:
QoreClass& operator=(const QoreClass&) = delete;
class qore_class_private* priv;
// private constructor only called when the class is copied
DLLLOCAL QoreClass(qore_classid_t id, const char* nme);
DLLLOCAL void insertMethod(QoreMethod* o);
DLLLOCAL void insertStaticMethod(QoreMethod* o);
DLLLOCAL QoreValue evalMethodGate(QoreObject* self, const char* nme, const QoreListNode* args, ExceptionSink* xsink) const;
DLLLOCAL const QoreMethod* parseResolveSelfMethodIntern(const char* nme);
DLLLOCAL QoreValue evalMethod(QoreObject* self, const char* method_name, const QoreListNode* args, ExceptionSink* xsink) const;
// This function must only be called from QoreObject
DLLLOCAL QoreValue evalMemberGate(QoreObject* self, const QoreString *nme, ExceptionSink* xsink) const;
// This function must only be called from QoreObject
DLLLOCAL void execMemberNotification(QoreObject* self, const char* mem, ExceptionSink* xsink) const;
// This function must only be called from QoreObject and BCList
DLLLOCAL bool execDeleteBlocker(QoreObject* self, ExceptionSink* xsink) const;
// This function must only be called from QoreObject
DLLLOCAL void execDestructor(QoreObject* self, ExceptionSink* xsink) const;
};
class QoreMethodIterator {
private:
void* priv;
public:
DLLEXPORT QoreMethodIterator(const QoreClass* qc);
DLLEXPORT ~QoreMethodIterator();
DLLEXPORT bool next();
DLLEXPORT const QoreMethod* getMethod() const;
};
class QoreStaticMethodIterator {
private:
void* priv;
public:
DLLEXPORT QoreStaticMethodIterator(const QoreClass* qc);
DLLEXPORT ~QoreStaticMethodIterator();
DLLEXPORT bool next();
DLLEXPORT const QoreMethod* getMethod() const;
};
class QoreClassHolder {
public:
DLLLOCAL QoreClassHolder(QoreClass* c) : c(c) {
}
DLLEXPORT ~QoreClassHolder();
DLLLOCAL operator QoreClass*() const {
return c;
}
DLLLOCAL QoreClass* release() {
auto rv = c;
c = 0;
return rv;
}
private:
QoreClass* c;
};
class QoreBuiltinClass : public QoreClass {
public:
DLLEXPORT QoreBuiltinClass(const char* name, int64 n_domain = QDOM_DEFAULT);
DLLEXPORT QoreBuiltinClass(const QoreBuiltinClass& old);
};
#endif // _QORE_QORECLASS_H
QoreMethod::getNameStr
DLLEXPORT const std::string & getNameStr() const
returns the method&#39;s name
QoreClass::setUserData
DLLEXPORT void setUserData(const void *ptr)
sets a pointer to user-specific data in the class
QoreClass::getOrNothingTypeInfo
DLLEXPORT const QoreTypeInfo * getOrNothingTypeInfo() const
returns the &quot;or nothing&quot; type information structure for this class
QoreClass::findLocalMethod
DLLEXPORT const QoreMethod * findLocalMethod(const char *name) const
looks for a non-static method in the current class without searching base classes ...
QoreClass::addMethodExtended
DLLEXPORT void addMethodExtended(const char *n_name, q_method_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin method with extended information; additional functional domain info, return and parameter type info
q_copy3_t
void(* q_copy3_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:525
QoreClass::setCopy3
DLLEXPORT void setCopy3(const void *ptr, q_copy3_t m)
sets the builtin copy method for the class using the new generic calling convention ...
QoreClass::setDestructor
DLLEXPORT void setDestructor(q_destructor_t m)
sets the builtin destructor method for the class
QoreClass::getMemberNotificationMethod
DLLEXPORT const QoreMethod * getMemberNotificationMethod() const
returns a const pointer to the QoreMethod object of the memberNotification method, if any is set
QoreClass::addBuiltinVirtualBaseClass
DLLEXPORT void addBuiltinVirtualBaseClass(QoreClass *qc)
sets &quot;virtual&quot; base class for a class, meaning that the base class data is appropriate for use in the...
QoreClass::addMethodExtended2
DLLEXPORT void addMethodExtended2(const char *n_name, q_method2_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin method with the new calling convention and extended information; additional functional...
QoreMethodIterator
To be used to iterate through a class&#39;s normal (non-static) methods.
Definition: QoreClass.h:1168
QoreMethod::getClassName
DLLEXPORT const char * getClassName() const
returns the class name for the method
QoreClass::addStaticMethodExtendedList
DLLEXPORT void addStaticMethodExtendedList(const char *n_name, q_func_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin static method with extended information; additional functional domain info...
QoreClass::addMethodExtendedList2
DLLEXPORT void addMethodExtendedList2(const char *n_name, q_method2_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin method with the new calling convention and extended information; additional functional...
QoreClass::addBuiltinBaseClass
DLLEXPORT void addBuiltinBaseClass(QoreClass *qc, QoreListNode *xargs=0)
make a builtin class a child of another builtin class
QoreClass::getID
DLLEXPORT qore_classid_t getID() const
returns the class ID of this class
q_delete_blocker_t
bool(* q_delete_blocker_t)(QoreObject *self, AbstractPrivateData *private_data)
the typed used for QoreClass deleteBlocker signatures
Definition: common.h:533
QoreClass::execSystemConstructor
DLLEXPORT QoreObject * execSystemConstructor(int code=0,...) const
creates a new &quot;system&quot; object for use as the value of a constant, executes the system constructor on ...
QoreClass::setCopy
DLLEXPORT void setCopy(q_copy_t m)
sets the builtin copy method for the class
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...
q_static_method3_t
AbstractQoreNode *(* q_static_method3_t)(const QoreMethod &method, const type_vec_t &typeList, const void *ptr, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin static method signatures for static methods using the even newer generic ca...
Definition: common.h:403
QoreClass::isPublicOrPrivateMember
DLLEXPORT bool isPublicOrPrivateMember(const char *str, bool &priv) const
returns true if the member is private or public
QoreClass::setDeleteBlocker
DLLEXPORT void setDeleteBlocker(q_delete_blocker_t m)
sets the deleteBlocker method for the class
AbstractQoreClassUserData::doDeref
virtual void doDeref()=0
for non-reference counted classes, deletes the object immediately
QoreClass::addStaticMethod2
DLLEXPORT void addStaticMethod2(const char *n_name, q_static_method2_t meth, bool priv=false)
adds a builtin static method with the new generic calling convention
QoreClass::setConstructor2
DLLEXPORT void setConstructor2(q_constructor2_t m)
sets the builtin constructor method for the class using the new calling convention (or adds an overlo...
AbstractQoreClassUserData
an abstract class for class-specific external user data
Definition: QoreClass.h:198
QoreClass::numStaticMethods
DLLEXPORT int numStaticMethods() const
returns the number of static methods in this class (user and builtin)
q_method3_t
AbstractQoreNode *(* q_method3_t)(const QoreMethod &method, const type_vec_t &typeList, const void *ptr, QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:370
QoreValueList
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreValueList.h:45
QoreClass::numMethods
DLLEXPORT int numMethods() const
returns the number of non-static methods in this class (user and builtin)
QoreClass::hasMemberGate
DLLEXPORT bool hasMemberGate() const
returns true if the class implements a &quot;memberGate&quot; method
QoreClassHolder
allows for temporary storage of a QoreClass pointer
Definition: QoreClass.h:1194
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:54
QoreClass::addConstructorVariant
DLLEXPORT void addConstructorVariant(const void *ptr, q_external_constructor_t meth, ClassAccess access=Public, int64 n_flags=QC_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())
sets the constructor method with extended information; can set a private constructor, set additional functional domain info, and parameter type info (or adds an overloaded variant)
QoreClass::getUserData
DLLEXPORT const void * getUserData() const
retrieves the user-specific data pointer
q_func_int64_t
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
QoreClass::getDomain
DLLEXPORT int getDomain() const
returns the functional domain of the class
QoreClass::getDestructor
DLLEXPORT const QoreMethod * getDestructor() const
returns a const pointer to the QoreMethod object of the constructor method, if any is set ...
QoreClass::isSystem
DLLEXPORT bool isSystem() const
returns true if the class is a builtin class
AbstractQoreClassUserData::copy
virtual AbstractQoreClassUserData * copy() const =0
for reference-counted classes, returns the same object with the reference count incremented ...
QoreClass::getName
DLLEXPORT const char * getName() const
returns the class name
QoreClassHolder::release
DLLLOCAL QoreClass * release()
releases the QoreClass*
Definition: QoreClass.h:1209
QoreClass::hasAbstract
DLLEXPORT bool hasAbstract() const
returns true if the class has at least one abstract method variant
q_method2_t
AbstractQoreNode *(* q_method2_t)(const QoreMethod &method, QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the new generic calling conven...
Definition: common.h:357
QoreClass::setConstructorExtendedList3
DLLEXPORT void setConstructorExtendedList3(const void *ptr, q_constructor3_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const type_vec_t &n_typeList=type_vec_t(), const arg_vec_t &defaultArgList=arg_vec_t())
sets the constructor method using the new calling convention with extended information; can set a pri...
QoreClass::addBuiltinStaticVar
DLLEXPORT void addBuiltinStaticVar(const char *name, AbstractQoreNode *value, bool priv=false, const QoreTypeInfo *typeInfo=0)
adds a static variable to the class
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::getCopyMethod
DLLEXPORT const QoreMethod * getCopyMethod() const
returns a const pointer to the QoreMethod object of the destructor method, if any is set ...
QoreMethod::isUser
DLLEXPORT bool isUser() const
returns true if all variants of the method are user variants
q_system_constructor2_t
void(* q_system_constructor2_t)(const QoreClass &thisclass, QoreObject *self, int code, va_list args)
the type used for builtin QoreClass system constructor method signatures using the new generic callin...
Definition: common.h:468
QoreClass::addMethodExtendedList3
DLLEXPORT void addMethodExtendedList3(const void *ptr, const char *n_name, q_method3_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin method with the even newer calling convention and extended information; additional fun...
QoreClass::getMethodGate
DLLEXPORT const QoreMethod * getMethodGate() const
returns a const pointer to the QoreMethod object of the methodGate method, if any is set ...
q_method_int64_t
int64(* q_method_int64_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures, returns int64
Definition: common.h:316
QoreClass::setConstructorExtended3
DLLEXPORT void setConstructorExtended3(q_constructor_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, unsigned num_params=0,...)
sets the constructor method with extended information; can set a private constructor, set additional functional domain info, and parameter type info (or adds an overloaded variant)
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 ...
QoreClass::setManagedUserData
DLLEXPORT void setManagedUserData(AbstractQoreClassUserData *cud)
sets a pointer to user-specific data in the class
q_method_double_t
double(* q_method_double_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:346
QoreStaticMethodIterator
To be used to iterate through a class&#39;s static methods.
Definition: QoreClass.h:1180
q_external_static_method_t
QoreValue(* q_external_static_method_t)(const QoreMethod &method, const void *ptr, const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the type used for external static methods
Definition: common.h:383
QoreString
Qore&#39;s string type supported by the QoreEncoding class.
Definition: QoreString.h:82
q_func_t
AbstractQoreNode *(* q_func_t)(const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin function signatures
Definition: common.h:261
QoreClass::hasMemberNotification
DLLEXPORT bool hasMemberNotification() const
returns true if the class implements a &quot;memberNotification&quot; method
QoreClass::addMethod2
DLLEXPORT void addMethod2(const char *n_name, q_method2_t meth, bool priv=false)
adds a builtin method with the new generic calling convention
QoreClass::getSystemConstructor
DLLEXPORT const QoreMethod * getSystemConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set ...
arg_vec_t
std::vector< AbstractQoreNode * > arg_vec_t
vector of value information for default argument lists
Definition: common.h:235
QoreClass::getClass
DLLEXPORT 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::addMethodExtendedList
DLLEXPORT void addMethodExtendedList(const char *n_name, q_method_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin method with extended information; additional functional domain info, return and parameter type info from lists
QoreListNode
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
QoreClass::addStaticMethodExtended
DLLEXPORT void addStaticMethodExtended(const char *n_name, q_func_t meth, bool priv=false, int64 n_flags=QC_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...
QoreClass::setConstructorExtendedList
DLLEXPORT void setConstructorExtendedList(q_constructor_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const type_vec_t &n_typeList=type_vec_t(), const arg_vec_t &defaultArgList=arg_vec_t())
sets the constructor method with extended information; can set a private constructor, set additional functional domain info, and parameter type info from lists (or adds an overloaded variant)
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:504
QoreClass::addMethod
DLLEXPORT void addMethod(const char *n_name, q_method_n_t meth, ClassAccess access=Public, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin method to a class
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:476
q_func_double_t
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
QoreClass::addDefaultBuiltinBaseClass
DLLEXPORT void addDefaultBuiltinBaseClass(QoreClass *qc, QoreListNode *xargs=0)
make a builtin class a child of another builtin class and ensures that the given class&#39;s private data...
QoreClass
defines a Qore-language class
Definition: QoreClass.h:214
q_destructor2_t
void(* q_destructor2_t)(const QoreClass &thisclass, QoreObject *self, AbstractPrivateData *private_data, ExceptionSink *xsink)
the type used for builtin QoreClass destructor signatures with the new generic calling convention ...
Definition: common.h:485
QoreMethod::getName
DLLEXPORT const char * getName() const
returns the method&#39;s name
QoreClass::addStaticMethod
DLLEXPORT void addStaticMethod(const char *n_name, q_func_n_t meth, ClassAccess access=Public, int64 n_flags=QC_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...
QoreClass::addMember
DLLEXPORT void addMember(const char *mem, ClassAccess access, const QoreTypeInfo *n_typeInfo, AbstractQoreNode *initial_value=0)
adds a member
QoreBuiltinClass
creates a builtin class
Definition: QoreClass.h:1221
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::addAbstractMethodVariant
DLLEXPORT void addAbstractMethodVariant(const char *n_name, ClassAccess access=Public, int64 n_flags=QC_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...
QoreMethod::newCallingConvention
DLLEXPORT bool newCallingConvention() const
DEPRECATED: always returns false, do not use.
QoreClass::getDomain64
DLLEXPORT int64 getDomain64() const
returns the functional domain of the class
q_constructor_t
void(* q_constructor_t)(QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:430
QoreMethod::getClass
DLLEXPORT const QoreClass * getClass() const
returns a pointer to the parent class
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:458
QoreClass::findLocalStaticMethod
DLLEXPORT const QoreMethod * findLocalStaticMethod(const char *name) const
looks for a static method in the current class without searching base classes
QoreClass::setConstructorExtendedList2
DLLEXPORT void setConstructorExtendedList2(q_constructor2_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const type_vec_t &n_typeList=type_vec_t(), const arg_vec_t &defaultArgList=arg_vec_t())
sets the constructor method using the new calling convention with extended information; can set a pri...
QoreClass::execCopy
DLLEXPORT QoreObject * execCopy(QoreObject *old, ExceptionSink *xsink) const
executes a class&#39;s &quot;copy&quot; method on an object and returns the new object (or 0 in the case of an exce...
QoreValue
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:112
q_constructor_n_t
void(* q_constructor_n_t)(QoreObject *self, const QoreValueList *args, q_rt_flags_t rtflags, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:411
QoreClass::isPrivateMember
DLLEXPORT bool isPrivateMember(const char *str) const
returns true if the member is private
QoreClass::addPublicMember
DLLEXPORT void addPublicMember(const char *mem, const QoreTypeInfo *n_typeInfo, AbstractQoreNode *initial_value=0)
adds a public member
QoreClass::addBuiltinConstant
DLLEXPORT void addBuiltinConstant(const char *name, AbstractQoreNode *value, bool priv=false, const QoreTypeInfo *typeInfo=0)
adds a class constant to the class
QoreObject
the implementation of Qore&#39;s object data type, reference counted, dynamically-allocated only ...
Definition: QoreObject.h:62
QoreClass::getMemberGateMethod
DLLEXPORT const QoreMethod * getMemberGateMethod() const
returns a const pointer to the QoreMethod object of the memberGate method, if any is set ...
qore_classid_t
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:80
num_params
static unsigned num_params(const QoreListNode *n)
returns the number of arguments passed to the function
Definition: params.h:62
QoreClass::getConstructor
DLLEXPORT const QoreMethod * getConstructor() const
returns a const pointer to the QoreMethod object of the constuctor method, if any is set ...
ExceptionSink
container for holding Qore-language exception information and also for registering a &quot;thread_exit&quot; ca...
Definition: ExceptionSink.h:47
q_constructor2_t
void(* q_constructor2_t)(const QoreClass &thisclass, QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures using the new generic calling conve...
Definition: common.h:438
name_vec_t
std::vector< std::string > name_vec_t
vector of parameter names for parameter lists
Definition: common.h:238
QoreClass::recheckBuiltinMethodHierarchy
DLLEXPORT void recheckBuiltinMethodHierarchy()
rechecks for inherited methods in base classes when adding builtin classes
QoreClassHolder::QoreClassHolder
DLLLOCAL QoreClassHolder(QoreClass *c)
creates the object
Definition: QoreClass.h:1197
QoreClass::getManagedUserData
DLLEXPORT AbstractQoreClassUserData * getManagedUserData() const
retrieves the user-specific data pointer
QoreClass::setSystem
DLLEXPORT void setSystem()
marks the class as a builtin class
QoreClass::addMethodVariant
DLLEXPORT void addMethodVariant(const void *ptr, const char *n_name, q_external_method_t meth, ClassAccess access=Public, int64 n_flags=QC_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 ...
QoreClass::QoreClass
DLLLOCAL QoreClass()
constructor not exported in library&#39;s API
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:241
QoreClass::hasMethodGate
DLLEXPORT bool hasMethodGate() const
returns true if the class implements a &quot;methodGate&quot; method
q_method_bool_t
bool(* q_method_bool_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures when called with the even newer generic calling...
Definition: common.h:336
QoreClass::setGateAccessFlag
DLLEXPORT void setGateAccessFlag()
sets the class&#39;s gate access flag so that memberGate() and methodGate() methods will be called with a...
QoreClass::addStaticMethodExtendedList2
DLLEXPORT void addStaticMethodExtendedList2(const char *n_name, q_static_method2_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin static method with the new generic calling convention with extended information; addit...
QoreClass::setSynchronousClass
DLLEXPORT void setSynchronousClass()
call this function if your builtin class requires *all* methods (except the constructor) to be run in...
QoreClass::setConstructor
DLLEXPORT void setConstructor(q_constructor_t m)
sets the builtin constructor method for the class (or adds an overloaded variant) ...
QoreClass::setCopy2
DLLEXPORT void setCopy2(q_copy2_t m)
sets the builtin copy method for the class using the new generic calling convention ...
QoreClass::~QoreClass
DLLEXPORT ~QoreClass()
deletes the object and frees all memory
QoreClass::getManagedUserData
DLLLOCAL T * getManagedUserData() const
retrieves the user-specific data pointer
Definition: QoreClass.h:1025
q_static_method2_t
AbstractQoreNode *(* q_static_method2_t)(const QoreMethod &method, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin static method signatures for static methods using the new generic calling c...
Definition: common.h:392
QoreClass::addStaticMethodExtended3
DLLEXPORT void addStaticMethodExtended3(const char *n_name, q_func_t meth, bool priv=false, int64 n_flags=QC_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...
QoreBuiltinClass::QoreBuiltinClass
DLLEXPORT QoreBuiltinClass(const char *name, int64 n_domain=QDOM_DEFAULT)
creates the object and marks it as a builtin class
QoreClass::addStaticMethodVariant
DLLEXPORT void addStaticMethodVariant(const void *ptr, const char *n_name, q_external_static_method_t meth, ClassAccess access=Public, int64 n_flags=QC_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...
q_method_n_t
QoreValue(* q_method_n_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the new type used for builtin QoreClass method signatures
Definition: common.h:281
q_method_t
AbstractQoreNode *(* q_method_t)(QoreObject *self, AbstractPrivateData *private_data, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass method signatures
Definition: common.h:306
QoreClass::findStaticMethod
DLLEXPORT const QoreMethod * findStaticMethod(const char *nme) const
finds a static method in the class hierarchy
QoreMethod::isStatic
DLLEXPORT bool isStatic() const
returns true if the method is static
QoreMethod::isPrivate
DLLEXPORT bool isPrivate() const
returns true if all overloaded variants of a methods are private or class internal, false if at least one variant is public
QoreClassHolder::~QoreClassHolder
DLLEXPORT ~QoreClassHolder()
deletes the QoreClass object if still managed
QoreClass::setSystemConstructor2
DLLEXPORT void setSystemConstructor2(q_system_constructor2_t m)
sets the builtin constructor for system objects (ex: used as constant values) using the new calling c...
q_func_n_t
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
QoreClass::addPrivateMember
DLLEXPORT void addPrivateMember(const char *mem, const QoreTypeInfo *n_typeInfo, AbstractQoreNode *initial_value=0)
adds a private member
QoreClass::addStaticMethodExtendedList3
DLLEXPORT void addStaticMethodExtendedList3(const void *ptr, const char *n_name, q_static_method3_t meth, bool priv=false, int64 n_flags=QC_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())
adds a builtin static method with the even newer generic calling convention with extended information...
QoreClass::numUserMethods
DLLEXPORT int numUserMethods() const
returns the number of non-static user methods in this class
QoreClass::numStaticUserMethods
DLLEXPORT int numStaticUserMethods() const
returns the number of static user methods in this class
QoreClass::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type information structure for this class
QoreMethod::isSynchronized
DLLEXPORT bool isSynchronized() const
DEPRECATED: always returns false, do not use.
QoreMethod::getAccess
DLLEXPORT ClassAccess getAccess() const
returns the lowest access code of all variants in the method
QoreClass::setPublicMemberFlag
DLLEXPORT void setPublicMemberFlag()
sets the class&#39;s public member flag so that undeclared member references will fail ...
QoreClass::hasCopy
DLLEXPORT bool hasCopy() const
returns true if the class implements a copy method
QoreClass::setDestructor2
DLLEXPORT void setDestructor2(q_destructor2_t m)
sets the builtin destructor method for the class with the new generic calling convention ...
QoreClass::addConstructor
DLLEXPORT void addConstructor(q_constructor_n_t meth, ClassAccess access=Public, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, unsigned num_params=0,...)
sets the constructor method with extended information; can set a private constructor, set additional functional domain info, and parameter type info (or adds an overloaded variant)
q_constructor3_t
void(* q_constructor3_t)(const QoreClass &thisclass, const type_vec_t &typeList, const void *ptr, QoreObject *self, const QoreListNode *args, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures using the even newer generic callin...
Definition: common.h:448
QoreClass::setDestructor3
DLLEXPORT void setDestructor3(const void *ptr, q_destructor3_t m)
sets the builtin destructor method for the class with the new generic calling convention ...
type_vec_t
std::vector< const QoreTypeInfo * > type_vec_t
vector of type information for parameter lists
Definition: common.h:232
QoreMethod
a method in a QoreClass
Definition: QoreClass.h:94
QoreClass::rescanParents
DLLEXPORT void rescanParents()
rescan builtin parent classes in a class hierarchy; to be used with out-of-order class hierarchy cons...
QoreClass::setFinal
DLLEXPORT void setFinal()
sets the final flag of the class
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 ...
QoreClass::setConstructorExtended2
DLLEXPORT void setConstructorExtended2(q_constructor2_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, unsigned num_params=0,...)
sets the constructor method using the new calling convention with extended information; can set a pri...
QoreClass::setSystemConstructor
DLLEXPORT void setSystemConstructor(q_system_constructor_t m)
sets the builtin constructor for system objects (ex: used as constant values)
q_func_bool_t
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
q_external_constructor_t
void(* q_external_constructor_t)(const QoreMethod &method, const void *ptr, QoreObject *self, const QoreValueList *args, q_rt_flags_t rtflags, ExceptionSink *xsink)
the type used for builtin QoreClass constructor method signatures
Definition: common.h:423
QoreClass::setConstructorExtended
DLLEXPORT void setConstructorExtended(q_constructor_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, unsigned num_params=0,...)
sets the constructor method with extended information; can set a private constructor, set additional functional domain info, and parameter type info (or adds an overloaded variant)
QoreClass::addAbstractMethodVariantExtended3
DLLEXPORT void addAbstractMethodVariantExtended3(const char *n_name, bool priv=false, int64 n_flags=QC_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...
q_copy2_t
void(* q_copy2_t)(const QoreClass &thisclass, 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:514
QoreClass::addStaticMethodExtended2
DLLEXPORT void addStaticMethodExtended2(const char *n_name, q_static_method2_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin static method with the new generic calling convention with extended information; addit...
QoreClass::addMethodExtended3
DLLEXPORT void addMethodExtended3(const char *n_name, q_method_t meth, bool priv=false, int64 n_flags=QC_NO_FLAGS, int64 n_domain=QDOM_DEFAULT, const QoreTypeInfo *returnTypeInfo=0, unsigned num_params=0,...)
adds a builtin method with extended information; additional functional domain info, return and parameter type info
QoreClass::execConstructor
DLLEXPORT QoreObject * execConstructor(const QoreValueList *args, ExceptionSink *xsink) const
creates a new object and executes the constructor on it and returns the new object ...
QoreMethod::isBuiltin
DLLEXPORT bool isBuiltin() const
returns true if all variants of the method are builtin variants
q_external_method_t
QoreValue(* q_external_method_t)(const QoreMethod &method, const void *ptr, QoreObject *self, AbstractPrivateData *private_data, const QoreValueList *args, q_rt_flags_t flags, ExceptionSink *xsink)
the new type used for builtin QoreClass method signatures
Definition: common.h:296
q_destructor3_t
void(* q_destructor3_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:495
QoreClass::findMethod
DLLEXPORT const QoreMethod * findMethod(const char *nme) const
finds a non-static method in the class hierarchy
QDOM_DEFAULT
#define QDOM_DEFAULT
the default domain (no domain)
Definition: Restrictions.h:146