#include "TROOT.h"
#include "TTree.h"
#include "THashList.h"
#include "TSelectorCint.h"
#include "Api.h"
#include "TError.h"
ClassImp(TSelectorCint)
TSelectorCint::TSelectorCint() : TSelector(),
fClass(0),
fFuncVersion (0),
fFuncInit (0),
fFuncBegin (0),
fFuncSlBegin (0),
fFuncNotif (0),
fFuncSlTerm (0),
fFuncTerm (0),
fFuncCut (0),
fFuncFill (0),
fFuncProc (0),
fFuncOption (0),
fFuncObj (0),
fFuncInp (0),
fFuncOut (0),
fFuncGetAbort (0),
fFuncGetStat (0),
fIntSelector(0),fIsOwner(kFALSE)
{
}
TSelectorCint::~TSelectorCint()
{
delete fFuncVersion;
delete fFuncInit;
delete fFuncBegin;
delete fFuncSlBegin;
delete fFuncNotif;
delete fFuncSlTerm;
delete fFuncTerm;
delete fFuncCut;
delete fFuncFill;
delete fFuncProc;
delete fFuncOption;
delete fFuncObj;
delete fFuncInp;
delete fFuncOut;
delete fFuncGetAbort;
delete fFuncGetStat;
if (fIsOwner && fIntSelector) fClass->Delete(fIntSelector);
delete fClass;
}
void TSelectorCint::SetFuncProto(G__CallFunc *cf, G__ClassInfo* cl,
const char* fname, const char* argtype,
Bool_t required)
{
Long_t offset = 0;
cf->SetFuncProto(cl,fname,argtype,&offset);
if (gDebug > 2)
Info("SetFuncProto","set %s(%s) offset = %ld",fname,argtype,offset);
if (!cf->IsValid() && required)
Error("SetFuncProto","cannot set %s(%s)",fname,argtype);
}
void TSelectorCint::Build(TSelector *iselector, G__ClassInfo *cl, Bool_t isowner)
{
delete fFuncVersion;
delete fFuncInit;
delete fFuncBegin;
delete fFuncSlBegin;
delete fFuncNotif;
delete fFuncSlTerm;
delete fFuncTerm;
delete fFuncCut;
delete fFuncFill;
delete fFuncProc;
delete fFuncOption;
delete fFuncObj;
delete fFuncInp;
delete fFuncOut;
delete fFuncGetAbort;
delete fFuncGetStat;
if (fIsOwner && fIntSelector) fClass->Delete(fIntSelector);
delete fClass;
R__ASSERT(cl);
fClass = new G__ClassInfo(*cl);
fIntSelector = iselector;
fIsOwner = isowner;
fFuncVersion = new G__CallFunc();
fFuncInit = new G__CallFunc();
fFuncBegin = new G__CallFunc();
fFuncSlBegin = new G__CallFunc();
fFuncNotif = new G__CallFunc();
fFuncSlTerm = new G__CallFunc();
fFuncTerm = new G__CallFunc();
fFuncCut = new G__CallFunc();
fFuncFill = new G__CallFunc();
fFuncProc = new G__CallFunc();
fFuncOption = new G__CallFunc();
fFuncObj = new G__CallFunc();
fFuncInp = new G__CallFunc();
fFuncOut = new G__CallFunc();
fFuncGetAbort = new G__CallFunc();
fFuncGetStat = new G__CallFunc();
SetFuncProto(fFuncVersion,fClass,"Version","",kFALSE);
SetFuncProto(fFuncInit,fClass,"Init","TTree*");
SetFuncProto(fFuncBegin,fClass,"Begin","TTree*");
SetFuncProto(fFuncSlBegin,fClass,"SlaveBegin","TTree*",kFALSE);
SetFuncProto(fFuncNotif,fClass,"Notify","");
SetFuncProto(fFuncSlTerm,fClass,"SlaveTerminate","",kFALSE);
SetFuncProto(fFuncTerm,fClass,"Terminate","");
SetFuncProto(fFuncCut,fClass,"ProcessCut","Long64_t",kFALSE);
SetFuncProto(fFuncFill,fClass,"ProcessFill","Long64_t",kFALSE);
SetFuncProto(fFuncProc,fClass,"Process","Long64_t",kFALSE);
SetFuncProto(fFuncOption,fClass,"SetOption","const char*");
SetFuncProto(fFuncObj,fClass,"SetObject","TObject*");
SetFuncProto(fFuncInp,fClass,"SetInputList","TList*");
SetFuncProto(fFuncOut,fClass,"GetOutputList","");
SetFuncProto(fFuncGetAbort,fClass,"GetAbort","",kFALSE);
SetFuncProto(fFuncGetStat,fClass,"GetStatus","");
}
int TSelectorCint::Version() const
{
if (gDebug > 2)
Info("Version","Call Version");
if (fFuncVersion->IsValid()) {
fFuncVersion->ResetArg();
return fFuncVersion->ExecInt(fIntSelector);
} else {
return 0;
}
}
void TSelectorCint::Init(TTree *tree)
{
if (gDebug > 2)
Info("Init","Call Init tree = %p", tree);
fFuncInit->ResetArg();
fFuncInit->SetArg((Long_t)tree);
fFuncInit->Exec(fIntSelector);
}
void TSelectorCint::Begin(TTree *tree)
{
if (gDebug > 2)
Info("Begin","Call Begin tree = %p", tree);
fFuncBegin->ResetArg();
fFuncBegin->SetArg((Long_t)tree);
fFuncBegin->ExecInt(fIntSelector);
}
void TSelectorCint::SlaveBegin(TTree *tree)
{
if (gDebug > 2)
Info("SlaveBegin","Call SlaveBegin tree = %p", tree);
if (fFuncSlBegin->IsValid()) {
fFuncSlBegin->ResetArg();
fFuncSlBegin->SetArg((Long_t)tree);
fFuncSlBegin->ExecInt(fIntSelector);
} else {
if (gDebug > 1)
Info("SlaveBegin","SlaveBegin unavailable");
}
}
Bool_t TSelectorCint::Notify()
{
if (gDebug > 2)
Info("Notify","Call Notify");
Long64_t sel = fFuncNotif->ExecInt(fIntSelector);
return (Bool_t)sel;
}
Bool_t TSelectorCint::ProcessCut(Long64_t entry)
{
if (gDebug > 3)
Info("ProcessCut","Call ProcessCut entry = %d", entry);
if(fFuncCut->IsValid()) {
fFuncCut->ResetArg();
fFuncCut->SetArg((Long_t)entry);
Int_t sel = fFuncCut->ExecInt(fIntSelector);
return (Bool_t)sel;
} else {
Error("ProcessCut","ProcessCut unavailable");
return kFALSE;
}
}
void TSelectorCint::ProcessFill(Long64_t entry)
{
if (gDebug > 3)
Info("ProcessFill","Call ProcessFill entry = %d", entry);
if(fFuncFill->IsValid()) {
fFuncFill->ResetArg();
fFuncFill->SetArg((Long_t)entry);
fFuncFill->Exec(fIntSelector);
} else {
Error("ProcessFill","ProcessFill unavailable");
}
}
Bool_t TSelectorCint::Process(Long64_t entry)
{
if (gDebug > 3)
Info("Process","Call Process entry = %d", entry);
if(fFuncProc->IsValid()) {
fFuncProc->ResetArg();
fFuncProc->SetArg((Long_t)entry);
Int_t sel = fFuncProc->ExecInt(fIntSelector);
return (Bool_t)sel;
} else {
Error("Process","Process unavailable");
return kFALSE;
}
}
void TSelectorCint::SetOption(const char *option)
{
if (gDebug > 2)
Info("SetOption","Option = %s", option);
fFuncOption->ResetArg();
fFuncOption->SetArg((Long_t)option);
fFuncOption->Exec(fIntSelector);
}
void TSelectorCint::SetObject(TObject *obj)
{
if (gDebug > 3)
Info("SetObject","Object = %p", obj);
fFuncObj->ResetArg();
fFuncObj->SetArg((Long_t)obj);
fFuncObj->Exec(fIntSelector);
}
void TSelectorCint::SetInputList(TList *input)
{
if (gDebug > 2)
Info("SetInputList","Object = %p", input);
fFuncInp->ResetArg();
fFuncInp->SetArg((Long_t)input);
fFuncInp->Exec(fIntSelector);
}
TList *TSelectorCint::GetOutputList() const
{
TList *out = (TList *) fFuncOut->ExecInt(fIntSelector);
if (gDebug > 2)
Info("GetOutputList","List = %p", out);
return out;
}
void TSelectorCint::SlaveTerminate()
{
if (gDebug > 2)
Info("SlaveTerminate","Call SlaveTerminate");
if(fFuncSlTerm->IsValid()) {
fFuncSlTerm->Exec(fIntSelector);
} else {
if (gDebug > 1)
Info("SlaveTerminate","SlaveTerminate unavailable");
}
}
void TSelectorCint::Terminate()
{
if (gDebug > 2)
Info("Terminate","Call Terminate");
fFuncTerm->Exec(fIntSelector);
}
TSelector::EAbort TSelectorCint::GetAbort() const
{
if (gDebug > 2)
Info("GetAbort","Call GetAbort");
if (fFuncGetAbort->IsValid()) {
fFuncGetAbort->ResetArg();
return (EAbort)fFuncGetAbort->ExecInt(fIntSelector);
} else {
return kContinue;
}
}
Long64_t TSelectorCint::GetStatus() const
{
if (gDebug > 2)
Info("GetStatus","Call GetStatus");
if (fFuncGetStat->IsValid()) {
fFuncGetStat->ResetArg();
return fFuncGetStat->ExecInt64(fIntSelector);
} else {
return 0;
}
}
Last update: Thu Jan 17 09:03:14 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.