/usr/include/root/TProofOutputFile.h is in libroot-proof-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | // @(#)root/proof:$Id$
// Author: Long Tran-Thanh 14/09/07
/*************************************************************************
* Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TProofOutputFile
#define ROOT_TProofOutputFile
//////////////////////////////////////////////////////////////////////////
// //
// TProofOutputFile //
// //
// Small class to steer the merging of files produced on workers //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TCollection;
class TString;
class TList;
class TFile;
class TFileCollection;
class TFileMerger;
class TProofOutputFile : public TNamed {
friend class TProof;
friend class TProofPlayer;
friend class TProofPlayerRemote;
public:
enum ERunType { kMerge = 1, // Type of run: merge or dataset creation
kDataset = 2};
enum ETypeOpt { kRemote = 1, // Merge from original copies
kLocal = 2, // Make local copies before merging
kCreate = 4, // Create dataset
kRegister = 8, // Register dataset
kOverwrite = 16, // Force dataset replacement during registration
kVerify = 32}; // Verify the registered dataset
private:
TProofOutputFile(const TProofOutputFile&); // Not implemented
TProofOutputFile& operator=(const TProofOutputFile&); // Not implemented
TString fDir; // name of the directory to be exported
TString fRawDir; // name of the local directory where to create the file
TString fFileName;
TString fOptionsAnchor; // options and anchor string including delimiters, e.g. "?myopts#myanchor"
TString fOutputFileName;
TString fWorkerOrdinal;
TString fLocalHost; // Host where the file was created
Bool_t fIsLocal; // kTRUE if the file is in the sandbox
Bool_t fMerged;
ERunType fRunType; // Type of run (see enum ERunType)
UInt_t fTypeOpt; // Option (see enum ETypeOpt)
Bool_t fMergeHistosOneGo; // If true merge histos in one go (argument to TFileMerger)
TFileCollection *fDataSet; // Instance of the file collection in 'dataset' mode
TFileMerger *fMerger; // Instance of the file merger in 'merge' mode
void Init(const char *path, const char *dsname);
void SetFileName(const char* name) { fFileName = name; }
void SetDir(const char* dir, Bool_t raw = kFALSE) { if (raw) { fRawDir = dir; } else { fDir = dir; } }
void SetMerged(Bool_t merged = kTRUE) { fMerged = merged; }
void SetWorkerOrdinal(const char* ordinal) { fWorkerOrdinal = ordinal; }
void AddFile(TFileMerger *merger, const char *path);
void NotifyError(const char *errmsg);
void Unlink(const char *path);
protected:
public:
enum EStatusBits {
kOutputFileNameSet = BIT(16),
kRetrieve = BIT(17), // If set, the file is copied to the final destination via the client
kSwapFile = BIT(18) // Set when the represented file is the result of the automatic
// save-to-file functionality
};
TProofOutputFile() : fDir(), fRawDir(), fFileName(), fOptionsAnchor(), fOutputFileName(),
fWorkerOrdinal(), fLocalHost(), fIsLocal(kFALSE), fMerged(kFALSE),
fRunType(kMerge), fTypeOpt(kRemote), fMergeHistosOneGo(kFALSE),
fDataSet(0), fMerger(0) { }
TProofOutputFile(const char *path, const char *option = "M", const char *dsname = 0);
TProofOutputFile(const char *path, ERunType type, UInt_t opt = kRemote, const char *dsname = 0);
virtual ~TProofOutputFile();
const char *GetDir(Bool_t raw = kFALSE) const { return (raw) ? fRawDir : fDir; }
TFileCollection *GetFileCollection();
TFileMerger *GetFileMerger(Bool_t local = kFALSE);
const char *GetFileName() const { return fFileName; }
const char *GetLocalHost() const { return fLocalHost; }
const char *GetOptionsAnchor() const { return fOptionsAnchor; }
const char *GetOutputFileName() const { return fOutputFileName; }
const char *GetWorkerOrdinal() const { return fWorkerOrdinal; }
ERunType GetRunType() const { return fRunType; }
UInt_t GetTypeOpt() const { return fTypeOpt; }
Bool_t IsMerge() const { return (fRunType == kMerge) ? kTRUE : kFALSE; }
Bool_t IsMerged() const { return fMerged; }
Bool_t IsRegister() const { return ((fTypeOpt & kRegister) || (fTypeOpt & kVerify)) ? kTRUE : kFALSE; }
Bool_t IsRetrieve() const { return (TestBit(TProofOutputFile::kRetrieve)) ? kTRUE : kFALSE; }
void SetRetrieve(Bool_t on = kTRUE) { if (on) { SetBit(TProofOutputFile::kRetrieve);
} else { ResetBit(TProofOutputFile::kRetrieve); }}
Int_t AdoptFile(TFile *f); // Adopt a TFile already open
TFile* OpenFile(const char *opt); // Open a file with the specified name in fFileName1
Long64_t Merge(TCollection *list);
void Print(Option_t *option = "") const;
void SetOutputFileName(const char *name);
void ResetFileCollection() { fDataSet = 0; }
static Int_t AssertDir(const char *dirpath);
ClassDef(TProofOutputFile,5) // Wrapper class to steer the merging of files produced on workers
};
#endif
|