00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _QORE_FUNCTIONREFERENCENODE_H
00025
00026 #define _QORE_FUNCTIONREFERENCENODE_H
00027
00029
00031 class AbstractCallReferenceNode : public AbstractQoreNode {
00032 private:
00034
00036 DLLLOCAL virtual class AbstractQoreNode *realCopy() const;
00037
00039
00041 DLLLOCAL virtual bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const;
00042
00044
00046 DLLLOCAL virtual bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const;
00047
00048 protected:
00050
00052 DLLLOCAL virtual AbstractQoreNode *evalImpl(ExceptionSink *xsink) const;
00053
00055
00057 DLLLOCAL virtual AbstractQoreNode *evalImpl(bool &needs_deref, ExceptionSink *xsink) const;
00058
00060
00062 DLLLOCAL virtual int64 bigIntEvalImpl(ExceptionSink *xsink) const;
00063
00065
00067 DLLLOCAL virtual int integerEvalImpl(ExceptionSink *xsink) const;
00068
00070
00072 DLLLOCAL virtual bool boolEvalImpl(ExceptionSink *xsink) const;
00073
00075
00077 DLLLOCAL virtual double floatEvalImpl(ExceptionSink *xsink) const;
00078
00080 DLLLOCAL AbstractCallReferenceNode(bool n_needs_eval, bool n_there_can_be_only_one, qore_type_t n_type = NT_FUNCREF);
00081
00082 public:
00083 DLLLOCAL AbstractCallReferenceNode(bool n_needs_eval = false, qore_type_t n_type = NT_FUNCREF);
00084
00085 DLLLOCAL virtual ~AbstractCallReferenceNode();
00086
00088
00094 DLLLOCAL virtual int getAsString(QoreString &str, int foff, class ExceptionSink *xsink) const;
00095
00097
00104 DLLLOCAL virtual QoreString *getAsString(bool &del, int foff, class ExceptionSink *xsink) const;
00105
00107 DLLLOCAL virtual const char *getTypeName() const;
00108
00109 DLLLOCAL static const char *getStaticTypeName() {
00110 return "call reference";
00111 }
00112 };
00113
00115 class ResolvedCallReferenceNode : public AbstractCallReferenceNode {
00116 public:
00118 DLLLOCAL ResolvedCallReferenceNode(bool n_needs_eval = false, qore_type_t n_type = NT_FUNCREF);
00119
00121
00126 DLLLOCAL virtual AbstractQoreNode *exec(const QoreListNode *args, ExceptionSink *xsink) const = 0;
00127
00129
00132 DLLLOCAL virtual QoreProgram *getProgram() const;
00133
00134 DLLLOCAL virtual AbstractQoreFunction *getFunction() = 0;
00135
00136 DLLLOCAL ResolvedCallReferenceNode *refRefSelf() const {
00137 ref();
00138 return const_cast<ResolvedCallReferenceNode *>(this);
00139 }
00140 };
00141
00142 #endif