Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMethodCall.cxx
Go to the documentation of this file.
1// @(#)Root/meta:$Id$
2// Author: Fons Rademakers 13/06/96
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TMethodCall
13Method or function calling interface. Objects of this class contain
14the (CINT) environment to call a global function or a method for an
15object of a specific class with the desired arguments. This class is
16especially useful when a method has to be called more times for
17different objects and/or with different arguments. If a function or
18method needs to be called only once one better uses
19TInterpreter::Execute().
20
21A limitation is known with the present implementation: failures can
22occur if parameters involve temporary object construction.
23*/
24
25#include "TInterpreter.h"
26#include "TMethodCall.h"
27#include "TMethod.h"
28#include "TClass.h"
29#include "TROOT.h"
30#include "Strlen.h"
31#include "TVirtualMutex.h"
32#include "TError.h"
33
35
36////////////////////////////////////////////////////////////////////////////////
37/// Default TMethodCall ctor. Use Init() to initialize the method call
38/// environment.
39
41fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
42{
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Create a method invocation environment for a specific class, method
47/// described by the callfunc.
48
49TMethodCall::TMethodCall(TClass *cl, CallFunc_t *callfunc, Longptr_t offset):
50fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
51{
52 Init(cl, callfunc, offset);
53}
54
55////////////////////////////////////////////////////////////////////////////////
56/// Create a method invocation environment for a specific class, method and
57/// parameters. The parameter string has the form: "\"aap\", 3, 4.35".
58/// To execute the method call TMethodCall::Execute(object,...).
59/// This two step method is much more efficient than calling for
60/// every invocation TInterpreter::Execute(...).
61
62TMethodCall::TMethodCall(TClass *cl, const char *method, const char *params):
63fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
64{
65 Init(cl, method, params);
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Create a global function invocation environment. The parameter
70/// string has the form: "\"aap\", 3, 4,35". To execute the
71/// function call TMethodCall::Execute(...).
72/// This two step method is much more efficient than calling for
73/// every invocation TInterpreter::Execute(...).
74
75TMethodCall::TMethodCall(const char *function, const char *params):
76fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
77{
78 Init(function, params);
79}
80
81////////////////////////////////////////////////////////////////////////////////
82/// Create a global function invocation environment base on a TFunction object.
83/// To execute the function call TMethodCall::Execute(...).
84/// This two step method is much more efficient than calling for
85/// every invocation TInterpreter::Execute(...).
86
88fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
89{
90 Init(func);
91}
92////////////////////////////////////////////////////////////////////////////////
93/// Copy ctor.
94
96TObject(orig),
97fFunc(orig.fFunc ? gCling->CallFunc_FactoryCopy(orig.fFunc) : nullptr),
98fOffset(orig.fOffset), fClass(orig.fClass), fMetPtr(nullptr /*!*/),
99fMethod(orig.fMethod), fParams(orig.fParams), fProto(orig.fProto),
100fDtorOnly(orig.fDtorOnly), fRetType(orig.fRetType)
101{
102}
103
104////////////////////////////////////////////////////////////////////////////////
105/// Assignment operator.
106
108{
109 if (this != &rhs) {
111 fFunc = rhs.fFunc ? gCling->CallFunc_FactoryCopy(rhs.fFunc) : nullptr;
112 fOffset = rhs.fOffset;
113 fClass = rhs.fClass;
114 fMethod = rhs.fMethod;
115 fParams = rhs.fParams;
116 fProto = rhs.fProto;
117 fDtorOnly = rhs.fDtorOnly;
118 fRetType = rhs.fRetType;
119
120 delete fMetPtr;
121 fMetPtr = nullptr;
122 }
123
124 return *this;
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// TMethodCall dtor.
129
131{
133 delete fMetPtr;
134}
135
136////////////////////////////////////////////////////////////////////////////////
137/// Return an exact copy of this object.
138
139TObject *TMethodCall::Clone(const char *) const
140{
141 TObject *newobj = new TMethodCall(*this);
142 return newobj;
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Helper function to find the scope associated with a qualified
147/// function name
148
149static TClass *R__FindScope(const char *function, UInt_t &pos, ClassInfo_t *cinfo)
150{
151
152//______________________________________________________________________________
153// FIXME: We don't need to split that into lookup scope and lookup member.
154// Consider merging the implementation with the new lookup functionality.
155
156 if (function) {
157 UInt_t nested = 0;
158 for(int i=strlen(function); i>=0; --i) {
159 switch(function[i]) {
160 case '<': ++nested; break;
161 case '>': if (nested==0) { Error("TMethodCall R__FindScope","%s is not well formed function name",function); return nullptr; }
162 --nested; break;
163 case ':':
164 if (nested==0) {
165 if (i>1 && function[i-1]==':') {
166 TString scope(function);
167 scope[i-1] = 0;
168 pos = i+1;
169 TClass *cl = TClass::GetClass(scope);
170 if (!cl) gCling->ClassInfo_Init(cinfo, scope);
171 return cl;
172 }
173 }
174 break;
175 }
176 }
177 }
178 return nullptr;
179}
180
181////////////////////////////////////////////////////////////////////////////////
182/// Initialize the method invocation environment based on
183/// the CallFunc object and the TClass describing the function context.
184
186{
187 if (!function) {
188 fOffset = 0;
190 fRetType = kNone;
191 return;
192 }
193
194 MethodInfo_t* info = gCling->CallFunc_FactoryMethod(function);
195
196 if (!fFunc)
198 else
200
201 fClass = cl;
202 if (fClass) {
203 fMetPtr = new TMethod(info,cl);
204 } else {
205 fMetPtr = new TFunction(info);
206 }
208 fParams = "";
209 fProto = fMetPtr->GetSignature()+1; // skip leading )
210 Ssiz_t s = fProto.Last(')');
211 fProto.Remove(s); // still need to remove default values :(
212
213 fOffset = offset;
214
216 fRetType = kNone;
217
219
220}
221
222////////////////////////////////////////////////////////////////////////////////
223/// Initialize the method invocation environment based on
224/// the TFunction object.
225
227{
228 if (!function) return;
229
230 if (!fFunc)
232 else
234
235 const TMethod *m = dynamic_cast<const TMethod*>(function);
236 fClass = m ? m->GetClass() : nullptr;
239 fParams = "";
240 fProto = fMetPtr->GetSignature()+1; // skip leading )
241 Ssiz_t s = fProto.Last(')');
242 fProto.Remove(s); // still need to remove default values :(
243
245 fRetType = kNone;
246
248
249}
250
251////////////////////////////////////////////////////////////////////////////////
252/// Initialize the method invocation environment. Necessary input
253/// information: the class, method name and the parameter string
254/// of the form "\"aap\", 3, 4.35".
255///
256/// To execute the method call TMethodCall::Execute(object,...).
257/// This two step method is much more efficient than calling for
258/// every invocation TInterpreter::Execute(...).
259
260void TMethodCall::Init(TClass *cl, const char *method, const char *params, Bool_t objectIsConst /* = kFALSE */)
261{
262 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
263 if (!cl) {
264 UInt_t pos = 0;
265 cl = R__FindScope(method,pos,cinfo);
266 method = method+pos;
267 }
268 InitImplementation(method,params,nullptr,objectIsConst,cl,cinfo);
269 gCling->ClassInfo_Delete(cinfo);
270}
271
272////////////////////////////////////////////////////////////////////////////////
273/// Initialize the function invocation environment. Necessary input
274/// information: the function name and the parameter string of
275/// the form "\"aap\", 3, 4.35".
276///
277/// To execute the method call TMethodCall::Execute(...).
278/// This two step method is much more efficient than calling for
279/// every invocation TInterpreter::Execute(...).
280
281void TMethodCall::Init(const char *function, const char *params)
282{
283 UInt_t pos = 0;
284 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
285 TClass *cl = R__FindScope(function,pos,cinfo);
286 InitImplementation(function+pos, params, nullptr, false, cl, cinfo);
287 gCling->ClassInfo_Delete(cinfo);
288}
289
290////////////////////////////////////////////////////////////////////////////////
291/// This function implements Init and InitWithPrototype.
292///
293/// 'methodname' should NOT have any scope information in it. The scope
294/// information should be passed via the TClass or CINT ClassInfo.
295
296void TMethodCall::InitImplementation(const char *methodname, const char *params,
297 const char *proto,
298 Bool_t objectIsConst, TClass *cl,
299 const ClassInfo_t *cinfo,
300 ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
301{
302 if (!fFunc) {
305 } else
307
308 fClass = cl;
309 fMetPtr = nullptr;
310 fMethod = methodname;
311 fParams = params ? params : "";
312 fProto = proto ? proto : "";
314 fRetType = kNone;
315
316 ClassInfo_t *scope = nullptr;
317 if (cl) scope = (ClassInfo_t*)cl->GetClassInfo();
318 else scope = (ClassInfo_t*)cinfo;
319
320 if (!scope) return;
321
323 if (params && params[0]) {
324 gCling->CallFunc_SetFunc(fFunc, scope, (char *)methodname, (char *)params, objectIsConst, &fOffset);
325 } else if (proto && proto[0]) {
326 gCling->CallFunc_SetFuncProto(fFunc, scope, (char *)methodname, (char *)proto, objectIsConst, &fOffset, mode);
327 } else {
328 // No parameters
329 gCling->CallFunc_SetFuncProto(fFunc, scope, (char *)methodname, "", objectIsConst, &fOffset, mode);
330 }
331}
332
333////////////////////////////////////////////////////////////////////////////////
334/// Initialize the method invocation environment. Necessary input
335/// information: the class, method name and the prototype string of
336/// the form: "char*,int,float".
337///
338/// To execute the method call TMethodCall::Execute(object,...).
339/// This two step method is much more efficient than calling for
340/// every invocation TInterpreter::Execute(...).
341
342void TMethodCall::InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst /* = kFALSE */, ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
343{
344 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
345 if (!cl) {
346 UInt_t pos = 0;
347 cl = R__FindScope(method,pos,cinfo);
348 method = method+pos;
349 }
350 InitImplementation(method, nullptr, proto, objectIsConst, cl, cinfo, mode);
351 gCling->ClassInfo_Delete(cinfo);
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Initialize the function invocation environment. Necessary input
356/// information: the function name and the prototype string of
357/// the form: "char*,int,float".
358///
359/// To execute the method call TMethodCall::Execute(...).
360/// This two step method is much more efficient than calling for
361/// every invocation TInterpreter::Execute(...).
362
363void TMethodCall::InitWithPrototype(const char *function, const char *proto, ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
364{
365 UInt_t pos = 0;
366 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
367 TClass *cl = R__FindScope(function,pos,cinfo);
368 InitImplementation(function+pos, nullptr, proto, false, cl, cinfo, mode);
369 gCling->ClassInfo_Delete(cinfo);
370}
371
372////////////////////////////////////////////////////////////////////////////////
373/// Return true if the method call has been properly initialized and is
374/// usable.
375
377{
379}
380
381////////////////////////////////////////////////////////////////////////////////
382/// Returns the TMethod describing the method to be executed. This takes
383/// all overriding and overloading into account (call TClass::GetMethod()).
384/// Since finding the method is expensive the result is cached.
385
387{
388 // Since the object in the list of global function are often deleted
389 // we need to copy them.
390
391 if (!fMetPtr) {
393 if (fClass) {
395 } else {
397 }
398 } else if (fClass) {
399 if (fProto == "") {
401 } else {
403 }
404 TMethod *met = dynamic_cast<TMethod*>(fMetPtr);
405 if (met) fMetPtr = new TMethod(*met);
406 } else {
407 if (fProto == "")
408 fMetPtr = gROOT->GetGlobalFunction(fMethod.Data(), fParams.Data(), kFALSE);
409 else
410 fMetPtr = gROOT->GetGlobalFunctionWithPrototype(fMethod.Data(), fProto.Data(), kFALSE);
411 if (fMetPtr) fMetPtr = new TFunction(*fMetPtr);
412 }
413 }
414
415 return fMetPtr;
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Execute the method (with preset arguments) for the specified object.
420
421void TMethodCall::Execute(void *object)
422{
423 if (!fFunc) return;
424
425 void *address = nullptr;
426 if (object) address = (void*)((Longptr_t)object + fOffset);
427 if (!fDtorOnly && fMethod[0]=='~') {
428 Error("Execute","TMethodCall can no longer be use to call the operator delete and the destructor at the same time");
429 }
430 gCling->CallFunc_Exec(fFunc,address);
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Execute the method for the specified object and argument values.
435
436void TMethodCall::Execute(void *object, const char *params)
437{
438 if (!fFunc) return;
439
440 // SetArgs contains the necessary lock.
441 gCling->CallFunc_SetArgs(fFunc, (char *)params);
442
443 void *address = nullptr;
444 if (object) address = (void*)((Longptr_t)object + fOffset);
446 gCling->CallFunc_Exec(fFunc,address);
447 gCling->SetTempLevel(-1);
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// Execute the method (with preset arguments) for the specified object.
452
453void TMethodCall::Execute(void *object, Longptr_t &retLong)
454{
455 if (!fFunc) return;
456
457 void *address = nullptr;
458 if (object) address = (void*)((Longptr_t)object + fOffset);
460 retLong = gCling->CallFunc_ExecInt(fFunc,address);
461 gCling->SetTempLevel(-1);
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// Execute the method for the specified object and argument values.
466
467void TMethodCall::Execute(void *object, const char *params, Longptr_t &retLong)
468{
469 if (!fFunc) return;
470
471 // SetArgs contains the necessary lock.
472 gCling->CallFunc_SetArgs(fFunc, (char *)params);
473
474 void *address = nullptr;
475 if (object) address = (void*)((Longptr_t)object + fOffset);
477 retLong = gCling->CallFunc_ExecInt(fFunc,address);
478 gCling->SetTempLevel(-1);
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Execute the method (with preset arguments) for the specified object.
483
484void TMethodCall::Execute(void *object, Double_t &retDouble)
485{
486 if (!fFunc) return;
487
488 void *address = nullptr;
489 if (object) address = (void*)((Longptr_t)object + fOffset);
491 retDouble = gCling->CallFunc_ExecDouble(fFunc,address);
492 gCling->SetTempLevel(-1);
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Execute the method for the specified object and argument values.
497
498void TMethodCall::Execute(void *object, const char *params, Double_t &retDouble)
499{
500 if (!fFunc) return;
501
502 gCling->CallFunc_SetArgs(fFunc, (char *)params);
503
504 void *address = nullptr;
505 if (object) address = (void*)((Longptr_t)object + fOffset);
507 retDouble = gCling->CallFunc_ExecDouble(fFunc,address);
508 gCling->SetTempLevel(-1);
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Execute the method (with preset arguments) for the specified object.
513
514void TMethodCall::Execute(void *object, char **retText)
515{
516 if (!fFunc) return;
517
518 void *address = nullptr;
519 if (object) address = (void*)((Longptr_t)object + fOffset);
521 *retText =(char*) (gCling->CallFunc_ExecInt(fFunc,address));
522 gCling->SetTempLevel(-1);
523}
524
525////////////////////////////////////////////////////////////////////////////////
526/// Execute the method for the specified object and argument values.
527
528void TMethodCall::Execute(void *object, const char *params, char **retText)
529{
530 if (!fFunc) return;
531
532 // SetArgs contains the necessary lock.
533 gCling->CallFunc_SetArgs(fFunc, (char *)params);
534
535 void *address = nullptr;
536 if (object) address = (void*)((Longptr_t)object + fOffset);
538 *retText =(char*)(gCling->CallFunc_ExecInt(fFunc,address));
539 gCling->SetTempLevel(-1);
540}
541
542////////////////////////////////////////////////////////////////////////////////
543/// Invoke the method
544///
545/// \param[in] objAddress Address of the object to execute the method (nullptr if it is a free function)
546/// \param[in] args Array of pointer to the address of the argument to pass to the
547/// function as is. *No* conversion is done, the argument must be
548/// of the expected type.
549/// \param[in] nargs Number of arguments passed (must be less than actua size of args
550/// \param[out] ret Address of value (or object) to use for the return value.
551
552void TMethodCall::Execute(void *objAddress, const void* args[], int nargs, void *ret /* = 0 */)
553{
554 if (!fFunc) return;
555
556 gCling->CallFunc_ExecWithArgsAndReturn(fFunc,objAddress,args,nargs,ret);
557
558}
559
560////////////////////////////////////////////////////////////////////////////////
561/// Returns the return type of the method. Either (unsigned) long,
562/// int, short and char, or float and double or anything else.
563/// Since finding the return type is expensive the result is cached.
564
566{
567 if ( fRetType == kNone) {
568 TFunction *func = GetMethod();
569 if (func == nullptr) {
571 Error("ReturnType","Unknown method");
572 return kOther;
573 }
574
576 }
577
578 return fRetType;
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// ParamArr is an array containing the function argument values.
583/// If nparam = -1 then paramArr must contain values for all function
584/// arguments, otherwise Nargs-NargsOpt <= nparam <= Nargs, where
585/// Nargs is the number of all arguments and NargsOpt is the number
586/// of default arguments.
587
588void TMethodCall::SetParamPtrs(void *paramArr, Int_t nparam)
589{
590 if (!fFunc) return;
591 gCling->CallFunc_SetArgArray(fFunc,(Longptr_t *)paramArr, nparam);
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Reset parameter list. To be used before the first call the SetParam().
596
598{
599 if (!fFunc) return;
601}
602
603////////////////////////////////////////////////////////////////////////////////
604/// Add a long method parameter.
605
607{
608 if (!fFunc) return;
610}
611
612////////////////////////////////////////////////////////////////////////////////
613/// Add a double method parameter.
614
616{
617 if (!fFunc) return;
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// Add a double method parameter.
623
625{
626 if (!fFunc) return;
628}
629
630////////////////////////////////////////////////////////////////////////////////
631/// Add a long long method parameter.
632
634{
635 if (!fFunc) return;
637}
638
639////////////////////////////////////////////////////////////////////////////////
640/// Add a unsigned long long method parameter.
641
643{
644 if (!fFunc) return;
646}
std::string fRetType
Cppyy::TCppType_t fClass
const Handle_t kNone
Definition GuiTypes.h:88
#define d(i)
Definition RSha256.hxx:102
#define f(i)
Definition RSha256.hxx:104
RooAbsReal & function()
long Longptr_t
Definition RtypesCore.h:82
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
unsigned long long ULong64_t
Definition RtypesCore.h:81
#define ClassImp(name)
Definition Rtypes.h:377
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:185
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char mode
R__EXTERN TVirtualMutex * gInterpreterMutex
R__EXTERN TInterpreter * gCling
static TClass * R__FindScope(const char *function, UInt_t &pos, ClassInfo_t *cinfo)
Helper function to find the scope associated with a qualified function name.
#define gROOT
Definition TROOT.h:406
#define R__LOCKGUARD(mutex)
const char * proto
Definition civetweb.c:17536
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
Definition RooAbsArg.h:89
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
TMethod * GetMethod(const char *method, const char *params, Bool_t objectIsConst=kFALSE)
Find the best method (if there is one) matching the parameters.
Definition TClass.cxx:4411
TMethod * GetMethodWithPrototype(const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Find the method with a given prototype.
Definition TClass.cxx:4456
ClassInfo_t * GetClassInfo() const
Definition TClass.h:433
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2968
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
const char * GetSignature()
Return signature of function.
virtual void CallFunc_SetArgs(CallFunc_t *, const char *) const
virtual void SetTempLevel(int) const
virtual Longptr_t CallFunc_ExecInt(CallFunc_t *, void *) const
virtual void ClassInfo_Delete(ClassInfo_t *) const
virtual EReturnType MethodCallReturnType(TFunction *func) const =0
virtual void CallFunc_ExecWithArgsAndReturn(CallFunc_t *, void *, const void *[]=nullptr, int=0, void *=nullptr) const
virtual void CallFunc_ResetArg(CallFunc_t *) const
virtual void CallFunc_SetFuncProto(CallFunc_t *, ClassInfo_t *, const char *, const char *, Longptr_t *, ROOT::EFunctionMatchMode=ROOT::kConversionMatch) const
virtual void CallFunc_Exec(CallFunc_t *, void *) const
virtual CallFunc_t * CallFunc_Factory() const
virtual void CallFunc_Init(CallFunc_t *) const
virtual ClassInfo_t * ClassInfo_Factory(Bool_t=kTRUE) const =0
virtual void CallFunc_SetFunc(CallFunc_t *, ClassInfo_t *, const char *, const char *, bool, Longptr_t *) const
virtual Bool_t CallFunc_IsValid(CallFunc_t *) const
virtual void CallFunc_SetArgArray(CallFunc_t *, Longptr_t *, Int_t) const
virtual CallFunc_t * CallFunc_FactoryCopy(CallFunc_t *) const
virtual void ClassInfo_Init(ClassInfo_t *, const char *) const
virtual void CallFunc_Delete(CallFunc_t *) const
virtual MethodInfo_t * CallFunc_FactoryMethod(CallFunc_t *) const
virtual Double_t CallFunc_ExecDouble(CallFunc_t *, void *) const
virtual void CallFunc_SetArg(CallFunc_t *, Long_t) const =0
Method or function calling interface.
Definition TMethodCall.h:37
EReturnType ReturnType()
Returns the return type of the method.
TMethodCall()
Default TMethodCall ctor.
TFunction * fMetPtr
Definition TMethodCall.h:57
TMethodCall & operator=(const TMethodCall &rhs)
Assignment operator.
~TMethodCall()
TMethodCall dtor.
Bool_t fDtorOnly
Definition TMethodCall.h:61
TString fParams
Definition TMethodCall.h:59
EReturnType fRetType
Definition TMethodCall.h:62
void ResetParam()
Reset parameter list. To be used before the first call the SetParam().
TObject * Clone(const char *newname="") const override
Return an exact copy of this object.
Longptr_t fOffset
Definition TMethodCall.h:55
static const EReturnType kOther
Definition TMethodCall.h:46
CallFunc_t * fFunc
Definition TMethodCall.h:54
TClass * fClass
Definition TMethodCall.h:56
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
static const EReturnType kNone
Definition TMethodCall.h:49
void Init(const TFunction *func)
Initialize the method invocation environment based on the TFunction object.
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)
This function implements Init and InitWithPrototype.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
TString fProto
Definition TMethodCall.h:60
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
void Execute()
void SetParam(Long_t l)
Add a long method parameter.
void SetParamPtrs(void *paramArr, Int_t nparam=-1)
ParamArr is an array containing the function argument values.
TString fMethod
Definition TMethodCall.h:58
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:987
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition TString.cxx:931
TString & Remove(Ssiz_t pos)
Definition TString.h:685
EFunctionMatchMode
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4