//* provided "as is" without express or implied warranty. *
//**************************************************************************
-/**
- * @file AliHLTModulePreprocessor.cxx
- * @author Matthias Richter
- * @date 2008-01-22
- * @brief Base class for HLT module preprocessors
- */
+// @file AliHLTModulePreprocessor.cxx
+// @author Matthias Richter
+// @date 2008-01-22
+// @brief Base class for HLT module preprocessors
+//
#include <cstdlib>
#include <cassert>
#include "AliHLTShuttleInterface.h"
#include "TObjString.h"
#include "TString.h"
+#include "TMap.h"
+#include "TObject.h"
+#include "TObjArray.h"
ClassImp(AliHLTModulePreprocessor)
// see header file for function documentation
}
+// TODO: map this constants to AliHLTDAQ class
const Int_t AliHLTModulePreprocessor::kNDetectors = 21;
const char* AliHLTModulePreprocessor::fgkDetectorName[kNDetectors] =
}
return fgkDetectorName[detectorID];
}
+
+TObject* AliHLTModulePreprocessor::GetFromMap(TMap* dcsAliasMap, const char* stringId) const
+{
+ /// extract object from the alias map
+ /// return the last object from the value set
+ TObject* object=dcsAliasMap->FindObject(stringId);
+ if (!object) return NULL;
+ TPair* pair = dynamic_cast<TPair*>(object);
+ if (pair && pair->Value()) {
+ TObjArray* valueSet = dynamic_cast<TObjArray*>(pair->Value());
+ if (!valueSet) return NULL;
+ Int_t nentriesDCS = valueSet->GetEntriesFast() - 1;
+ if(nentriesDCS>=0 && valueSet->At(nentriesDCS)){
+ return valueSet->At(nentriesDCS);
+ }
+ }
+ return NULL;
+}
//-*- Mode: C++ -*-
-// @(#) $Id$
+// $Id$
#ifndef ALIHLTMODULEPREPROCESSOR_H
#define ALIHLTMODULEPREPROCESSOR_H
//* ALICE Experiment at CERN, All rights reserved. *
//* See cxx source for full Copyright notice *
-/**
- * @file AliHLTModulePreprocessor.h
- * @author Matthias Richter
- * @date 2008-01-22
- * @brief Base class for HLT module preprocessors
- */
+// @file AliHLTModulePreprocessor.h
+// @author Matthias Richter
+// @date 2008-01-22
+// @brief Base class for HLT module preprocessors
+//
// see below for class documentation
// or
* The function is pure virtual and must be implemented by the child class.
* @return module id (string)
*/
- virtual const char* GetModuleID() = 0;
+ virtual const char* GetModuleID() {return ClassName();}
/**
* Get all detectors the module process
*/
const char *DetectorName(Int_t detectorID);
+ /// extract object from the alias map
+ /// return the last object from the value set
+ TObject* GetFromMap(TMap* dcsAliasMap, const char* stringId) const;
+
/** number of detectors */
static const Int_t kNDetectors; // Number of detectors