CallFunc.h

Go to the documentation of this file.
00001 /* /% C++ %/ */
00002 /***********************************************************************
00003  * cint (C/C++ interpreter)
00004  ************************************************************************
00005  * Header file CallFunc.h
00006  ************************************************************************
00007  * Description:
00008  *  Extended Run Time Type Identification API
00009  ************************************************************************
00010  * Copyright(c) 1995~2003  Masaharu Goto 
00011  *
00012  * For the licensing terms see the file COPYING
00013  *
00014  ************************************************************************/
00015 
00016 
00017 
00018 #ifndef G__CALLFUNC_H
00019 #define G__CALLFUNC_H
00020 
00021 #ifndef G__API_H
00022 #include "Api.h"
00023 #endif
00024 
00025 namespace Cint {
00026 
00027 /*********************************************************************
00028 * class G__CallFunc
00029 *
00030 * 
00031 *********************************************************************/
00032 class 
00033 #ifndef __CINT__
00034 G__EXPORT
00035 #endif
00036 G__CallFunc {
00037  public:
00038   ~G__CallFunc() {}
00039   G__CallFunc() ;
00040 
00041   G__CallFunc(const G__CallFunc& cf)
00042 #ifndef __MAKECINT__
00043    :pfunc(cf.pfunc),
00044     result(cf.result),
00045 #ifdef G__ASM_WHOLEFUNC
00046     bytecode(cf.bytecode),
00047 #endif
00048     method(cf.method),
00049     para(cf.para)
00050 #endif /* __MAKECINT__ */
00051   {}
00052 
00053   G__CallFunc& operator=(const G__CallFunc& cf) {
00054 #ifndef __MAKECINT__
00055   pfunc=cf.pfunc;
00056   result=cf.result;
00057 #ifdef G__ASM_WHOLEFUNC
00058   bytecode=cf.bytecode;
00059 #endif
00060   method=cf.method;
00061   para=cf.para;
00062 #endif /* __MAKECINT__ */
00063   return *this;}
00064 
00065   void Init() ;
00066 
00067   enum MatchMode { ExactMatch=0, ConversionMatch=1 };
00068   void SetFunc(G__ClassInfo* cls,const char* fname,const char* args
00069                ,long* poffset,MatchMode mode=ConversionMatch);
00070   void SetFuncProto(G__ClassInfo* cls,const char* fname,const char* argtype,long* poffset);
00071   // begin old interface
00072   void SetFunc(G__InterfaceMethod f);
00073   void SetFunc(G__MethodInfo m);
00074 #ifdef G__ASM_WHOLEFUNC
00075   void SetBytecode(struct G__bytecodefunc* bc);
00076 #endif
00077   int IsValid() { /* return(pfunc?1:0l; */ return(method.IsValid());}
00078   void SetArgArray(long *p,int narg= -1);
00079   void ResetArg() { para.paran=0; }
00080   void SetArg(long l) ;
00081   void SetArg(unsigned long ul) ;
00082   void SetArg(double d) ;
00083   void SetArgRef(long& l) ;
00084   void SetArgRef(double& d) ;
00085   void SetArg( G__value );
00086 #ifdef G__NATIVELONGLONG
00087   void SetArg(G__int64 ll);
00088   void SetArg(G__uint64 ull);
00089   void SetArg(long double ld);
00090   void SetArgRef(G__int64& ll);
00091   void SetArgRef(G__uint64& ull);
00092   void SetArgRef(long double& ld);
00093 #endif
00094   // end old interface
00095 
00096   G__value Execute(void *pobject );
00097   void Exec(void *pobject) { Execute(pobject); }
00098   long ExecInt(void *pobject) { return G__int(Execute(pobject)); }
00099   double ExecDouble(void *pobject) { return G__double(Execute(pobject)); }
00100 #ifdef G__NATIVELONGLONG
00101   G__int64 ExecInt64(void *pobject) { return G__Longlong(Execute(pobject)); }
00102 #endif
00103 
00104   G__InterfaceMethod InterfaceMethod() { return pfunc; }
00105   void SetArgs(const char* args);
00106   void SetArgs(const G__param &p);
00107   G__MethodInfo GetMethodInfo() { return method; }
00108 
00109  private:
00110   void SetFuncType();
00111 #ifndef __MAKECINT__
00112   G__InterfaceMethod pfunc;
00113   G__value result;
00114 #ifdef G__ASM_WHOLEFUNC
00115   struct G__bytecodefunc *bytecode;
00116 #endif
00117   G__MethodInfo method;
00118   struct G__param para;
00119   int ExecInterpretedFunc(G__value* presult);
00120 #endif /* __MAKECINT__ */
00121 };
00122 
00123 } // namespace Cint
00124 
00125 using namespace Cint;
00126 #endif

Generated on Tue Jul 5 14:24:56 2011 for ROOT_528-00b_version by  doxygen 1.5.1