Warning, file /include/root/TQConnection.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TQConnection
0013 #define ROOT_TQConnection
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #include "TInterpreter.h"
0031 #include "TQObject.h"
0032 #include "TVirtualQConnection.h"
0033
0034 class TQSlot;
0035
0036
0037 class TQConnection : public TVirtualQConnection, public TQObject {
0038 protected:
0039 TQSlot *fSlot = nullptr;
0040 void *fReceiver = nullptr;
0041 TString fClassName;
0042
0043 virtual void PrintCollectionHeader(Option_t* option) const override;
0044
0045 Bool_t CheckSlot(Int_t nargs) const;
0046 void *GetSlotAddress() const;
0047 CallFunc_t *LockSlot() const;
0048 void UnLockSlot(TQSlot *) const;
0049 CallFunc_t *GetSlotCallFunc() const override;
0050
0051 TQConnection &operator=(const TQConnection &) = delete;
0052
0053 void SetArg(Long_t param) override { SetArgImpl(param); }
0054 void SetArg(ULong_t param) override { SetArgImpl(param); }
0055 void SetArg(Float_t param) override { SetArgImpl(param); }
0056 void SetArg(Double_t param) override { SetArgImpl(param); }
0057 void SetArg(Long64_t param) override { SetArgImpl(param); }
0058 void SetArg(ULong64_t param) override { SetArgImpl(param); }
0059 void SetArg(const char * param) override { SetArgImpl(param); }
0060
0061 void SetArg(const Longptr_t *params, Int_t nparam = -1) override;
0062
0063 template <typename T> void SetArgImpl(T arg)
0064 {
0065 CallFunc_t *func = GetSlotCallFunc();
0066 gInterpreter->CallFunc_SetArg(func, arg);
0067 }
0068
0069 void SendSignal() override
0070 {
0071 CallFunc_t *func = LockSlot();
0072
0073 void *address = GetSlotAddress();
0074 TQSlot *s = fSlot;
0075
0076 gInterpreter->CallFunc_Exec(func, address);
0077
0078 UnLockSlot(s);
0079 };
0080
0081 public:
0082 TQConnection() {}
0083 TQConnection(TClass* cl, void *receiver, const char *method_name);
0084 TQConnection(const char *class_name, void *receiver,
0085 const char *method_name);
0086 TQConnection(const TQConnection &con);
0087 virtual ~TQConnection();
0088
0089 const char *GetName() const override;
0090 void *GetReceiver() const { return fReceiver; }
0091 const char *GetClassName() const { return fClassName; }
0092 void Destroyed() override;
0093
0094 void ExecuteMethod(Int_t nargs, va_list va) = delete;
0095 template <typename... T> inline void ExecuteMethod(const T&... params)
0096 {
0097 if (!CheckSlot(sizeof...(params))) return;
0098 SetArgs(params...);
0099 SendSignal();
0100 }
0101
0102 template <typename... T> inline void ExecuteMethod(Int_t , const T&... params)
0103 {
0104 ExecuteMethod(params...);
0105 }
0106
0107
0108
0109 void ExecuteMethod();
0110 void ExecuteMethod(Long_t param);
0111 void ExecuteMethod(Long64_t param);
0112 void ExecuteMethod(Double_t param);
0113 void ExecuteMethod(Longptr_t *params, Int_t nparam = -1);
0114 void ExecuteMethod(const char *params);
0115 void ls(Option_t *option="") const override;
0116
0117 ClassDefOverride(TQConnection,0)
0118 };
0119
0120 R__EXTERN char *gTQSlotParams;
0121
0122 #endif