#ifndef ROOT_TFAsroFile
#define ROOT_TFAsroFile
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#include <map>
#include <vector>
class TFAsroKey : public TObject
{
protected:
UInt_t fElName;
TString fSubName;
Int_t fCycle;
public:
TFAsroKey() {fCycle = 0; fElName = 0;}
TFAsroKey(const TFAsroKey & key);
TFAsroKey(UInt_t elName, const char * subName, Int_t cycle)
: fSubName(subName) {fElName = elName; fCycle = cycle;}
TFAsroKey & operator = (const TFAsroKey & key);
bool operator < (const TFAsroKey & key) const;
void IncreseCycle() {fCycle++;}
UInt_t GetElName() const {return fElName;}
const char * GetSubName() const {return fSubName.Data();}
Int_t GetCycle() const {return fCycle;}
ClassDef(TFAsroKey, 1)
};
class TFAsroValue : public TObject
{
protected:
UInt_t fPos;
UInt_t fFileLength;
UInt_t fDataLength;
UInt_t fClassName;
public:
TFAsroValue();
TFAsroValue(const TFAsroValue & value);
TFAsroValue & operator = (const TFAsroValue & value);
bool operator < (const TFAsroValue & value) const
{return fPos < value.fPos;}
UInt_t GetPos() const {return fPos;}
UInt_t GetFileLength() const {return fFileLength;}
UInt_t GetDataLength() const {return fDataLength;}
UInt_t GetClassName() const {return fClassName;}
void SetPos(UInt_t pos) {fPos = pos;}
void SetFileLength(UInt_t length) {fFileLength = length;}
void SetDataLength(UInt_t length) {fDataLength = length;}
void SetClassName(UInt_t className) {fClassName = className;}
ClassDef(TFAsroValue, 1)
};
class TFAsroColIter
{
public:
TFAsroColIter(std::map<TFAsroKey, TFAsroValue>::iterator & start,
std::map<TFAsroKey, TFAsroValue>::iterator & end,
std::vector<TString> * classNames)
{mi_entry = start; mi_end = end; m_classNames = classNames; m_colName = NULL;}
Bool_t Next();
const char * GetColName() {return m_colName;}
const char * GetClassName() {return (*m_classNames)[m_classNameIndex].Data();}
private:
std::map<TFAsroKey, TFAsroValue>::iterator mi_entry;
std::map<TFAsroKey, TFAsroValue>::iterator mi_end;
const char * m_colName;
std::vector<TString> * m_classNames;
UInt_t m_classNameIndex;
};
class TFAsroElementIter
{
public:
TFAsroElementIter(std::map<TFAsroKey, TFAsroValue> * entries)
{ fEntries = entries;}
Bool_t Next();
TFAsroKey & GetKey() {return fKey;}
void Reset() {fKey = TFAsroKey();}
private:
std::map<TFAsroKey, TFAsroValue> * fEntries;
TFAsroKey fKey;
};
class TFAsroFile
{
protected:
std::map<TFAsroKey, TFAsroValue> fEntries;
std::vector<TString> fClassNames;
std::vector<TString> fNames;
UInt_t fDes[4];
UInt_t fFreeReserve;
UInt_t * fFree;
int fFile;
TString fFileName;
public:
TFAsroFile();
TFAsroFile(const char * fileName, Bool_t * readOnly);
~TFAsroFile();
TObject * Read(const TFAsroKey & key);
TObject * Read(const char * name, const char * subName, Int_t cycle);
bool Delete(const char * name, const char * subName, Int_t cycle);
bool InitWrite();
bool Write(TObject * obj, int compLevel,
const char * name, const char * subName, Int_t cycle);
bool FinishWrite();
void Map();
Bool_t IsOpen() {return fFile >= 0;}
const char * GetFileName() {return fFileName.Data();}
UInt_t GetNumItems() {return fEntries.size();}
UInt_t GetFreeCycle(const char * name);
UInt_t GetNumSubs(const char * name, Int_t cycle);
UInt_t GetNextCycle(const char * name, Int_t cycle);
TFAsroColIter * MakeColIter(const char * name, Int_t cycle);
TFAsroElementIter * MakeElementIter()
{return new TFAsroElementIter(&fEntries);}
protected:
UInt_t GetFree(UInt_t size);
void MakeFree(UInt_t pos, UInt_t size);
ClassDef(TFAsroFile, 1)
};
#endif
Last update: Fri Mar 14 13:55:07 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.