#ifndef ROOT_TFGroup
#define ROOT_TFGroup
#ifndef ROOT_TFError
#include "TFError.h"
#endif
#ifndef ROOT_TFTable
#include "TFTable.h"
#endif
#ifndef ROOT_TFColumn
#include "TFColumn.h"
#endif
#include <set>
class TFGroupIter;
class TFElementPtr;
enum TFDataType {
kUndefType = 0,
kBaseType = 1,
kImageType = 2,
kTableType = 3,
kGroupType = 4
};
class TFSelector : public TObject
{
public:
virtual Bool_t Select(TFElementPtr & item) const = 0;
ClassDef(TFSelector, 0)
};
class TFToken
{
char * fBuffer;
char ** fToken;
UInt_t fNumToken;
Bool_t fLead;
Bool_t fTrail;
public:
TFToken();
~TFToken();
void SetName(const char * name);
Bool_t Select(const char * testName);
ClassDef(TFToken, 0)
};
class TFNameSelector : public TFSelector
{
TFToken * fNames;
UInt_t fNumNames;
public:
TFNameSelector(const char * name);
TFNameSelector(const char ** names, UInt_t numNames);
~TFNameSelector();
virtual Bool_t Select(TFElementPtr & item) const;
ClassDef(TFNameSelector, 0)
};
class TFFilePath : public TString
{
public:
TFFilePath() {}
TFFilePath(const char * filePath) : TString(filePath) {}
TFFilePath(TFFilePath & filePath) : TString(filePath) {}
TFFilePath & operator=(const char * fileName)
{ TString::operator=(fileName); return *this;}
void MakeAbsolutePath(const char * isRelativeTo);
void MakeRelativePath(const char * relativeTo);
Bool_t IsRelativePath() const;
ClassDef(TFFilePath,1)
};
class TFElementPtr : public TObject
{
protected:
TFFilePath fFileName;
TString fElementName;
Int_t fCycle;
TFDataType fType;
public:
TFElementPtr() {fCycle = 0; fType = kUndefType;}
TFElementPtr(const char * filePath, const char * name,
UInt_t cycle, TFDataType dataType) : fFileName(filePath), fElementName(name)
{fCycle = cycle; fType = dataType;}
TFElementPtr(const TFIOElement * element);
TFElementPtr(const TFElementPtr & groupItem);
TFElementPtr & operator=(const TFElementPtr & elementPtr);
Bool_t operator==(const TFElementPtr & elementPtr) const;
Bool_t operator< (const TFElementPtr & elementPtr) const;
Bool_t IsGroup() const {return fType == kGroupType;}
TFDataType GetDataType() const {return fType;}
const char * GetFileName() const {return fFileName.Data();}
const char * GetElementName() const {return fElementName.Data();}
Int_t GetCycle() const {return fCycle;}
void MakeAbsolutePath(const char * IsRelativeTo)
{fFileName.MakeAbsolutePath(IsRelativeTo);}
void MakeRelativePath(const char * relativeTo)
{fFileName.MakeRelativePath(relativeTo);}
Bool_t IsRelativePath() {return fFileName.IsRelativePath();}
ClassDef(TFElementPtr,1)
};
class TFElementIdPtr : public TFElementPtr
{
protected:
Long_t fileId;
public:
TFElementIdPtr(const TFElementPtr & elementPtr, const char * isRelativeTo);
Bool_t operator< (const TFElementIdPtr & elementPtr) const;
};
class ElementPtrFormat
{
public:
static char * Format(char * str, Int_t width, const char * format, const TFElementPtr & value);
static void SetString(const char * str, TFElementPtr & value ) {}
static const char * GetTypeName() {return "TFElementPtr";}
static const char * GetBranchType() {return "";}
static double ToDouble(const TFElementPtr & value)
{TFError::SetError("ElementPtrFormat::ToDouble",
"Cannot convert a TFGroup pointer into a double"); return 0;}
static void SetDouble(Double_t dbl, TFElementPtr & value) {}
};
typedef TFColumn<TFElementPtr, ElementPtrFormat> TFGroupCol;
extern const char GROUP_COL_NAME[];
class TFGroup : public TFTable
{
public:
TFGroup() {}
TFGroup(TFGroup & group) : TFTable(group) {}
TFGroup(const char * name, UInt_t numRows = 0) : TFTable(name, numRows) {}
TFGroup(const char * name , const char * fileName) : TFTable(name, fileName)
{if (fio) fio->CreateElement();}
virtual ~TFGroup() {};
virtual TFGroup & operator = (TFGroup & group) {TFTable::operator =(group); return *this;}
virtual UInt_t Attach(TFIOElement * element, Bool_t relativePath = kTRUE);
virtual void Detach(TFIOElement * element);
TFGroupIter MakeGroupIterator();
ClassDef(TFGroup,1)
};
class TFGroupIter
{
TFGroup * fGroup;
TFGroupCol & fCol;
TFRowIter fRowIter;
Bool_t fReadOnly;
TFGroupIter * fList;
TFIOElement * fLast;
std::set<TFElementIdPtr> * fDone;
Bool_t fStart;
TList * fSelect;
TFGroupIter(TFGroup * group);
TFGroupIter(TFGroup * group, std::set<TFElementIdPtr> * done,
TList * select, Bool_t readOnly);
TFGroupIter & operator = (const TFGroupIter & i_group) {return *this;}
public:
TFGroupIter(const TFGroupIter & groupIter);
~TFGroupIter();
void SetSelector(TFSelector * select);
void ClearSelectors();
Bool_t Filter(const char * filter) {return fRowIter.Filter(filter);}
void Sort(const char * colName) {fRowIter.Sort(colName);}
void ClearFilterSort() {fRowIter.ClearFilterSort();}
Bool_t Next();
TFIOElement & operator * () {return fList ? fList->operator*() : *fLast;}
TFIOElement * operator -> () {return fList ? fList->operator->() : fLast;}
void Reset();
void SetReadOnly(Bool_t readOnly = kTRUE);
Bool_t IsReadOnly() {return fReadOnly;}
friend TFGroupIter TFGroup::MakeGroupIterator();
ClassDef(TFGroupIter,0)
};
extern TFGroup * TFReadGroup(const char * fileName, const char * name,
UInt_t cycle = 0, FMode mode = kFRead);
#endif
Last update: Fri Mar 14 13:55:24 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.