00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TProofOutputFile
00013 #define ROOT_TProofOutputFile
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TNamed
00025 #include "TNamed.h"
00026 #endif
00027
00028 class TCollection;
00029 class TProofOutputFile;
00030 class TString;
00031 class TList;
00032 class TFile;
00033 class TFileCollection;
00034 class TFileMerger;
00035
00036 class TProofOutputFile : public TNamed {
00037
00038 friend class TProof;
00039 friend class TProofPlayer;
00040
00041 public:
00042 enum ERunType { kMerge = 1,
00043 kDataset = 2};
00044 enum ETypeOpt { kRemote = 1,
00045 kLocal = 2,
00046 kCreate = 4,
00047 kRegister = 8,
00048 kOverwrite = 16,
00049 kVerify = 32};
00050
00051 private:
00052 TProofOutputFile(const TProofOutputFile&);
00053 TProofOutputFile& operator=(const TProofOutputFile&);
00054
00055 TString fDir;
00056 TString fRawDir;
00057 TString fFileName;
00058 TString fOptionsAnchor;
00059 TString fOutputFileName;
00060 TString fWorkerOrdinal;
00061 TString fLocalHost;
00062 Bool_t fIsLocal;
00063 Bool_t fMerged;
00064 ERunType fRunType;
00065 UInt_t fTypeOpt;
00066
00067 TFileCollection *fDataSet;
00068 TFileMerger *fMerger;
00069
00070 void Init(const char *path, const char *dsname);
00071 void SetFileName(const char* name);
00072 void SetDir(const char* dir) { fDir = dir; }
00073 void SetWorkerOrdinal(const char* ordinal) { fWorkerOrdinal = ordinal; }
00074
00075 void AddFile(TFileMerger *merger, const char *path);
00076 void NotifyError(const char *errmsg);
00077 void Unlink(const char *path);
00078
00079 protected:
00080
00081 public:
00082 TProofOutputFile() : fDir(), fRawDir(), fFileName(), fOptionsAnchor(), fOutputFileName(),
00083 fWorkerOrdinal(), fLocalHost(), fIsLocal(kFALSE), fMerged(kFALSE),
00084 fRunType(kMerge), fTypeOpt(kRemote), fDataSet(0), fMerger(0) { }
00085 TProofOutputFile(const char *path, const char *option = "M", const char *dsname = 0);
00086 TProofOutputFile(const char *path, ERunType type, UInt_t opt = kRemote, const char *dsname = 0);
00087 virtual ~TProofOutputFile();
00088
00089 const char *GetDir(Bool_t raw = kFALSE) const { return (raw) ? fRawDir : fDir; }
00090 TFileCollection *GetFileCollection();
00091 TFileMerger *GetFileMerger(Bool_t local = kFALSE);
00092 const char *GetFileName() const { return fFileName; }
00093 const char *GetLocalHost() const { return fLocalHost; }
00094 const char *GetOptionsAnchor() const { return fOptionsAnchor; }
00095 const char *GetOutputFileName() const { return fOutputFileName; }
00096 const char *GetWorkerOrdinal() const { return fWorkerOrdinal; }
00097
00098 ERunType GetRunType() const { return fRunType; }
00099 UInt_t GetTypeOpt() const { return fTypeOpt; }
00100 Bool_t IsMerge() const { return (fRunType == kMerge) ? kTRUE : kFALSE; }
00101 Bool_t IsMerged() const { return fMerged; }
00102 Bool_t IsRegister() const { return ((fTypeOpt & kRegister) || (fTypeOpt & kVerify)) ? kTRUE : kFALSE; }
00103
00104 Int_t AdoptFile(TFile *f);
00105 TFile* OpenFile(const char *opt);
00106 Long64_t Merge(TCollection *list);
00107 void Print(Option_t *option = "") const;
00108 void SetOutputFileName(const char *name);
00109 void ResetFileCollection() { fDataSet = 0; }
00110
00111 ClassDef(TProofOutputFile,4)
00112 };
00113
00114 #endif