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