StRoot
1
|
Public Member Functions | |
TFileIter (const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0) | |
TFileIter (TFile *file=0) | |
Create iterator over all objects from the TFile provided. | |
TFileIter (TDirectory *directory) | |
Create iterator over all objects from the TDirectory provided. | |
TFileIter (const TFileIter &) | |
virtual | ~TFileIter () |
TFileIter dtor. | |
Int_t | CurrentCursorPosition () const |
virtual const TFile * | GetTFile () const |
virtual const TDirectory * | GetTDirectory () const |
virtual Bool_t | IsOpen () const |
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) |
Create a special TKey name with obj provided and write it out. | |
void | SetCursorPosition (Int_t cursorPosition) |
void | SetCursorPosition (const char *keyNameToFind) |
Find the key by the name provided. | |
Int_t | GetObjlen () const |
Returns the uncompressed length of the current object. | |
virtual Int_t | TotalKeys () const |
virtual TKey * | SkipObjects (Int_t nSkip=1) |
virtual TObject * | GetObject () const |
virtual Int_t | GetDepth () const |
TKey * | GetCurrentKey () const |
return the pointer to the current TKey | |
const char * | GetKeyName () const |
return the name of the current TKey | |
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 const TDirectory * () const | |
operator int () const | |
int | operator== (const char *name) const |
int | operator!= (const char *name) const |
virtual TObject * | Next () |
virtual TObject * | Next (Int_t nSkip) |
virtual void | Reset () |
Reset the status of the iterator. | |
virtual void | Rewind () |
TObject * | operator() (Int_t nSkip) |
TObject * | operator() () |
Static Public Member Functions | |
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 () |
static void | PurgeKeys (TList *listOfKeys) |
Protected Member Functions | |
void | Initialize () |
to be documented | |
TObject * | ReadObj (const TKey *key) const |
Read the next TObject from for the TDirectory by TKey provided. | |
TKey * | NextEventKey (UInt_t eventNumber=UInt_t(-1), UInt_t runNumber=UInt_t(-1), const char *name="*") |
Protected Attributes | |
TDirectory * | fRootFile |
TString | fEventName |
UInt_t | fRunNumber |
UInt_t | fEventNumber |
Int_t | fCursorPosition |
Bool_t | fOwnTFile |
Definition at line 53 of file TFileIter.h.
TFileIter::TFileIter | ( | const char * | name, |
Option_t * | option = "" , |
||
const char * | ftitle = "" , |
||
Int_t | compress = 1 , |
||
Int_t | netopt = 0 |
||
) |
Open ROOT TFile by the name provided; This TFile is to be deleted by the TFileIter alone
Definition at line 149 of file TFileIter.cxx.
References Initialize(), and MapName().
Referenced by ReadObj().
TFileIter::TFileIter | ( | const TFileIter & | dst | ) |
Copy ctor can be used with the "read only" files only. the next statement is illegal, spotted by coverity "Dereferencing pointer "this->fRootFile". (Deref happens because this is a virtual function call.) assert(!fRootFile->IsWritable());
Definition at line 171 of file TFileIter.cxx.
References Initialize(), MapName(), and SkipObjects().
|
virtual |
return the current number of the nested subdirectroies; = 0 - means there is no subdirectories
Definition at line 248 of file TFileIter.cxx.
References GetDepth().
Referenced by GetDepth().
|
virtual |
read the object from TFile defined by the current TKey
This method does create a new object and it is the end-user code responsibility to take care about this object to avoid memory leak.
Definition at line 273 of file TFileIter.cxx.
References GetCurrentKey(), and ReadObj().
Referenced by Next().
|
virtual |
Check whether the associated ROOT TFile was open and TFile object is healthy.
Definition at line 226 of file TFileIter.cxx.
Referenced by Initialize(), and NextEventPut().
|
static |
Substitute the logical name with the real one if any
add a line into system.rootrc or ~/.rootrc or ./.rootrc
TFileIter.ForeignFileMap mapFile // the name of the file to map the local name to the global file service
If this line is omitted then TFileIter class seeks for the default mapping file in the current directory "io.config"
Definition at line 547 of file TFileIter.cxx.
Referenced by TFileIter().
|
virtual |
return the pointer to the object defined by next TKey This method is not recommended. It was done for the sake of the compatibility with TListIter
Definition at line 305 of file TFileIter.cxx.
References GetObject(), and SkipObjects().
|
virtual |
reads, creates and returns the object by TKey name that matches the "name" ."runNumber" ." eventNumber" schema Attention: This method does create a new TObject and it is the user code responsibility to take care (delete) this object to avoid memory leak.
Definition at line 487 of file TFileIter.cxx.
References ReadObj().
|
static |
Remove the TKey duplication, leave the keys with highest cycle number only Sort if first
Definition at line 316 of file TFileIter.cxx.
Referenced by Reset().
|
virtual |
Returns the TKey pointer to the nSkip TKey object from the current one nSkip = 0; the state of the iterator is not changed
nSkip > 0; iterator skips nSkip objects in the container. the direction of the iteration is sign(nSkip)*kIterForward
Returns: TKey that can be used to fetch the object from the TDirectory
Definition at line 401 of file TFileIter.cxx.
References SkipObjects().
Referenced by Next(), SetCursorPosition(), SkipObjects(), and TFileIter().
|
virtual |
The total number of the TKey keys in the current TDirectory only Usually this means the total number of different objects those can be read one by one. It does NOT count the nested sub-TDirectory. It is too costly and it can be abused.
Definition at line 294 of file TFileIter.cxx.