12 #ifndef ROOT_TMethodCall
13 #define ROOT_TMethodCall
37 class TMethodCall :
public TObject {
40 using EReturnType = TInterpreter::EReturnType;
43 static const EReturnType kLong = TInterpreter::EReturnType::kLong;
44 static const EReturnType kDouble = TInterpreter::EReturnType::kDouble;
45 static const EReturnType kString = TInterpreter::EReturnType::kString;
46 static const EReturnType kOther = TInterpreter::EReturnType::kOther;
47 static const EReturnType kNoReturnType = TInterpreter::EReturnType::kNoReturnType;
49 static const EReturnType kNone = TInterpreter::EReturnType::kNoReturnType;
64 void Execute(
const char *,
const char *,
int * = 0) { }
65 void Execute(TMethod *, TObjArray *,
int * = 0) { }
67 void InitImplementation(
const char *methodname,
const char *params,
const char *proto, Bool_t objectIsConst, TClass *cl,
const ClassInfo_t *cinfo, ROOT::EFunctionMatchMode mode = ROOT::kConversionMatch);
71 TMethodCall(TClass *cl, CallFunc_t *callfunc, Long_t offset = 0);
72 TMethodCall(TClass *cl,
const char *method,
const char *params);
73 TMethodCall(
const char *
function,
const char *params);
74 TMethodCall(
const TFunction *func);
75 TMethodCall(
const TMethodCall &org);
76 TMethodCall& operator=(
const TMethodCall &rhs);
79 void Init(
const TFunction *func);
80 void Init(TClass *cl, CallFunc_t *func, Long_t offset = 0);
81 void Init(TClass *cl,
const char *method,
const char *params, Bool_t objectIsConst = kFALSE);
82 void Init(
const char *
function,
const char *params);
83 void InitWithPrototype(TClass *cl,
const char *method,
const char *proto, Bool_t objectIsConst = kFALSE, ROOT::EFunctionMatchMode mode = ROOT::kConversionMatch);
84 void InitWithPrototype(
const char *
function,
const char *proto, ROOT::EFunctionMatchMode mode = ROOT::kConversionMatch);
85 Bool_t IsValid()
const;
86 TObject *Clone(
const char *newname=
"")
const;
87 void CallDtorOnly(Bool_t set = kTRUE) { fDtorOnly = set; }
89 TFunction *GetMethod();
90 const char *GetMethodName()
const {
return fMethod.Data(); }
91 const char *GetParams()
const {
return fParams.Data(); }
92 const char *GetProto()
const {
return fProto.Data(); }
93 CallFunc_t *GetCallFunc()
const {
return fFunc; }
94 EReturnType ReturnType();
96 void SetParamPtrs(
void *paramArr, Int_t nparam = -1);
98 void SetParam(Long_t l);
99 void SetParam(Float_t f);
100 void SetParam(Double_t d);
101 void SetParam(Long64_t ll);
102 void SetParam(ULong64_t ull);
104 template <
typename... T>
void SetParams(
const T&... params) {
106 gInterpreter->CallFunc_SetArguments(fFunc,params...);
109 void Execute(
void *
object);
110 void Execute(
void *
object,
const char *params);
111 void Execute(
void *
object, Long_t &retLong);
112 void Execute(
void *
object,
const char *params, Long_t &retLong);
113 void Execute(
void *
object, Double_t &retDouble);
114 void Execute(
void *
object,
const char *params, Double_t &retDouble);
116 void Execute(
void *
object,
char **retText);
117 void Execute(
void *
object,
const char *params,
char **retText);
120 void Execute(
const char *params);
121 void Execute(Long_t &retLong);
122 void Execute(
const char *params, Long_t &retLong);
123 void Execute(Double_t &retDouble);
124 void Execute(
const char *params, Double_t &retDouble);
126 void Execute(
void *objAddress,
const void* args[],
int nargs,
void *ret = 0);
128 ClassDef(TMethodCall,0)
131 inline void TMethodCall::Execute()
132 { Execute((
void *)0); }
133 inline void TMethodCall::Execute(
const char *params)
134 { Execute((
void *)0, params); }
135 inline void TMethodCall::Execute(Long_t &retLong)
136 { Execute((
void *)0, retLong); }
137 inline void TMethodCall::Execute(
const char *params, Long_t &retLong)
138 { Execute((
void *)0, params, retLong); }
139 inline void TMethodCall::Execute(Double_t &retDouble)
140 { Execute((
void *)0, retDouble); }
141 inline void TMethodCall::Execute(
const char *params, Double_t &retDouble)
142 { Execute((
void *)0, params, retDouble); }