#ifndef ROOT_TFileIter
#define ROOT_TFileIter
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TIterator
#include "TIterator.h"
#endif
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TFile
#include "TFile.h"
#endif
class TFileIter : public TListIter {
private:
TFile *fFileBackUp;
TDirectory *fDirectoryBackUp;
virtual TIterator &operator=(const TIterator &) { return *this; }
protected:
TFile *fRootFile;
TString fEventName;
UInt_t fRunNumber;
UInt_t fEventNumber;
Int_t fCursorPosition;
Bool_t fOwnTFile;
void Initialize();
TObject *ReadObj(const TKey *key) const;
void RestoreFileScope();
void SaveFileScope();
TKey *NextEventKey(UInt_t eventNumber=UInt_t(-1), UInt_t runNumber=UInt_t(-1), const char *name="*");
public:
TFileIter(const char *name, Option_t *option = "",
const char *ftitle = "", Int_t compress = 1,
Int_t netopt = 0);
TFileIter(TFile *file=0);
TFileIter(const TFileIter &);
virtual ~TFileIter();
Int_t CurrentCursorPosition() const;
virtual const TFile *GetTFile() const;
static TString MapName(const char *name, const char *localSystemKey = 0
, const char *mountedFileSystemKey = 0);
static const char *GetResourceName();
static const char *GetDefaultMapFileName();
static const char *GetLocalFileNameKey();
static const char *GetForeignFileSystemKey();
virtual TObject *NextEventGet(UInt_t eventNumber=UInt_t(-1), UInt_t runNumber=UInt_t(-1), const char *name="*");
virtual Int_t NextEventPut(TObject *obj, UInt_t eventNum, UInt_t runNumber, const char *name=0);
void SetCursorPosition(Int_t cursorPosition);
void SetCursorPosition(const char *keyNameToFind);
Int_t GetObjlen() const;
virtual Int_t TotalKeys() const;
virtual TObject *SkipObjects(Int_t nSkip=1);
virtual TObject *GetObject() const;
TKey *GetCurrentKey() const;
const char *GetKeyName() const;
TFileIter &operator=(Int_t cursorPosition);
TFileIter &operator=(const char *keyNameToFind);
TFileIter &operator+=(Int_t shift);
TFileIter &operator-=(Int_t shift);
TFileIter &operator++();
TFileIter &operator--();
TObject *operator*() const;
operator const char *() const;
operator const TFile *() const;
operator int () const;
int operator==(const char *name) const;
int operator!=(const char *name) const;
public:
virtual TObject *Next();
virtual TObject *Next(Int_t nSkip);
virtual void Reset();
virtual void Rewind();
TObject *operator()(Int_t nSkip);
TObject *operator()();
ClassDef(TFileIter,0)
};
inline const char *TFileIter::GetResourceName() {return "ForeignFileMap";}
inline const char *TFileIter::GetDefaultMapFileName() {return "io.config";}
inline const char *TFileIter::GetLocalFileNameKey() {return "LocalFileSystem";}
inline const char *TFileIter::GetForeignFileSystemKey(){return "MountedFileSystem";}
inline Int_t TFileIter::CurrentCursorPosition() const
{
return fCursorPosition;
}
inline const TFile *TFileIter::GetTFile() const { return fRootFile; }
inline TObject *TFileIter::Next()
{
return Next(1);
}
inline void TFileIter::Rewind() {
Reset();
}
inline void TFileIter::SetCursorPosition(Int_t cursorPosition)
{
SkipObjects(cursorPosition - fCursorPosition);
}
inline TFileIter &TFileIter::operator=(const char *keyNameToFind)
{
SetCursorPosition(keyNameToFind); return *this;}
inline TFileIter &TFileIter::operator=(Int_t cursorPosition)
{
SetCursorPosition(cursorPosition);
return *this;
}
inline TFileIter::operator const TFile *() const
{ return GetTFile (); }
inline TFileIter &TFileIter::operator+=(Int_t shift)
{ SkipObjects(shift); return *this;}
inline TFileIter &TFileIter::operator-=(Int_t shift)
{ return operator+=(-shift);}
inline TFileIter &TFileIter::operator++()
{ SkipObjects( 1); return *this;}
inline TFileIter &TFileIter::operator--()
{ SkipObjects(-1); return *this;}
inline TObject *TFileIter::operator*() const
{ return GetObject();}
inline TFileIter::operator int () const
{ return CurrentCursorPosition(); }
inline TFileIter::operator const char *() const
{
return GetKeyName();
}
inline int TFileIter::operator==(const char *name) const
{ return name ? !strcmp(name,GetKeyName()):0;}
inline int TFileIter::operator!=(const char *name) const
{ return !(operator==(name)); }
inline TObject *TFileIter::operator()(){ return Next(); }
inline TObject *TFileIter::operator()(Int_t nSkip){ return Next(nSkip);}
inline void TFileIter::SaveFileScope()
{ fFileBackUp = gFile; fDirectoryBackUp = gDirectory; }
inline void TFileIter::RestoreFileScope()
{ gFile = fFileBackUp; gDirectory = fDirectoryBackUp; }
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.