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
34
35////////////////////////////////////////////////////////////////////////////////
36/// Default TMethodCall ctor. Use Init() to initialize the method call
37/// environment.
38
40fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
41{
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Create a method invocation environment for a specific class, method
46/// described by the callfunc.
47
48TMethodCall::TMethodCall(TClass *cl, CallFunc_t *callfunc, Longptr_t offset):
49fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
50{
51 Init(cl, callfunc, offset);
52}
53
54////////////////////////////////////////////////////////////////////////////////
55/// Create a method invocation environment for a specific class, method and
56/// parameters. The parameter string has the form: "\"aap\", 3, 4.35".
57/// To execute the method call TMethodCall::Execute(object,...).
58/// This two step method is much more efficient than calling for
59/// every invocation TInterpreter::Execute(...).
60
61TMethodCall::TMethodCall(TClass *cl, const char *method, const char *params):
62fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
63{
64 Init(cl, method, params);
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Create a global function invocation environment. The parameter
69/// string has the form: "\"aap\", 3, 4,35". To execute the
70/// function call TMethodCall::Execute(...).
71/// This two step method is much more efficient than calling for
72/// every invocation TInterpreter::Execute(...).
73
74TMethodCall::TMethodCall(const char *function, const char *params):
75fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
76{
77 Init(function, params);
78}
79
80////////////////////////////////////////////////////////////////////////////////
81/// Create a global function invocation environment base on a TFunction object.
82/// To execute the function call TMethodCall::Execute(...).
83/// This two step method is much more efficient than calling for
84/// every invocation TInterpreter::Execute(...).
85
87fFunc(nullptr), fOffset(0), fClass(nullptr), fMetPtr(nullptr), fDtorOnly(kFALSE), fRetType(kNone)
88{
89 Init(func);
90}
91////////////////////////////////////////////////////////////////////////////////
92/// Copy ctor.
93
95TObject(orig),
96fFunc(orig.fFunc ? gCling->CallFunc_FactoryCopy(orig.fFunc) : nullptr),
97fOffset(orig.fOffset), fClass(orig.fClass), fMetPtr(nullptr /*!*/),
98fMethod(orig.fMethod), fParams(orig.fParams), fProto(orig.fProto),
100{
101}
102
103////////////////////////////////////////////////////////////////////////////////
104/// Assignment operator.
105
107{
108 if (this != &rhs) {
109 gCling->CallFunc_Delete(fFunc);
110 fFunc = rhs.fFunc ? gCling->CallFunc_FactoryCopy(rhs.fFunc) : nullptr;
111 fOffset = rhs.fOffset;
112 fClass = rhs.fClass;
113 fMethod = rhs.fMethod;
114 fParams = rhs.fParams;
115 fProto = rhs.fProto;
116 fDtorOnly = rhs.fDtorOnly;
117 fRetType = rhs.fRetType;
118
119 delete fMetPtr;
120 fMetPtr = nullptr;
121 }
122
123 return *this;
124}
125
126////////////////////////////////////////////////////////////////////////////////
127/// TMethodCall dtor.
128
130{
131 gCling->CallFunc_Delete(fFunc);
132 delete fMetPtr;
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Return an exact copy of this object.
137
138TObject *TMethodCall::Clone(const char *) const
139{
140 TObject *newobj = new TMethodCall(*this);
141 return newobj;
142}
143
144////////////////////////////////////////////////////////////////////////////////
145/// Helper function to find the scope associated with a qualified
146/// function name
147
148static TClass *R__FindScope(const char *function, UInt_t &pos, ClassInfo_t *cinfo)
149{
150
151//______________________________________________________________________________
152// FIXME: We don't need to split that into lookup scope and lookup member.
153// Consider merging the implementation with the new lookup functionality.
154
155 if (function) {
156 UInt_t nested = 0;
157 for(int i=strlen(function); i>=0; --i) {
158 switch(function[i]) {
159 case '<': ++nested; break;
160 case '>': if (nested==0) { Error("TMethodCall R__FindScope","%s is not well formed function name",function); return nullptr; }
161 --nested; break;
162 case ':':
163 if (nested==0) {
164 if (i>1 && function[i-1]==':') {
165 TString scope(function);
166 scope[i-1] = 0;
167 pos = i+1;
168 TClass *cl = TClass::GetClass(scope);
169 if (!cl) gCling->ClassInfo_Init(cinfo, scope);
170 return cl;
171 }
172 }
173 break;
174 }
175 }
176 }
177 return nullptr;
178}
179
180////////////////////////////////////////////////////////////////////////////////
181/// Initialize the method invocation environment based on
182/// the CallFunc object and the TClass describing the function context.
183
184void TMethodCall::Init(TClass *cl, CallFunc_t *function, Longptr_t offset)
185{
186 if (!function) {
187 fOffset = 0;
189 fRetType = kNone;
190 return;
191 }
192
193 MethodInfo_t* info = gCling->CallFunc_FactoryMethod(function);
194
195 if (!fFunc)
196 fFunc = gCling->CallFunc_Factory();
197 else
198 gCling->CallFunc_Init(fFunc);
199
200 fClass = cl;
201 if (fClass) {
202 fMetPtr = new TMethod(info,cl);
203 } else {
204 fMetPtr = new TFunction(info);
205 }
206 fMethod = fMetPtr->GetName();
207 fParams = "";
208 fProto = fMetPtr->GetSignature()+1; // skip leading )
209 Ssiz_t s = fProto.Last(')');
210 fProto.Remove(s); // still need to remove default values :(
211
212 fOffset = offset;
213
215 fRetType = kNone;
216
217 gCling->CallFunc_SetFunc(fFunc,info);
218
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// Initialize the method invocation environment based on
223/// the TFunction object.
224
225void TMethodCall::Init(const TFunction *function)
226{
227 if (!function) return;
228
229 if (!fFunc)
230 fFunc = gCling->CallFunc_Factory();
231 else
232 gCling->CallFunc_Init(fFunc);
233
234 const TMethod *m = dynamic_cast<const TMethod*>(function);
235 fClass = m ? m->GetClass() : nullptr;
236 fMetPtr = (TFunction*)function->Clone();
237 fMethod = fMetPtr->GetName();
238 fParams = "";
239 fProto = fMetPtr->GetSignature()+1; // skip leading )
240 Ssiz_t s = fProto.Last(')');
241 fProto.Remove(s); // still need to remove default values :(
242
244 fRetType = kNone;
245
246 gCling->CallFunc_SetFunc(fFunc,function->fInfo);
247
248}
249
250////////////////////////////////////////////////////////////////////////////////
251/// Initialize the method invocation environment. Necessary input
252/// information: the class, method name and the parameter string
253/// of the form "\"aap\", 3, 4.35".
254///
255/// To execute the method call TMethodCall::Execute(object,...).
256/// This two step method is much more efficient than calling for
257/// every invocation TInterpreter::Execute(...).
258
259void TMethodCall::Init(TClass *cl, const char *method, const char *params, Bool_t objectIsConst /* = kFALSE */)
260{
261 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
262 if (!cl) {
263 UInt_t pos = 0;
264 cl = R__FindScope(method,pos,cinfo);
265 method = method+pos;
266 }
267 InitImplementation(method,params,nullptr,objectIsConst,cl,cinfo);
268 gCling->ClassInfo_Delete(cinfo);
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Initialize the function invocation environment. Necessary input
273/// information: the function name and the parameter string of
274/// the form "\"aap\", 3, 4.35".
275///
276/// To execute the method call TMethodCall::Execute(...).
277/// This two step method is much more efficient than calling for
278/// every invocation TInterpreter::Execute(...).
279
280void TMethodCall::Init(const char *function, const char *params)
281{
282 UInt_t pos = 0;
283 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
284 TClass *cl = R__FindScope(function,pos,cinfo);
285 InitImplementation(function+pos, params, nullptr, false, cl, cinfo);
286 gCling->ClassInfo_Delete(cinfo);
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// This function implements Init and InitWithPrototype.
291///
292/// 'methodname' should NOT have any scope information in it. The scope
293/// information should be passed via the TClass or CINT ClassInfo.
294
295void TMethodCall::InitImplementation(const char *methodname, const char *params,
296 const char *proto,
297 Bool_t objectIsConst, TClass *cl,
298 const ClassInfo_t *cinfo,
299 ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
300{
301 if (!fFunc) {
303 fFunc = gCling->CallFunc_Factory();
304 } else
305 gCling->CallFunc_Init(fFunc);
306
307 fClass = cl;
308 fMetPtr = nullptr;
309 fMethod = methodname;
310 fParams = params ? params : "";
311 fProto = proto ? proto : "";
313 fRetType = kNone;
314
315 ClassInfo_t *scope = nullptr;
316 if (cl) scope = (ClassInfo_t*)cl->GetClassInfo();
317 else scope = (ClassInfo_t*)cinfo;
318
319 if (!scope) return;
320
322 if (params && params[0]) {
323 gCling->CallFunc_SetFunc(fFunc, scope, (char *)methodname, (char *)params, objectIsConst, &fOffset);
324 } else if (proto && proto[0]) {
325 gCling->CallFunc_SetFuncProto(fFunc, scope, (char *)methodname, (char *)proto, objectIsConst, &fOffset, mode);
326 } else {
327 // No parameters
328 gCling->CallFunc_SetFuncProto(fFunc, scope, (char *)methodname, "", objectIsConst, &fOffset, mode);
329 }
330}
331
332////////////////////////////////////////////////////////////////////////////////
333/// Initialize the method invocation environment. Necessary input
334/// information: the class, method name and the prototype string of
335/// the form: "char*,int,float".
336///
337/// To execute the method call TMethodCall::Execute(object,...).
338/// This two step method is much more efficient than calling for
339/// every invocation TInterpreter::Execute(...).
340
341void TMethodCall::InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst /* = kFALSE */, ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
342{
343 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
344 if (!cl) {
345 UInt_t pos = 0;
346 cl = R__FindScope(method,pos,cinfo);
347 method = method+pos;
348 }
349 InitImplementation(method, nullptr, proto, objectIsConst, cl, cinfo, mode);
350 gCling->ClassInfo_Delete(cinfo);
351}
352
353////////////////////////////////////////////////////////////////////////////////
354/// Initialize the function invocation environment. Necessary input
355/// information: the function name and the prototype string of
356/// the form: "char*,int,float".
357///
358/// To execute the method call TMethodCall::Execute(...).
359/// This two step method is much more efficient than calling for
360/// every invocation TInterpreter::Execute(...).
361
362void TMethodCall::InitWithPrototype(const char *function, const char *proto, ROOT::EFunctionMatchMode mode /* = ROOT::kConversionMatch */)
363{
364 UInt_t pos = 0;
365 ClassInfo_t *cinfo = gCling->ClassInfo_Factory();
366 TClass *cl = R__FindScope(function,pos,cinfo);
367 InitImplementation(function+pos, nullptr, proto, false, cl, cinfo, mode);
368 gCling->ClassInfo_Delete(cinfo);
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Return true if the method call has been properly initialized and is
373/// usable.
374
376{
377 return fFunc ? gCling->CallFunc_IsValid(fFunc) : kFALSE;
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Returns the TMethod describing the method to be executed. This takes
382/// all overriding and overloading into account (call TClass::GetMethod()).
383/// Since finding the method is expensive the result is cached.
384
386{
387 // Since the object in the list of global function are often deleted
388 // we need to copy them.
389
390 if (!fMetPtr) {
391 if (fFunc && gCling->CallFunc_IsValid(fFunc)) {
392 if (fClass) {
393 fMetPtr = new TMethod( gCling->CallFunc_FactoryMethod(fFunc), fClass );
394 } else {
395 fMetPtr = new TFunction( gCling->CallFunc_FactoryMethod(fFunc) );
396 }
397 } else if (fClass) {
398 if (fProto == "") {
399 fMetPtr = fClass->GetMethod(fMethod.Data(), fParams.Data());
400 } else {
401 fMetPtr = fClass->GetMethodWithPrototype(fMethod.Data(), fProto.Data());
402 }
403 TMethod *met = dynamic_cast<TMethod*>(fMetPtr);
404 if (met) fMetPtr = new TMethod(*met);
405 } else {
406 if (fProto == "")
407 fMetPtr = gROOT->GetGlobalFunction(fMethod.Data(), fParams.Data(), kFALSE);
408 else
409 fMetPtr = gROOT->GetGlobalFunctionWithPrototype(fMethod.Data(), fProto.Data(), kFALSE);
410 if (fMetPtr) fMetPtr = new TFunction(*fMetPtr);
411 }
412 }
413
414 return fMetPtr;
415}
416
417////////////////////////////////////////////////////////////////////////////////
418/// Execute the method (with preset arguments) for the specified object.
419
420void TMethodCall::Execute(void *object)
421{
422 if (!fFunc) return;
423
424 void *address = nullptr;
425 if (object) address = (void*)((Longptr_t)object + fOffset);
426 if (!fDtorOnly && fMethod[0]=='~') {
427 Error("Execute","TMethodCall can no longer be use to call the operator delete and the destructor at the same time");
428 }
429 gCling->CallFunc_Exec(fFunc,address);
430}
431
432////////////////////////////////////////////////////////////////////////////////
433/// Execute the method for the specified object and argument values.
434
435void TMethodCall::Execute(void *object, const char *params)
436{
437 if (!fFunc) return;
438
439 // SetArgs contains the necessary lock.
440 gCling->CallFunc_SetArgs(fFunc, (char *)params);
441
442 void *address = nullptr;
443 if (object) address = (void*)((Longptr_t)object + fOffset);
444 gCling->SetTempLevel(1);
445 gCling->CallFunc_Exec(fFunc,address);
446 gCling->SetTempLevel(-1);
447}
448
449////////////////////////////////////////////////////////////////////////////////
450/// Execute the method (with preset arguments) for the specified object.
451
452void TMethodCall::Execute(void *object, Longptr_t &retLong)
453{
454 if (!fFunc) return;
455
456 void *address = nullptr;
457 if (object) address = (void*)((Longptr_t)object + fOffset);
458 gCling->SetTempLevel(1);
459 retLong = gCling->CallFunc_ExecInt(fFunc,address);
460 gCling->SetTempLevel(-1);
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Execute the method for the specified object and argument values.
465
466void TMethodCall::Execute(void *object, const char *params, Longptr_t &retLong)
467{
468 if (!fFunc) return;
469
470 // SetArgs contains the necessary lock.
471 gCling->CallFunc_SetArgs(fFunc, (char *)params);
472
473 void *address = nullptr;
474 if (object) address = (void*)((Longptr_t)object + fOffset);
475 gCling->SetTempLevel(1);
476 retLong = gCling->CallFunc_ExecInt(fFunc,address);
477 gCling->SetTempLevel(-1);
478}
479
480////////////////////////////////////////////////////////////////////////////////
481/// Execute the method (with preset arguments) for the specified object.
482
483void TMethodCall::Execute(void *object, Double_t &retDouble)
484{
485 if (!fFunc) return;
486
487 void *address = nullptr;
488 if (object) address = (void*)((Longptr_t)object + fOffset);
489 gCling->SetTempLevel(1);
490 retDouble = gCling->CallFunc_ExecDouble(fFunc,address);
491 gCling->SetTempLevel(-1);
492}
493
494////////////////////////////////////////////////////////////////////////////////
495/// Execute the method for the specified object and argument values.
496
497void TMethodCall::Execute(void *object, const char *params, Double_t &retDouble)
498{
499 if (!fFunc) return;
500
501 gCling->CallFunc_SetArgs(fFunc, (char *)params);
502
503 void *address = nullptr;
504 if (object) address = (void*)((Longptr_t)object + fOffset);
505 gCling->SetTempLevel(1);
506 retDouble = gCling->CallFunc_ExecDouble(fFunc,address);
507 gCling->SetTempLevel(-1);
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Execute the method (with preset arguments) for the specified object.
512
513void TMethodCall::Execute(void *object, char **retText)
514{
515 if (!fFunc) return;
516
517 void *address = nullptr;
518 if (object) address = (void*)((Longptr_t)object + fOffset);
519 gCling->SetTempLevel(1);
520 *retText =(char*) (gCling->CallFunc_ExecInt(fFunc,address));
521 gCling->SetTempLevel(-1);
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Execute the method for the specified object and argument values.
526
527void TMethodCall::Execute(void *object, const char *params, char **retText)
528{
529 if (!fFunc) return;
530
531 // SetArgs contains the necessary lock.
532 gCling->CallFunc_SetArgs(fFunc, (char *)params);
533
534 void *address = nullptr;
535 if (object) address = (void*)((Longptr_t)object + fOffset);
536 gCling->SetTempLevel(1);
537 *retText =(char*)(gCling->CallFunc_ExecInt(fFunc,address));
538 gCling->SetTempLevel(-1);
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Invoke the method
543///
544/// \param[in] objAddress Address of the object to execute the method (nullptr if it is a free function)
545/// \param[in] args Array of pointer to the address of the argument to pass to the
546/// function as is. *No* conversion is done, the argument must be
547/// of the expected type.
548/// \param[in] nargs Number of arguments passed (must be less than actua size of args
549/// \param[out] ret Address of value (or object) to use for the return value.
550
551void TMethodCall::Execute(void *objAddress, const void* args[], int nargs, void *ret /* = 0 */)
552{
553 if (!fFunc) return;
554
555 gCling->CallFunc_ExecWithArgsAndReturn(fFunc,objAddress,args,nargs,ret);
556
557}
558
559////////////////////////////////////////////////////////////////////////////////
560/// Returns the return type of the method. Either (unsigned) long,
561/// int, short and char, or float and double or anything else.
562/// Since finding the return type is expensive the result is cached.
563
565{
566 if ( fRetType == kNone) {
567 TFunction *func = GetMethod();
568 if (func == nullptr) {
570 Error("ReturnType","Unknown method");
571 return kOther;
572 }
573
574 fRetType = gCling->MethodCallReturnType(func);
575 }
576
577 return fRetType;
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// \brief Set pointers to parameters
582/// \param paramArr an array containing the function argument values.
583/// \param nparam number of parameters should fulfill Nargs-NargsOpt <= nparam
584/// <= Nargs, where Nargs is the number of all arguments and NargsOpt is the
585/// number of default arguments.
586
587void TMethodCall::SetParamPtrs(void *paramArr, Int_t nparam)
588{
589 if (!fFunc) return;
590 gCling->CallFunc_SetArgArray(fFunc,(Longptr_t *)paramArr, nparam);
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Reset parameter list. To be used before the first call the SetParam().
595
597{
598 if (!fFunc) return;
599 gCling->CallFunc_ResetArg(fFunc);
600}
601
602////////////////////////////////////////////////////////////////////////////////
603/// Add a long method parameter.
604
606{
607 if (!fFunc) return;
608 gCling->CallFunc_SetArg(fFunc,l);
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// Add a double method parameter.
613
615{
616 if (!fFunc) return;
617 gCling->CallFunc_SetArg(fFunc,f);
618}
619
620////////////////////////////////////////////////////////////////////////////////
621/// Add a double method parameter.
622
624{
625 if (!fFunc) return;
626 gCling->CallFunc_SetArg(fFunc,d);
627}
628
629////////////////////////////////////////////////////////////////////////////////
630/// Add a long long method parameter.
631
633{
634 if (!fFunc) return;
635 gCling->CallFunc_SetArg(fFunc,ll);
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Add a unsigned long long method parameter.
640
642{
643 if (!fFunc) return;
644 gCling->CallFunc_SetArg(fFunc,ull);
645}
#define d(i)
Definition RSha256.hxx:102
#define f(i)
Definition RSha256.hxx:104
char * ret
Definition Rotated.cxx:221
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
Definition RtypesCore.h:89
int Ssiz_t
String size (currently int).
Definition RtypesCore.h:81
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
Definition RtypesCore.h:84
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externTInterpreter * gCling
externTVirtualMutex * gInterpreterMutex
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:417
#define R__LOCKGUARD(mutex)
const char * proto
Definition civetweb.c:18822
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
ClassInfo_t * GetClassInfo() const
Definition TClass.h:448
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:2994
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
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.
TInterpreter::EReturnType EReturnType
Definition TMethodCall.h:40
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)
Set pointers to parameters.
TString fMethod
Definition TMethodCall.h:58
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
TObject()
TObject constructor.
Definition TObject.h:259
Basic string class.
Definition TString.h:138
EFunctionMatchMode
TMarker m
Definition textangle.C:8
TLine l
Definition textangle.C:4