Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TQConnection.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Valeriy Onuchin & Fons Rademakers 15/10/2000
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 TQConnection
13\ingroup Base
14
15TQConnection class is an internal class, used in the object
16communication mechanism.
17
18TQConnection:
19 - is a list of signal_lists containing pointers
20 to this connection
21 - receiver is the object to which slot-method is applied
22*/
23
24#include "TQConnection.h"
25#include "TROOT.h"
26#include "TRefCnt.h"
27#include "TClass.h"
28#include "TMethod.h"
29#include "TMethodArg.h"
30#include "TDataType.h"
31#include "TInterpreter.h"
32#include <iostream>
33#include "TVirtualMutex.h"
34#include "THashTable.h"
35#include "strlcpy.h"
36
37char *gTQSlotParams; // used to pass string parameter
38
39/** \class TQSlot
40Slightly modified TMethodCall class used in the object communication mechanism.
41*/
42
43class TQSlot : public TObject, public TRefCnt {
44
45protected:
46 CallFunc_t *fFunc; // CINT method invocation environment
47 ClassInfo_t *fClass; // CINT class for fFunc
48 TFunction *fMethod; // slot method or global function
49 Longptr_t fOffset; // offset added to object pointer
50 TString fName; // full name of method
51 Int_t fExecuting; // true if one of this slot's ExecuteMethod methods is being called
52public:
53 TQSlot(TClass *cl, const char *method, const char *funcname);
54 TQSlot(const char *class_name, const char *funcname);
55 ~TQSlot() override;
56
57 Bool_t CheckSlot(Int_t nargs) const;
58 Longptr_t GetOffset() const { return fOffset; }
59 CallFunc_t *StartExecuting();
60 CallFunc_t *GetFunc() const { return fFunc; }
61 void EndExecuting();
62
63 const char *GetName() const override { return fName.Data(); }
64
65 Int_t GetMethodNargs() { return fMethod->GetNargs(); }
66
67 void ExecuteMethod(void *object, Int_t nargs, va_list ap) = delete;
68 void ExecuteMethod(void *object);
69 void ExecuteMethod(void *object, Long_t param);
70 void ExecuteMethod(void *object, Long64_t param);
71 void ExecuteMethod(void *object, Double_t param);
72 void ExecuteMethod(void *object, const char *params);
73 void ExecuteMethod(void *object, Longptr_t *paramArr, Int_t nparam = -1);
74 void Print(Option_t *opt = "") const override;
75 void ls(Option_t *opt = "") const override { Print(opt); }
76
77 Bool_t IsExecuting() const { return fExecuting > 0; }
78};
79
80
81////////////////////////////////////////////////////////////////////////////////
82/// Create the method invocation environment. Necessary input
83/// information: the class, full method name with prototype
84/// string of the form: method(char*,int,float).
85/// To initialize class method with default arguments, method
86/// string with default parameters should be of the form:
87///
88/// method(=\"ABC\",1234,3.14) (!! parameter string should
89/// consists of '=').
90///
91/// To execute the method call TQSlot::ExecuteMethod(object,...).
92
93TQSlot::TQSlot(TClass *cl, const char *method_name,
94 const char *funcname) : TObject(), TRefCnt()
95{
96 fFunc = nullptr;
97 fClass = nullptr;
98 fOffset = 0;
99 fMethod = nullptr;
100 fName = "";
101 fExecuting = 0;
102
103 // cl==0, is the case of interpreted function.
104
105 fName = method_name;
106
107 auto len = strlen(method_name) + 1;
108 char *method = new char[len];
109 if (method)
110 strlcpy(method, method_name, len);
111
112 char *proto;
113 char *tmp;
114 char *params = nullptr;
115
116 // separate method and prototype strings
117
118 if ((proto = strchr(method, '('))) {
119
120 // substitute first '(' symbol with '\0'
121 *proto++ = '\0';
122
123 // last ')' symbol with '\0'
124 if ((tmp = strrchr(proto, ')'))) * tmp = '\0';
125 if ((params = strchr(proto, '='))) * params = ' ';
126 }
127
129 fFunc = gCling->CallFunc_Factory();
130
131 // initiate class method (function) with proto
132 // or with default params
133
134 if (cl) {
135 if (params) {
136 gCling->CallFunc_SetFunc(fFunc, cl->GetClassInfo(), method, params, &fOffset);
137 fMethod = cl->GetMethod(method, params);
138 } else {
139 gCling->CallFunc_SetFuncProto(fFunc, cl->GetClassInfo(), method, proto, &fOffset);
140 fMethod = cl->GetMethodWithPrototype(method, proto);
141 }
142 } else {
143 fClass = gCling->ClassInfo_Factory();
144 if (params) {
145 gCling->CallFunc_SetFunc(fFunc, fClass, (char *)funcname, params, &fOffset);
146 fMethod = gROOT->GetGlobalFunction(funcname, params, kFALSE);
147 } else {
148 gCling->CallFunc_SetFuncProto(fFunc, fClass, (char *)funcname, proto, &fOffset);
149 fMethod = gROOT->GetGlobalFunctionWithPrototype(funcname, proto, kFALSE);
150 }
151 }
152
153 // cleaning
154 delete [] method;
155}
156
157////////////////////////////////////////////////////////////////////////////////
158/// Create the method invocation environment. Necessary input
159/// information: the name of class (could be interpreted class),
160/// full method name with prototype or parameter string
161/// of the form: method(char*,int,float).
162/// To initialize class method with default arguments, method
163/// string with default parameters should be of the form:
164///
165/// method(=\"ABC\",1234,3.14) (!! parameter string should
166/// consists of '=').
167///
168/// To execute the method call TQSlot::ExecuteMethod(object,...).
169
170TQSlot::TQSlot(const char *class_name, const char *funcname) :
171 TObject(), TRefCnt()
172{
173 fFunc = nullptr;
174 fClass = nullptr;
175 fOffset = 0;
176 fMethod = nullptr;
177 fName = funcname;
178 fExecuting = 0;
179
180 auto len = strlen(funcname) + 1;
181 char *method = new char[len];
182 if (method)
183 strlcpy(method, funcname, len);
184
185 char *proto;
186 char *tmp;
187 char *params = nullptr;
188
189 // separate method and prototype strings
190
191 if ((proto = strchr(method, '('))) {
192 *proto++ = '\0';
193 if ((tmp = strrchr(proto, ')'))) * tmp = '\0';
194 if ((params = strchr(proto, '='))) * params = ' ';
195 }
196
198 fFunc = gCling->CallFunc_Factory();
199 gCling->CallFunc_IgnoreExtraArgs(fFunc, true);
200
201 fClass = gCling->ClassInfo_Factory();
202 TClass *cl = nullptr;
203
204 if (class_name) {
205 gCling->ClassInfo_Init(fClass, class_name); // class
206 cl = TClass::GetClass(class_name);
207 }
208
209 if (params) {
210 gCling->CallFunc_SetFunc(fFunc, fClass, method, params, &fOffset);
211 if (cl)
212 fMethod = cl->GetMethod(method, params);
213 else
214 fMethod = gROOT->GetGlobalFunction(method, params, kTRUE);
215 } else {
216 gCling->CallFunc_SetFuncProto(fFunc, fClass, method, proto , &fOffset);
217 if (cl)
218 fMethod = cl->GetMethodWithPrototype(method, proto);
219 else
220 fMethod = gROOT->GetGlobalFunctionWithPrototype(method, proto, kTRUE);
221 }
222
223 delete [] method;
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// TQSlot dtor.
228
230{
231 // don't delete executing environment of a slot that is being executed
232 if (!fExecuting) {
233 gCling->CallFunc_Delete(fFunc);
234 gCling->ClassInfo_Delete(fClass);
235 }
236}
237
238////////////////////////////////////////////////////////////////////////////////
239/// ExecuteMethod the method (with preset arguments) for
240/// the specified object.
241
242inline void TQSlot::ExecuteMethod(void *object)
243{
244 ExecuteMethod(object, (Longptr_t*)nullptr, 0);
245
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// Return true if the method is valid and the number of arguments is
250/// acceptable.
251
252inline Bool_t TQSlot::CheckSlot(Int_t nargs) const
253{
254 if (!fMethod) {
255 Error("ExecuteMethod", "method %s not found,"
256 "\n(note: interpreted methods are not supported with varargs)",
257 fName.Data());
258 return kFALSE;
259 }
260
261 if (nargs < fMethod->GetNargs() - fMethod->GetNargsOpt() ||
262 nargs > fMethod->GetNargs()) {
263 Error("ExecuteMethod", "nargs (%d) not consistent with expected number of arguments ([%d-%d])",
264 nargs, fMethod->GetNargs() - fMethod->GetNargsOpt(),
265 fMethod->GetNargs());
266 return kFALSE;
267 }
268
269 return kTRUE;
270}
271
272////////////////////////////////////////////////////////////////////////////////
273/// Mark the slot as executing.
274
276 fExecuting++;
277 return fFunc;
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Mark the slot as no longer executing and cleanup if need be.
282
284 fExecuting--;
286 gCling->CallFunc_Delete(fFunc);
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// ExecuteMethod the method for the specified object and
291/// with single argument value.
292
293inline void TQSlot::ExecuteMethod(void *object, Long_t param)
294{
295 ExecuteMethod(object, (Longptr_t *)&param, 1);
296}
297
298////////////////////////////////////////////////////////////////////////////////
299/// ExecuteMethod the method for the specified object and
300/// with single argument value.
301
302inline void TQSlot::ExecuteMethod(void *object, Long64_t param)
303{
304 Longptr_t *arg = reinterpret_cast<Longptr_t *>(&param);
305 ExecuteMethod(object, arg, 1);
306}
307
308////////////////////////////////////////////////////////////////////////////////
309/// ExecuteMethod the method for the specified object and
310/// with single argument value.
311
312inline void TQSlot::ExecuteMethod(void *object, Double_t param)
313{
314 Longptr_t *arg = reinterpret_cast<Longptr_t *>(&param);
315 ExecuteMethod(object, arg, 1);
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// ExecuteMethod the method for the specified object and text param.
320
321inline void TQSlot::ExecuteMethod(void *object, const char *param)
322{
323 Longptr_t arg = reinterpret_cast<Longptr_t>(param);
324 ExecuteMethod(object, &arg, 1);
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// ExecuteMethod the method for the specified object and with
329/// several argument values.
330/// ParamArr is an array containing the function argument values.
331/// If nparam = -1 then paramArr must contain values for all function
332/// arguments, otherwise Nargs-NargsOpt <= nparam <= Nargs, where
333/// Nargs is the number of all arguments and NargsOpt is the number
334/// of default arguments.
335
336inline void TQSlot::ExecuteMethod(void *object, Longptr_t *paramArr, Int_t nparam)
337{
338 void *address = nullptr;
340 if (paramArr) gCling->CallFunc_SetArgArray(fFunc, paramArr, nparam);
341 if (object) address = (void *)((Longptr_t)object + fOffset);
342 fExecuting++;
343 gCling->CallFunc_Exec(fFunc, address);
344 fExecuting--;
346 gCling->CallFunc_Delete(fFunc);
347}
348
349////////////////////////////////////////////////////////////////////////////////
350/// Print info about slot.
351
353{
354 std::cout << IsA()->GetName() << "\t" << GetName() << "\t"
355 << "Number of Connections = " << References() << std::endl;
356}
357
358////////////////////////////////////////////////////////////////////////////////
359
361private:
363public:
365 fTable = new THashTable(50);
366 }
367 virtual ~TQSlotPool() {
368 fTable->Clear("nodelete");
369 }
370
371 TQSlot *New(const char *class_name, const char *funcname);
372 TQSlot *New(TClass *cl, const char *method, const char *func);
373 void Free(TQSlot *slot);
374};
375
376////////////////////////////////////////////////////////////////////////////////
377/// Create new slot or return already existing one.
378
379TQSlot *TQSlotPool::New(const char *class_name, const char *funcname)
380{
381 TString name = class_name;
382 name += "::";
383 name += funcname;
384
385 TQSlot *slot = (TQSlot *)fTable->FindObject(name.Data());
386
387 if (!slot) {
388 slot = new TQSlot(class_name, funcname);
389 fTable->Add(slot);
390 }
391 slot->AddReference();
392 return slot;
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Create new slot or return already existing one.
397
398TQSlot *TQSlotPool::New(TClass *cl, const char *method, const char *func)
399{
401
402 if (cl) {
403 name = cl->GetName();
404 name += "::";
405 name += method;
406 } else {
407 name = "::";
408 name += func;
409 }
410
411 TQSlot *slot = (TQSlot *)fTable->FindObject(name.Data());
412
413 if (!slot) {
414 slot = new TQSlot(cl, method, func);
415 fTable->Add(slot);
416 }
417 slot->AddReference();
418 return slot;
419}
420
421////////////////////////////////////////////////////////////////////////////////
422/// Delete slot if there is no reference to it.
423
425{
426 slot->RemoveReference(); // decrease references to slot
427
428 if (slot->References() <= 0) {
429 fTable->Remove(slot);
430 if (!slot->IsExecuting()) SafeDelete(slot);
431 }
432}
433
434static TQSlotPool gSlotPool; // global pool of slots
435
436void TQConnection::SetArg(const Longptr_t *params, Int_t nparam/* = -1*/) {
437 if (nparam == -1)
438 nparam = fSlot->GetMethodNargs();
439
440 // FIXME: Why TInterpreter needs non-const SetArgArray. TClingCallFunc
441 // doesn't modify the value.
442 gInterpreter->CallFunc_SetArgArray(fSlot->GetFunc(), const_cast<Longptr_t*>(params), nparam);
443}
444
445
446////////////////////////////////////////////////////////////////////////////////
447/// TQConnection ctor.
448/// cl != 0 - connection to object == receiver of class == cl
449/// and method == method_name
450/// cl == 0 - connection to function with name == method_name
451
452TQConnection::TQConnection(TClass *cl, void *receiver, const char *method_name)
453 : TQObject()
454{
455 const char *funcname = nullptr;
456 fReceiver = receiver; // fReceiver is pointer to receiver
457
458 if (!cl) {
459 Error("SetFCN", "Not used anymore.");
460 /*
461 funcname = gCling->Getp2f2funcname(fReceiver);
462 if (!funcname)
463 Warning("TQConnection", "%s cannot be compiled", method_name);
464 */
465 }
466
467 if (cl) fClassName = cl->GetName();
468 fSlot = gSlotPool.New(cl, method_name, funcname);
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// TQConnection ctor.
473/// Creates connection to method of class specified by name,
474/// it could be interpreted class and with method == funcname.
475
476TQConnection::TQConnection(const char *class_name, void *receiver,
477 const char *funcname) : TQObject()
478{
479 fClassName = class_name;
480 fSlot = gSlotPool.New(class_name, funcname); // new slot-method
481 fReceiver = receiver; // fReceiver is pointer to receiver
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Copy constructor. Ignore connections to this TQConnections
486
488{
490 fSlot = con.fSlot;
491 fSlot->AddReference();
492 fReceiver = con.fReceiver;
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// TQConnection dtor.
497/// - remove this connection from all signal lists
498/// - we do not delete fSlot if it has other connections,
499/// TQSlot::fCounter > 0 .
500
502{
503 TIter next(this);
504 TList *list;
505
506 while ((list = (TList *)next())) {
507 list->Remove(this);
508 if (list->IsEmpty()) delete list; // delete empty list
509 }
510 Clear("nodelete");
511
512 if (!fSlot) return;
513 gSlotPool.Free(fSlot);
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// Returns name of connection (aka name of slot)
518
519const char *TQConnection::GetName() const
520{
521 return fSlot->GetName();
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Signal Destroyed tells that connection is destroyed.
526
528{
529 MakeZombie();
530 Emit("Destroyed()");
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// List TQConnection full method name and list all signals
535/// connected to this connection.
536
537void TQConnection::ls(Option_t *option) const
538{
539 std::cout << "\t" << IsA()->GetName() << "\t" << GetName() << std::endl;
540 ((TQConnection *)this)->R__FOR_EACH(TList, ls)(option);
541}
542
543////////////////////////////////////////////////////////////////////////////////
544/// Print TQConnection full method name and print all
545/// signals connected to this connection.
546
548{
550 std::cout << IsA()->GetName() << "\t" << fReceiver << "\t" << GetName() << std::endl;
551}
552
553////////////////////////////////////////////////////////////////////////////////
554/// Apply slot-method to the fReceiver object without arguments.
555
557{
558 // This connection might be deleted in result of the method execution
559 // (for example in case of a Disconnect). Hence we do not assume
560 // the object is still valid on return.
561 TQSlot *s = fSlot;
562 fSlot->ExecuteMethod(fReceiver);
563 if (s->References() <= 0) delete s;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Apply slot-method to the fReceiver object with
568/// single argument value.
569
571{
572 // This connection might be deleted in result of the method execution
573 // (for example in case of a Disconnect). Hence we do not assume
574 // the object is still valid on return.
575 TQSlot *s = fSlot;
576 fSlot->ExecuteMethod(fReceiver, param);
577 if (s->References() <= 0) delete s;
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Apply slot-method to the fReceiver object with
582/// single argument value.
583
585{
586 // This connection might be deleted in result of the method execution
587 // (for example in case of a Disconnect). Hence we do not assume
588 // the object is still valid on return.
589 TQSlot *s = fSlot;
590 fSlot->ExecuteMethod(fReceiver, param);
591 if (s->References() <= 0) delete s;
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Apply slot-method to the fReceiver object with
596/// single argument value.
597
599{
600 // This connection might be deleted in result of the method execution
601 // (for example in case of a Disconnect). Hence we do not assume
602 // the object is still valid on return.
603 TQSlot *s = fSlot;
604 fSlot->ExecuteMethod(fReceiver, param);
605 if (s->References() <= 0) delete s;
606}
607
608////////////////////////////////////////////////////////////////////////////////
609/// Apply slot-method to the fReceiver object with variable
610/// number of argument values.
611
613{
614 // This connection might be deleted in result of the method execution
615 // (for example in case of a Disconnect). Hence we do not assume
616 // the object is still valid on return.
617 TQSlot *s = fSlot;
618 fSlot->ExecuteMethod(fReceiver, params, nparam);
619 if (s->References() <= 0) delete s;
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Apply slot-method to the fReceiver object and
624/// with string parameter.
625
626void TQConnection::ExecuteMethod(const char *param)
627{
628 // This connection might be deleted in result of the method execution
629 // (for example in case of a Disconnect). Hence we do not assume
630 // the object is still valid on return.
631 TQSlot *s = fSlot;
632 fSlot->ExecuteMethod(fReceiver, param);
633 if (s->References() <= 0) delete s;
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// Return true if the underlying method is value and the number of argument
638/// is compatible.
639
641 return fSlot->CheckSlot(nargs);
642}
643
644////////////////////////////////////////////////////////////////////////////////
645/// Return the object address to be passed to the function.
646
648 if (fReceiver) return (void *)((Longptr_t)fReceiver + fSlot->GetOffset());
649 else return nullptr;
650}
651
652////////////////////////////////////////////////////////////////////////////////
653/// Lock the interpreter and mark the slot as executing.
654
655CallFunc_t *TQConnection::LockSlot() const {
657 return fSlot->StartExecuting();
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Unlock the interpreter and mark the slot as no longer executing.
662
664 s->EndExecuting();
665 if (s->References() <= 0) delete s;
667}
668
669CallFunc_t* TQConnection::GetSlotCallFunc() const {
670 return fSlot->GetFunc();
671}
#define SafeDelete(p)
Definition RConfig.hxx:525
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
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
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
char name[80]
Definition TGX11.cxx:148
#define gInterpreter
externTInterpreter * gCling
externTVirtualMutex * gInterpreterMutex
static TQSlotPool gSlotPool
externchar * gTQSlotParams
#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
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:4469
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:4514
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
THashTable implements a hash table to store TObject's.
Definition THashTable.h:35
void Clear(Option_t *option="") override
Remove all objects from the list.
Definition TList.cxx:532
TList(const TList &)=delete
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
virtual TClass * IsA() const
Definition TObject.h:248
void MakeZombie()
Definition TObject.h:55
TObject()
TObject constructor.
Definition TObject.h:259
void * GetSlotAddress() const
Return the object address to be passed to the function.
CallFunc_t * GetSlotCallFunc() const override
void ExecuteMethod()
Apply slot-method to the fReceiver object without arguments.
void UnLockSlot(TQSlot *) const
Unlock the interpreter and mark the slot as no longer executing.
void * fReceiver
virtual void PrintCollectionHeader(Option_t *option) const override
Print TQConnection full method name and print all signals connected to this connection.
CallFunc_t * LockSlot() const
Lock the interpreter and mark the slot as executing.
void Destroyed() override
Signal Destroyed tells that connection is destroyed.
TString fClassName
Bool_t CheckSlot(Int_t nargs) const
Return true if the underlying method is value and the number of argument is compatible.
TQSlot * fSlot
const char * GetName() const override
Returns name of connection (aka name of slot).
virtual ~TQConnection()
TQConnection dtor.
void SetArg(Long_t param) override
TClass * IsA() const override
void ls(Option_t *option="") const override
List TQConnection full method name and list all signals connected to this connection.
TQObject(const TQObject &)=delete
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
TQSlot * New(const char *class_name, const char *funcname)
Create new slot or return already existing one.
THashTable * fTable
virtual ~TQSlotPool()
void Free(TQSlot *slot)
Delete slot if there is no reference to it.
Slightly modified TMethodCall class used in the object communication mechanism.
Int_t fExecuting
TQSlot(TClass *cl, const char *method, const char *funcname)
Create the method invocation environment.
CallFunc_t * fFunc
~TQSlot() override
TQSlot dtor.
Longptr_t GetOffset() const
void EndExecuting()
Mark the slot as no longer executing and cleanup if need be.
Bool_t IsExecuting() const
Longptr_t fOffset
TFunction * fMethod
const char * GetName() const override
Returns name of object.
CallFunc_t * StartExecuting()
Mark the slot as executing.
TString fName
void ls(Option_t *opt="") const override
The ls function lists the contents of a class on stdout.
Int_t GetMethodNargs()
ClassInfo_t * fClass
void Print(Option_t *opt="") const override
Print info about slot.
CallFunc_t * GetFunc() const
void ExecuteMethod(void *object, Int_t nargs, va_list ap)=delete
Bool_t CheckSlot(Int_t nargs) const
Return true if the method is valid and the number of arguments is acceptable.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition TROOT.cxx:3052
TRefCnt(Int_t initRef=0)
Definition TRefCnt.h:35
void AddReference()
Definition TRefCnt.h:40
UInt_t RemoveReference()
Definition TRefCnt.h:41
UInt_t References() const
Definition TRefCnt.h:38
Basic string class.
Definition TString.h:138
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
Definition TObject.h:409