#include "TVirtualPacketizer.h"
#include "TFile.h"
#include "TTree.h"
#include "TKey.h"
#include "TDSet.h"
ClassImp(TVirtualPacketizer)
TVirtualPacketizer::TVirtualPacketizer()
{
fValid = kTRUE;
fStop = kFALSE;
}
Long64_t TVirtualPacketizer::GetEntries(Bool_t tree, TDSetElement *e)
{
Long64_t entries;
TFile *file = TFile::Open(e->GetFileName());
if ( file->IsZombie() ) {
Error("GetEntries","Cannot open file: %s (%s)",
e->GetFileName(), strerror(file->GetErrno()) );
return -1;
}
TDirectory *dirsave = gDirectory;
if ( ! file->cd(e->GetDirectory()) ) {
Error("GetEntries","Cannot cd to: %s", e->GetDirectory() );
delete file;
return -1;
}
TDirectory *dir = gDirectory;
dirsave->cd();
if ( tree ) {
TKey *key = dir->GetKey(e->GetObjName());
if ( key == 0 ) {
Error("GetEntries","Cannot find tree \"%s\" in %s",
e->GetObjName(), e->GetFileName() );
delete file;
return -1;
}
TTree *tree = (TTree *) key->ReadObj();
if ( tree == 0 ) {
delete file;
return -1;
}
entries = (Long64_t) tree->GetEntries();
delete tree;
} else {
TList *keys = dir->GetListOfKeys();
entries = keys->GetSize();
}
delete file;
return entries;
}
Long64_t TVirtualPacketizer::GetEntriesProcessed() const
{
AbstractMethod("GetEntriesProcessed");
return 0;
}
Long64_t TVirtualPacketizer::GetEntriesProcessed(TSlave *) const
{
AbstractMethod("GetEntriesProcessed(TSlave *sl)");
return 0;
}
TDSetElement *TVirtualPacketizer::GetNextPacket(TSlave *, TMessage *)
{
AbstractMethod("GetNextPacket");
return 0;
}
void TVirtualPacketizer::StopProcess(Bool_t )
{
fStop = kTRUE;
}
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.