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