ROOT
Version v6.34
master
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
▼
core
▼
base
►
doc
▼
inc
►
ROOT
►
Bswapcpy.h
►
Buttons.h
►
Bytes.h
►
Byteswap.h
►
GLConstants.h
Gtypes.h
Htypes.h
►
KeySymbols.h
►
Match.h
►
MessageTypes.h
RConfig.h
Riostream.h
Rpair.h
►
RQ_OBJECT.h
►
RStipples.h
►
Rtypes.h
►
RtypesImp.h
Strlen.h
►
TApplication.h
TAtt3D.h
TAttAxis.h
TAttBBox.h
TAttBBox2D.h
►
TAttFill.h
►
TAttLine.h
►
TAttMarker.h
TAttPad.h
►
TAttText.h
TBase64.h
►
TBenchmark.h
►
TBuffer.h
►
TBuffer3D.h
►
TBuffer3DTypes.h
►
TColor.h
►
TColorGradient.h
►
TDatime.h
►
TDirectory.h
►
TEnv.h
►
TException.h
TExec.h
TFileCollection.h
►
TFileInfo.h
TFolder.h
TInetAddress.h
TMacro.h
►
TMathBase.h
►
TMD5.h
TMemberInspector.h
TMessageHandler.h
TNamed.h
►
TNotifyLink.h
►
TObject.h
TObjString.h
TParameter.h
►
TPluginManager.h
►
TPoint.h
►
TPRegexp.h
►
TProcessID.h
TProcessUUID.h
►
TQClass.h
►
TQCommand.h
►
TQConnection.h
►
TQObject.h
►
TRedirectOutputGuard.h
TRef.h
TRefCnt.h
TRegexp.h
TRemoteObject.h
►
TROOT.h
►
TRootIOCtor.h
TStopwatch.h
►
TStorage.h
►
TString.h
►
TStringLong.h
►
TStyle.h
►
TSysEvtHandler.h
►
TSystem.h
TSystemDirectory.h
TSystemFile.h
TTask.h
►
TThreadSlots.h
►
TTime.h
TTimer.h
►
TTimeStamp.h
►
TUri.h
TUrl.h
►
TUUID.h
►
TVersionCheck.h
►
TVirtualAuth.h
TVirtualFFT.h
►
TVirtualGL.h
TVirtualMapFile.h
►
TVirtualMonitoring.h
►
TVirtualMutex.h
►
TVirtualPad.h
TVirtualPadEditor.h
TVirtualPadPainter.h
►
TVirtualPerfStats.h
►
TVirtualPS.h
►
TVirtualQConnection.h
►
TVirtualRWMutex.h
►
TVirtualTableInterface.h
TVirtualViewer3D.h
►
TVirtualX.h
►
Varargs.h
►
src
►
v7
►
clingutils
►
cont
►
dictgen
►
foundation
►
gui
►
imt
►
macosx
►
meta
►
metacling
►
multiproc
►
rint
►
testsupport
►
thread
►
unix
►
winnt
►
zip
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
html
►
io
►
main
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
►
tmva
►
tree
►
tutorials
►
v6-34-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
RQ_OBJECT.h
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
#ifndef ROOT_RQ_OBJECT
13
#define ROOT_RQ_OBJECT
14
15
#include <
TQObject.h
>
16
#include <
Varargs.h
>
17
18
19
//---- RQ_OBJECT macro -----------------------------------------------
20
//
21
// Macro is used to delegate TQObject methods to other classes
22
// Example:
23
//
24
// #include "RQ_OBJECT.h"
25
//
26
// class A {
27
// RQ_OBJECT("A")
28
// private:
29
// Int_t fValue;
30
// public:
31
// A() : fValue(0) { }
32
// ~A() { }
33
//
34
// void SetValue(Int_t value)
35
// void PrintValue() const { printf("value=%d\n", fValue); }
36
// Int_t GetValue() const { return fValue; }
37
// };
38
//
39
// void A::SetValue(Int_t value)
40
// {
41
// // Sets new value
42
//
43
// // to prevent infinite looping in the case
44
// // of cyclic connections
45
// if (value != fValue) {
46
// fValue = value;
47
// Emit("SetValue(Int_t)", fValue);
48
// }
49
// }
50
//
51
// Load this class into root session and try the following:
52
//
53
// a = new A();
54
// b = new A();
55
//
56
// Here is one way to connect two of these objects together:
57
//
58
// a->Connect("SetValue(Int_t)", "A", b, "SetValue(Int_t)");
59
//
60
// Calling a->SetValue(79) will make a emit a signal, which b
61
// will receive, i.e. b->SetValue(79) is invoked. b will in
62
// turn emit the same signal, which nobody receives, since no
63
// slot has been connected to it, so it disappears into hyperspace.
64
//
65
66
#define RQ_OBJECT1(sender_class)\
67
private:\
68
TQObjSender fQObject;\
69
public:\
70
TList *GetListOfSignals() const {return fQObject.GetListOfSignals();}\
71
Bool_t Connect(const char *sig,const char *cl,void *rcvr,const char *slt)\
72
{fQObject.SetSender(this);fQObject.SetSenderClassName(sender_class);return fQObject.Connect(sig,cl,rcvr,slt);}\
73
Bool_t Disconnect(const char *sig=nullptr,void *rcvr=nullptr,const char *slt=nullptr){return fQObject.Disconnect(sig,rcvr,slt);}\
74
void HighPriority(const char *signal_name,const char *slot_name=nullptr){fQObject.HighPriority(signal_name,slot_name);}\
75
void LowPriority(const char *signal_name,const char *slot_name=nullptr){fQObject.LowPriority(signal_name,slot_name);}\
76
template <typename... T> void EmitVA(const char *signal_name, Int_t nargs, const T&... params) \
77
{ fQObject.EmitVA(signal_name,nargs,params...); } \
78
void Emit(const char *signal){EmitVA(signal,
/*nargs*/
0);} \
79
template <typename T> void Emit(const char *signal, const T& arg) { EmitVA(signal,
/*nargs*/
1, arg); } \
80
81
#define RQ_OBJECT2(sender_class)\
82
void Destroyed(){Emit("Destroyed()");}\
83
void ChangedBy(const char *method){Emit("ChangedBy(char*)",method);}\
84
void Message(const char *msg){Emit("Message(char*)",msg);}\
85
private:
86
87
#define RQ_OBJECT(sender_class)\
88
RQ_OBJECT1(sender_class)\
89
RQ_OBJECT2(sender_class)
90
91
#endif
TQObject.h
Varargs.h
core
base
inc
RQ_OBJECT.h
ROOT v6-34 - Reference Guide Generated on Sun Mar 30 2025 16:26:39 (GVA Time) using Doxygen 1.10.0