/usr/include/root/TQObject.h is in libroot-core-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | // @(#)root/base:$Id$
// Author: Valeriy Onuchin & Fons Rademakers 15/10/2000
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TQObject
#define ROOT_TQObject
//////////////////////////////////////////////////////////////////////////
// //
// This is the ROOT implementation of the Qt object communication //
// mechanism (see also http://www.troll.no/qt/metaobjects.html) //
// //
// Signals and slots are used for communication between objects. //
// When an object has changed in some way that might be interesting //
// for the outside world, it emits a signal to tell whoever is //
// listening. All slots that are connected to this signal will be //
// activated (called). It is even possible to connect a signal //
// directly to another signal (this will emit the second signal //
// immediately whenever the first is emitted.) There is no limitation //
// on the number of slots that can be connected to a signal. //
// The slots will be activated in the order they were connected //
// to the signal. This mechanism allows objects to be easily reused, //
// because the object that emits a signal does not need to know //
// to what the signals are connected to. //
// Together, signals and slots make up a powerfull component //
// programming mechanism. //
// //
// This implementation is provided by //
// Valeriy Onuchin (onuchin@sirius.ihep.su). //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TString
#include "TString.h"
#endif
class TList;
class TObject;
class TQConnection;
class TClass;
class TQObject {
friend class TQConnection;
protected:
TList *fListOfSignals; //! list of signals from this object
TList *fListOfConnections; //! list of connections to this object
Bool_t fSignalsBlocked; //! flag used for suppression of signals
static Bool_t fgAllSignalsBlocked; // flag used for suppression of all signals
virtual void *GetSender() { return this; }
virtual const char *GetSenderClassName() const { return ""; }
static Bool_t ConnectToClass(TQObject *sender,
const char *signal,
TClass *receiver_class,
void *receiver,
const char *slot);
static Bool_t ConnectToClass(const char *sender_class,
const char *signal,
TClass *receiver_class,
void *receiver,
const char *slot);
static Int_t CheckConnectArgs(TQObject *sender,
TClass *sender_class, const char *signal,
TClass *receiver_class, const char *slot);
private:
TQObject(const TQObject& tqo); // not implemented
TQObject& operator=(const TQObject& tqo); // not implemented
public:
TQObject();
virtual ~TQObject();
TList *GetListOfClassSignals() const;
TList *GetListOfSignals() const { return fListOfSignals; }
TList *GetListOfConnections() const { return fListOfConnections; }
Bool_t AreSignalsBlocked() const { return fSignalsBlocked; }
Bool_t BlockSignals(Bool_t b)
{ Bool_t ret = fSignalsBlocked; fSignalsBlocked = b; return ret; }
void CollectClassSignalLists(TList& list, TClass* cls);
void EmitVA(const char *signal, Int_t nargs, ...);
void EmitVA(const char *signal, Int_t nargs, va_list va);
void Emit(const char *signal);
void Emit(const char *signal, Long_t *paramArr);
void Emit(const char *signal, const char *params);
void Emit(const char *signal, Double_t param);
void Emit(const char *signal, Long_t param);
void Emit(const char *signal, Long64_t param);
void Emit(const char *signal, Bool_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, Char_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, UChar_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, Short_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, UShort_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, Int_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, UInt_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, ULong_t param)
{ Emit(signal, (Long_t)param); }
void Emit(const char *signal, ULong64_t param)
{ Emit(signal, (Long64_t) param); }
void Emit(const char *signal, Float_t param)
{ Emit(signal, (Double_t)param); }
Bool_t Connect(const char *signal,
const char *receiver_class,
void *receiver,
const char *slot);
Bool_t Disconnect(const char *signal = 0,
void *receiver = 0,
const char *slot = 0);
virtual void HighPriority(const char *signal_name,
const char *slot_name = 0);
virtual void LowPriority(const char *signal_name,
const char *slot_name = 0);
virtual Bool_t HasConnection(const char *signal_name) const;
virtual Int_t NumberOfSignals() const;
virtual Int_t NumberOfConnections() const;
virtual void Connected(const char * /*signal_name*/) { }
virtual void Disconnected(const char * /*signal_name*/) { }
virtual void Destroyed()
{ Emit("Destroyed()"); } // *SIGNAL*
virtual void ChangedBy(const char *method)
{ Emit("ChangedBy(char*)", method); } // *SIGNAL*
virtual void Message(const char *msg)
{ Emit("Message(char*)", msg); } // *SIGNAL*
static Bool_t Connect(TQObject *sender,
const char *signal,
const char *receiver_class,
void *receiver,
const char *slot);
static Bool_t Connect(const char *sender_class,
const char *signal,
const char *receiver_class,
void *receiver,
const char *slot);
static Bool_t Disconnect(TQObject *sender,
const char *signal = 0,
void *receiver = 0,
const char *slot = 0);
static Bool_t Disconnect(const char *class_name,
const char *signal,
void *receiver = 0,
const char *slot = 0);
static Bool_t AreAllSignalsBlocked();
static Bool_t BlockAllSignals(Bool_t b);
static void LoadRQ_OBJECT();
ClassDef(TQObject,1) //Base class for object communication mechanism
};
R__EXTERN void *gTQSender; // the latest sender object
class TQObjSender : public TQObject {
protected:
void *fSender; //delegation object
TString fSenderClass; //class name of delegation object
virtual void *GetSender() { return fSender; }
virtual const char *GetSenderClassName() const { return fSenderClass; }
private:
TQObjSender(const TQObjSender&); // not implemented
TQObjSender& operator=(const TQObjSender&); // not implemented
public:
TQObjSender() : TQObject(), fSender(0), fSenderClass() { }
virtual ~TQObjSender() { Disconnect(); }
virtual void SetSender(void *sender) { fSender = sender; }
void SetSenderClassName(const char *sclass = "") { fSenderClass = sclass; }
ClassDef(TQObjSender,0) //Used to "delegate" TQObject functionality
//to interpreted classes, see also RQ_OBJECT.h
};
// Global function which simplifies making connections in interpreted
// ROOT session
//
// ConnectCINT - connects to interpreter(CINT) command
extern Bool_t ConnectCINT(TQObject *sender, const char *signal,
const char *slot);
#ifdef G__DICTIONARY
// This include makes it possible to have a single connection
// from all objects of the same class but is only needed in
// the dictionary.
#include "TQClass.h"
#endif
//---- ClassImpQ macro ----------------------------------------------
//
// This macro used to correspond to the ClassImp macro and should be used
// for classes derived from TQObject instead of the ClassImp macro.
// This macro makes it possible to have a single connection from
// all objects of the same class.
// *** It is now obsolete ***
#define ClassImpQ(name) \
ClassImp(name)
#endif
|