/*
$Log$
+Revision 1.5 2002/04/09 13:38:47 jchudoba
+Add const to the filename argument
+
Revision 1.4 2001/12/03 07:10:13 jchudoba
Default ctor cannot create new objects, create dummy default ctor which leaves object in not well defined state - to be used only by root for I/O
AliStream::~AliStream()
{
// default dtor
- if (fFileNames) delete fFileNames;
+ if (fFileNames) {
+ fFileNames->Delete();
+ delete fFileNames;
+ }
}
////////////////////////////////////////////////////////////////////////
if (!gAlice) return kFALSE;
return kTRUE;
}
+////////////////////////////////////////////////////////////////////////
+TString AliStream::GetFileName(const Int_t order) const
+// returns name of the order-th file
+// returns empty string if such file does not exist
+// first file in the input stream is 0
+{
+ TString fileName("");
+ if (order > fFileNames->GetLast()) return fileName;
+ TObjString *fileNameStored = dynamic_cast<TObjString*>(fFileNames->At(order));
+ if (fileNameStored) fileName = fileNameStored->GetString();
+ return fileName;
+}
+////////////////////////////////////////////////////////////////////////
// --- ROOT system ---
#include "TNamed.h"
#include "TObjString.h"
+#include "TString.h"
#include "TArrayI.h"
#include "TClonesArray.h"
#include "TFile.h"
Bool_t ImportgAlice();
TFile* CurrentFile() { return fCurrentFile;}
void ChangeMode(Option_t* option); // reset READ or UPDATE mode
+ Int_t GetNInputFiles() const {return fFileNames->GetLast()+1;}
+ TString GetFileName(const Int_t order) const;
private:
Int_t fLastEventSerialNr;
Int_t fLastEventNr;
Int_t fCurrentFileIndex;
Int_t fEvents; //! nr. of events in the current file
- TString fMode; // = 0 for READONLY, = 1 for READWRITE
+ TString fMode; // = 0 for READONLY, = 1 for READWRITE
TFile *fCurrentFile; //! pointer to current open file
- TObjArray * fFileNames;
+ TObjArray * fFileNames; // storage for TStrings with file names
ClassDef(AliStream,1)
};