Warning, file /include/root/TApplicationRemote.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_TApplicationRemote
0013 #define ROOT_TApplicationRemote
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #include "RRemoteProtocol.h"
0027 #include "TApplication.h"
0028 #include "TMD5.h"
0029 #include "TUrl.h"
0030 #include "TNamed.h"
0031 #include "TMessage.h"
0032 #include "TSysEvtHandler.h"
0033 #include "RtypesCore.h" // for Longptr_t
0034
0035
0036 class THashList;
0037 class TMonitor;
0038 class TSocket;
0039 class TBrowser;
0040 class TRemoteObject;
0041 class TSeqCollection;
0042
0043 class TApplicationRemote : public TApplication {
0044
0045 public:
0046 enum ESendFileOpt {
0047 kAscii = 0x0,
0048 kBinary = 0x1,
0049 kForce = 0x2
0050 };
0051
0052 enum EStatusBits {
0053 kCollecting = BIT(17)
0054 };
0055
0056 private:
0057 class TARFileStat : public TNamed {
0058 public:
0059 TARFileStat(const char *fn, TMD5 *md5, Long_t mt) :
0060 TNamed(fn,fn), fMD5(*md5), fModtime(mt) { }
0061 TMD5 fMD5;
0062 Long_t fModtime;
0063 };
0064
0065 TString fName;
0066 Int_t fProtocol;
0067 TUrl fUrl;
0068 TSocket *fSocket;
0069 TMonitor *fMonitor;
0070 Bool_t fInterrupt;
0071 TSignalHandler *fIntHandler;
0072
0073 TString fLogFilePath;
0074 THashList *fFileList;
0075
0076 TObject *fReceivedObject;
0077 TSeqCollection *fRootFiles;
0078 TRemoteObject *fWorkingDir;
0079
0080 static Int_t fgPortAttempts;
0081 static Int_t fgPortLower;
0082 static Int_t fgPortUpper;
0083
0084 Int_t Broadcast(const TMessage &mess);
0085 Int_t Broadcast(const char *mess, Int_t kind = kMESS_STRING, Int_t type = kRRT_Undef);
0086 Int_t Broadcast(Int_t kind, Int_t type = kRRT_Undef) { return Broadcast(nullptr, kind, type); }
0087 Int_t BroadcastObject(const TObject *obj, Int_t kind = kMESS_OBJECT);
0088 Int_t BroadcastRaw(const void *buffer, Int_t length);
0089 Bool_t CheckFile(const char *file, Long_t modtime);
0090 Int_t Collect(Long_t timeout = -1);
0091 Int_t CollectInput();
0092
0093 void RecvLogFile(Int_t size);
0094
0095 public:
0096 TApplicationRemote(const char *url, Int_t debug = 0, const char *script = nullptr);
0097 virtual ~TApplicationRemote();
0098
0099 void Browse(TBrowser *b) override;
0100 Bool_t IsFolder() const override { return kTRUE; }
0101 const char *ApplicationName() const override { return fName; }
0102 Longptr_t ProcessLine(const char *line, Bool_t = kFALSE, Int_t *error = nullptr) override;
0103
0104 Int_t SendFile(const char *file, Int_t opt = kAscii,
0105 const char *rfile = nullptr);
0106 Int_t SendObject(const TObject *obj);
0107
0108 void Interrupt(Int_t type = kRRI_Hard);
0109 Bool_t IsValid() const { return (fSocket) ? kTRUE : kFALSE; }
0110
0111 void Print(Option_t *option="") const override;
0112
0113 void Terminate(Int_t status = 0) override;
0114
0115 static void SetPortParam(Int_t lower = -1, Int_t upper = -1, Int_t attempts = -1);
0116
0117 ClassDefOverride(TApplicationRemote,0)
0118 };
0119
0120
0121
0122
0123 class TARInterruptHandler : public TSignalHandler {
0124 private:
0125 TApplicationRemote *fApplicationRemote;
0126 public:
0127 TARInterruptHandler(TApplicationRemote *r)
0128 : TSignalHandler(kSigInterrupt, kFALSE), fApplicationRemote(r) { }
0129 Bool_t Notify() override;
0130 };
0131
0132 #endif