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