/usr/include/root/RQ_OBJECT.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 | // @(#)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_RQ_OBJECT
#define ROOT_RQ_OBJECT
#include <TQObject.h>
#include <Varargs.h>
//---- RQ_OBJECT macro -----------------------------------------------
//
// Macro is used to delegate TQObject methods to other classes
// Example:
//
// #include "RQ_OBJECT.h"
//
// class A {
// RQ_OBJECT("A")
// private:
// Int_t fValue;
// public:
// A() : fValue(0) { }
// ~A() { }
//
// void SetValue(Int_t value)
// void PrintValue() const { printf("value=%d\n", fValue); }
// Int_t GetValue() const { return fValue; }
// };
//
// void A::SetValue(Int_t value)
// {
// // Sets new value
//
// // to prevent infinite looping in the case
// // of cyclic connections
// if (value != fValue) {
// fValue = value;
// Emit("SetValue(Int_t)", fValue);
// }
// }
//
// Load this class into root session and try the folllowing:
//
// a = new A();
// b = new A();
//
// Here is one way to connect two of these objects together:
//
// a->Connect("SetValue(Int_t)", "A", b, "SetValue(Int_t)");
//
// Calling a->SetValue(79) will make a emit a signal, which b
// will receive, i.e. b->SetValue(79) is invoked. b will in
// turn emit the same signal, which nobody receives, since no
// slot has been connected to it, so it disappears into hyperspace.
//
#define RQ_OBJECT1(sender_class)\
private:\
TQObjSender fQObject;\
public:\
TList *GetListOfSignals() const {return fQObject.GetListOfSignals();}\
Bool_t Connect(const char *sig,const char *cl,void *rcvr,const char *slt)\
{fQObject.SetSender(this);fQObject.SetSenderClassName(sender_class);return fQObject.Connect(sig,cl,rcvr,slt);}\
Bool_t Disconnect(const char *sig=0,void *rcvr=0,const char *slt=0){return fQObject.Disconnect(sig,rcvr,slt);}\
void HighPriority(const char *signal_name,const char *slot_name=0){fQObject.HighPriority(signal_name,slot_name);}\
void LowPriority(const char *signal_name,const char *slot_name=0){fQObject.LowPriority(signal_name,slot_name);}\
void EmitVA(const char *signal,Int_t nargs, ...){va_list ap;va_start(ap,nargs);fQObject.EmitVA(signal,nargs,ap);va_end(ap);}\
void Emit(const char *signal){fQObject.Emit(signal);}\
void Emit(const char *signal,const char *params){fQObject.Emit(signal,params);}\
void Emit(const char *signal,Long_t *paramArr){fQObject.Emit(signal,paramArr);}\
void Emit(const char *signal,Double_t param){fQObject.Emit(signal,param);}\
void Emit(const char *signal,Long_t param){fQObject.Emit(signal,param);}
#define RQ_OBJECT2(sender_class)\
void Emit(const char *signal,Long64_t param){fQObject.Emit(signal,param);}\
void Emit(const char *signal,ULong64_t param){fQObject.Emit(signal,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,Float_t param){Emit(signal,(Double_t)param);}\
void Destroyed(){Emit("Destroyed()");}\
void ChangedBy(const char *method){Emit("ChangedBy(char*)",method);}\
void Message(const char *msg){Emit("Message(char*)",msg);}\
private:
#define RQ_OBJECT(sender_class)\
RQ_OBJECT1(sender_class)\
RQ_OBJECT2(sender_class)
//--- Only used in TQObject::Load_RQ_OBJECT()
#define _QUOTE2_(string)\
_QUOTE_(string)
#define RQ_OBJECT_STRING1\
_QUOTE_(#define RQ_OBJECT1(sender_class))\
_QUOTE2_(RQ_OBJECT1(sender_class))
#define RQ_OBJECT_STRING2\
_QUOTE_(#define RQ_OBJECT2(sender_class))\
_QUOTE2_(RQ_OBJECT2(sender_class))
#define RQ_OBJECT_STRING\
_QUOTE_(#define RQ_OBJECT(sender_class)\
RQ_OBJECT1(sender_class)\
RQ_OBJECT2(sender_class))
#endif
|