00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _QORE_FUNCTIONREFERENCENODE_H
00024
00025 #define _QORE_FUNCTIONREFERENCENODE_H
00026
00028
00030 class AbstractCallReferenceNode : public AbstractQoreNode
00031 {
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 {
00111 return "call reference";
00112 }
00113 };
00114
00116 class ResolvedCallReferenceNode : public AbstractCallReferenceNode
00117 {
00118 public:
00120 DLLLOCAL ResolvedCallReferenceNode(bool n_needs_eval = false, qore_type_t n_type = NT_FUNCREF);
00121
00123
00128 DLLLOCAL virtual AbstractQoreNode *exec(const QoreListNode *args, ExceptionSink *xsink) const = 0;
00129
00131
00134 DLLLOCAL virtual QoreProgram *getProgram() const;
00135
00136 DLLLOCAL ResolvedCallReferenceNode *refRefSelf() const
00137 {
00138 ref();
00139 return const_cast<ResolvedCallReferenceNode *>(this);
00140 }
00141 };
00142
00143
00144 #endif