File indexing completed on 2025-01-18 10:12:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TVirtualQConnection
0013 #define ROOT_TVirtualQConnection
0014
0015 #include "TList.h"
0016 #include "TInterpreter.h"
0017
0018
0019
0020
0021
0022
0023 class TVirtualQConnection : public TList {
0024 protected:
0025 virtual CallFunc_t *GetSlotCallFunc() const = 0;
0026 virtual void SetArg(Long_t) = 0;
0027 virtual void SetArg(ULong_t) = 0;
0028 virtual void SetArg(Float_t) = 0;
0029 virtual void SetArg(Double_t) = 0;
0030 virtual void SetArg(Long64_t) = 0;
0031 virtual void SetArg(ULong64_t) = 0;
0032
0033
0034 virtual void SetArg(const Longptr_t *, Int_t = -1) = 0;
0035 virtual void SetArg(const char *) = 0;
0036 void SetArg(const void *ptr) { SetArg((Longptr_t)ptr); };
0037
0038
0039 template <class T, class = typename std::enable_if<std::is_integral<T>::value>::type>
0040 void SetArg(const T& val)
0041 {
0042 if (std::is_signed<T>::value)
0043 SetArg((Longptr_t)val);
0044 else
0045 SetArg((ULongptr_t)val);
0046 }
0047
0048 void SetArgsImpl() {}
0049 template <typename T, typename... Ts> void SetArgsImpl(const T& arg, const Ts&... tail)
0050 {
0051 SetArg(arg);
0052 SetArgsImpl(tail...);
0053 }
0054 public:
0055 virtual void SendSignal() = 0;
0056
0057
0058
0059 template <typename... T> void SetArgs(const T&... args)
0060 {
0061
0062
0063
0064
0065
0066 if (!sizeof...(args)) return;
0067 gInterpreter->CallFunc_ResetArg(GetSlotCallFunc());
0068 SetArgsImpl(args...);
0069 }
0070
0071
0072
0073
0074 void SetArgs(const Longptr_t* argArray, Int_t nargs = -1)
0075 {
0076 SetArg(argArray, nargs);
0077 }
0078 };
0079
0080 #endif