00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TProofLog
00013 #define ROOT_TProofLog
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ROOT_TDatime
00024 #include "TDatime.h"
00025 #endif
00026 #ifndef ROOT_TNamed
00027 #include "TNamed.h"
00028 #endif
00029 #ifndef ROOT_TQObject
00030 #include "TQObject.h"
00031 #endif
00032
00033 class TMacro;
00034 class TProofLogElem;
00035 class TProofMgr;
00036
00037
00038 class TProofLog : public TNamed, public TQObject {
00039
00040 friend class TProofLogElem;
00041 friend class TProofMgrLite;
00042 friend class TXProofMgr;
00043
00044 private:
00045 TProofMgr *fMgr;
00046 void *fFILE;
00047 TList *fElem;
00048 TDatime fStartTime;
00049
00050 TProofLogElem *Add(const char *ord, const char *url);
00051
00052 public:
00053
00054 enum ELogLocationBit {
00055 kLogToBox = BIT(16)
00056 };
00057 enum ERetrieveOpt { kLeading = 0x1, kTrailing = 0x2,
00058 kAll = 0x3, kGrep = 0x4 };
00059
00060 TProofLog(const char *stag, const char *url, TProofMgr *mgr);
00061 virtual ~TProofLog();
00062
00063 void Display(const char *ord = "*", Int_t from = -10, Int_t to = -1);
00064 TList *GetListOfLogs() const { return fElem; }
00065 Int_t Grep(const char *txt, Int_t from = 0);
00066 void Print(Option_t *opt = 0) const;
00067 void Prt(const char *what);
00068 Int_t Retrieve(const char *ord = "*",
00069 TProofLog::ERetrieveOpt opt = TProofLog::kTrailing,
00070 const char *fname = 0, const char *pattern = 0);
00071 Int_t Save(const char *ord = "*", const char *fname = 0, Option_t *opt="w");
00072
00073 TDatime StartTime() { return fStartTime; }
00074
00075
00076 void SetLogToBox(Bool_t lgbox = kFALSE) { SetBit(kLogToBox, lgbox); }
00077 Bool_t LogToBox() { return (TestBit(kLogToBox)) ? kTRUE : kFALSE; }
00078
00079 static void SetMaxTransferSize(Long64_t maxsz);
00080
00081 ClassDef(TProofLog,0)
00082 };
00083
00084
00085 class TProofLogElem : public TNamed {
00086
00087 private:
00088 TProofLog *fLogger;
00089 TMacro *fMacro;
00090 Long64_t fSize;
00091 Long64_t fFrom;
00092 Long64_t fTo;
00093 TString fRole;
00094
00095 static Long64_t fgMaxTransferSize;
00096
00097
00098
00099
00100 public:
00101 TProofLogElem(const char *ord, const char *url,
00102 TProofLog *logger);
00103 virtual ~TProofLogElem();
00104
00105 void Display(Int_t from = 0, Int_t to = -1);
00106 TMacro *GetMacro() const { return fMacro; }
00107 const char * GetRole() { return fRole.Data(); }
00108 Int_t Grep(const char *txt, TString &res, Int_t from = 0);
00109 Bool_t IsMaster() const { return (fRole == "master") ? kTRUE : kFALSE; }
00110 Bool_t IsSubMaster() const { return (fRole == "submaster") ? kTRUE : kFALSE; }
00111 Bool_t IsWorker() const { return (fRole == "worker") ? kTRUE : kFALSE; }
00112 void Print(Option_t *opt = 0) const;
00113 void Prt(const char *what);
00114 Int_t Retrieve(TProofLog::ERetrieveOpt opt = TProofLog::kTrailing,
00115 const char *pattern = 0);
00116
00117 static Long64_t GetMaxTransferSize();
00118 static void SetMaxTransferSize(Long64_t maxsz);
00119
00120 ClassDef(TProofLogElem,0)
00121 };
00122
00123 #endif