#ifndef ROOT_TFRootIO
#define ROOT_TFRootIO
#include <map>
#ifndef ROOT_TFVirtualIO
#include "TFVirtualIO.h"
#endif
#ifndef ROOT_TFile
#include "TFile.h"
#endif
class TFRootFileItem
{
public:
TFRootFileItem() {fFile = NULL; fNumOpen = 0;}
TFRootFileItem(TFile * file) {fFile = file; fNumOpen = 1;}
TFile * fFile;
Int_t fNumOpen;
ClassDef(TFRootFileItem,0)
};
class TFRootFiles
{
private:
static std::map<Long_t, TFRootFileItem> fFiles;
protected:
static TFile * OpenFile(const char * fileName, FMode mode = kFRead);
static void CloseFile(TFile * file);
ClassDef(TFRootFiles,0)
};
class TFRootIO : public TFVirtualIO, protected TFRootFiles
{
protected:
TFile * fFile;
TDirectory * fDir;
Int_t fCycle;
Int_t fCompLevel;
public:
TFRootIO();
TFRootIO(TFIOElement * element, const char * fileName);
TFRootIO(TFIOElement * element, TFile * file, TDirectory * dir, Int_t cycle);
~TFRootIO();
static TFIOElement * TFRead(const char * name, const char * fileName,
FMode mode = kFRead, TClass * classType= NULL,
Int_t cycle = 0);
virtual Bool_t IsOpen() {return fFile != NULL;}
virtual const char * GetFileName() {return fFile ? fFile->GetName() : NULL;}
virtual Int_t GetCycle() {return fCycle;}
virtual void SetCompressionLevel(Int_t level) {fCompLevel = level;}
virtual Int_t GetCompressionLevel() {return fCompLevel;}
virtual void CreateElement() {}
virtual Int_t DeleteElement();
virtual Int_t SaveElement(Int_t compLevel = -1);
virtual UInt_t GetNumColumns();
virtual TFBaseCol * ReadCol(const char * name);
virtual void ReadAllCol(ColList & columns);
virtual Int_t SaveColumns(ColList & columns, Int_t compLevel = -1);
virtual Int_t DeleteColumn(const char * name);
virtual void GetColNames(std::map<TString, TNamed> & columns);
private:
ClassDef(TFRootIO,0)
};
class TFRootFileIter : public TFVirtualFileIter, protected TFRootFiles
{
protected:
TFile * fFile;
TIter * fKeyIter;
FMode fMode;
public:
TFRootFileIter(const char * fileName, FMode mode = kFRead);
~TFRootFileIter();
virtual Bool_t IsOpen() {return fFile != NULL && fKeyIter != NULL;}
virtual Bool_t Next();
virtual void Reset();
ClassDef(TFRootFileIter,0)
};
#endif // ROOT_TFRootIO
Last update: Fri Mar 14 13:55:23 2008
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.