// $Id$
/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project *
+ * ALICE Experiment at CERN, All rights reserved. *
* *
- * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * for The ALICE Off-line Project. *
+ * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+ * for The ALICE HLT Project. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
:
fpRunLoader(NULL),
fpRawReader(NULL),
- fpESD(NULL)
+ fpESD(NULL),
+ fpNext(NULL)
{
// see header file for class documentation
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}
-TList AliHLTOfflineInterface::fgList;
-TObjLink* AliHLTOfflineInterface::fgCurrentLnk=NULL;
+AliHLTOfflineInterface* AliHLTOfflineInterface::fAnchor=NULL;
+AliHLTOfflineInterface* AliHLTOfflineInterface::fCurrent=NULL;
+int AliHLTOfflineInterface::fCount=0;
AliRunLoader* AliHLTOfflineInterface::fgpRunLoader=NULL;
AliRawReader* AliHLTOfflineInterface::fgpRawReader=NULL;
:
fpRunLoader(pRunLoader),
fpRawReader(pRawReader),
- fpESD(NULL)
+ fpESD(NULL),
+ fpNext(NULL)
{
}
-AliHLTOfflineInterface::AliHLTOfflineInterface(const AliHLTOfflineInterface&)
- :
- TObject(),
- fpRunLoader(NULL),
- fpRawReader(NULL),
- fpESD(NULL)
-{
- // see header file for class documentation
- //HLTFatal("copy constructor untested");
-}
-
-AliHLTOfflineInterface& AliHLTOfflineInterface::operator=(const AliHLTOfflineInterface&)
-{
- // see header file for class documentation
- //HLTFatal("assignment operator untested");
- return *this;
-}
-
AliHLTOfflineInterface::~AliHLTOfflineInterface()
{
}
return fpRawReader!=NULL?fpRawReader:fgpRawReader;
}
-int AliHLTOfflineInterface::SetESD(Int_t eventNo, AliESD* pESD)
+int AliHLTOfflineInterface::SetESD(Int_t /*eventNo*/, AliESDEvent* pESD)
{
fpESD=pESD;
return 0;
}
-AliESD* AliHLTOfflineInterface::GetESD() const
+AliESDEvent* AliHLTOfflineInterface::GetESD() const
{
return fpESD;
}
int count=0;
fgpRunLoader=runLoader;
fgpRawReader=rawReader;
- fgCurrentLnk=fgList.FirstLink();
- while (fgCurrentLnk!=NULL) {
- AliHLTOfflineInterface* pComponent=reinterpret_cast<AliHLTOfflineInterface*>(fgCurrentLnk->GetObject());
+ AliHLTOfflineInterface* pCurrent=fAnchor;
+ while (pCurrent!=NULL) {
int iLocal=0;
- if (pComponent) iLocal=pComponent->SetParams(runLoader, rawReader);
+ if (pCurrent) iLocal=pCurrent->SetParams(runLoader, rawReader);
if (iLocal<0) {
log.LoggingVarargs(kHLTLogWarning, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,
- "parameter initialization failed for component %p with result %d", pComponent, iLocal);
+ "parameter initialization failed for component %p with result %d", pCurrent, iLocal);
if (iResult>=0) iResult=iLocal;
}
count++;
- fgCurrentLnk=fgCurrentLnk->Next();
+ pCurrent=pCurrent->fpNext;
}
if (iResult>=0) {
- log.LoggingVarargs(kHLTLogInfo, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,
- "parameters set to %d offline interface component(s)", count);
+// log.LoggingVarargs(kHLTLogInfo, "AliHLTOfflineInterface","SetParamsToComponents", __FILE__, __LINE__,
+// "parameters set to %d offline interface component(s)", count);
}
return iResult;
}
{
// see header file for class documentation
int iResult=0;
- fgCurrentLnk=fgList.FirstLink();
- while (fgCurrentLnk!=NULL) {
- AliHLTOfflineInterface* pComponent=reinterpret_cast<AliHLTOfflineInterface*>(fgCurrentLnk->GetObject());
+ AliHLTOfflineInterface* pCurrent=fAnchor;
+ while (pCurrent!=NULL) {
int iLocal=0;
- if (pComponent) iLocal=pComponent->Reset();
+ if (pCurrent) iLocal=pCurrent->Reset();
if (iLocal<0) {
if (iResult>=0) iResult=iLocal;
}
- fgCurrentLnk=fgCurrentLnk->Next();
+ pCurrent=pCurrent->fpNext;
}
return iResult;
}
-int AliHLTOfflineInterface::FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESD* esd)
+int AliHLTOfflineInterface::FillComponentESDs(int eventNo, AliRunLoader* runLoader, AliESDEvent* esd)
{
// see header file for class documentation
int iResult=0;
- fgCurrentLnk=fgList.FirstLink();
- while (fgCurrentLnk!=NULL) {
- AliHLTOfflineInterface* pComponent=reinterpret_cast<AliHLTOfflineInterface*>(fgCurrentLnk->GetObject());
+ AliHLTOfflineInterface* pCurrent=fAnchor;
+ while (pCurrent!=NULL) {
int iLocal=0;
- if (pComponent) {
- pComponent->SetESD(eventNo, esd);
- if (pComponent->GetRunLoader()!=runLoader) {
- //HLTWarning("runLoader missmatch: component %p was reconstructed with runLoader %p, but got %p now", pComponent, pComponent->GetRunLoader(), runLoader);
+ if (pCurrent) {
+ pCurrent->SetESD(eventNo, esd);
+ if (pCurrent->GetRunLoader()!=runLoader) {
+ //HLTWarning("runLoader mismatch: component %p was reconstructed with runLoader %p, but got %p now", pCurrent, pCurrent->GetRunLoader(), runLoader);
}
- iLocal=pComponent->FillESD(eventNo, runLoader, esd);
+ iLocal=pCurrent->FillESD(eventNo, runLoader, esd);
}
if (iLocal<0) {
if (iResult>=0) iResult=iLocal;
}
- fgCurrentLnk=fgCurrentLnk->Next();
+ pCurrent=pCurrent->fpNext;
}
return iResult;
}
{
// see header file for function documentation
int iResult=0;
- if (fgList.FindObject(me->GetName())==NULL) {
- fgList.Add(me);
+ if (fAnchor==NULL) {
+ fAnchor=me;
} else {
+ me->fpNext=fAnchor;
+ fAnchor=me;
}
+ fCount++;
return iResult;
}
{
// see header file for function documentation
int iResult=0;
- if (fgList.FindObject(me)!=NULL) {
- fgList.Remove(me);
- } else {
+ fCurrent=NULL;
+ AliHLTOfflineInterface* prev=NULL;
+ AliHLTOfflineInterface* handler=fAnchor;
+ while (handler!=NULL && handler!=me) {
+ prev=handler;
+ handler=handler->fpNext;
+ }
+ if (handler) {
+ if (prev==NULL) {
+ fAnchor=handler->fpNext;
+ } else {
+ prev->fpNext=handler->fpNext;
+ }
+ fCount--;
}
return iResult;
}