From 310c76375479616ce248a5a836763f887cf1ed1b Mon Sep 17 00:00:00 2001 From: richterm Date: Tue, 22 Jan 2008 00:17:02 +0000 Subject: [PATCH] moved AliHLTModulePreprocessor to base library and introduced abstract interface to shuttle access methods --- .../AliHLTModulePreprocessor.cxx | 94 +++++++++--------- .../AliHLTModulePreprocessor.h | 13 +-- HLT/BASE/AliHLTShuttleInterface.cxx | 43 +++++++++ HLT/BASE/AliHLTShuttleInterface.h | 96 +++++++++++++++++++ HLT/SampleLib/AliHLTSamplePreprocessor.cxx | 1 - HLT/SampleLib/AliHLTSamplePreprocessor.h | 1 - HLT/libHLTbase.pkg | 2 + HLT/libHLTshuttle.pkg | 3 +- HLT/shuttle/AliHLTPreprocessor.cxx | 2 +- HLT/shuttle/AliHLTPreprocessor.h | 31 +++--- 10 files changed, 211 insertions(+), 75 deletions(-) rename HLT/{shuttle => BASE}/AliHLTModulePreprocessor.cxx (66%) rename HLT/{shuttle => BASE}/AliHLTModulePreprocessor.h (92%) create mode 100644 HLT/BASE/AliHLTShuttleInterface.cxx create mode 100644 HLT/BASE/AliHLTShuttleInterface.h diff --git a/HLT/shuttle/AliHLTModulePreprocessor.cxx b/HLT/BASE/AliHLTModulePreprocessor.cxx similarity index 66% rename from HLT/shuttle/AliHLTModulePreprocessor.cxx rename to HLT/BASE/AliHLTModulePreprocessor.cxx index ed48c6b13ac..77baa836b0f 100644 --- a/HLT/shuttle/AliHLTModulePreprocessor.cxx +++ b/HLT/BASE/AliHLTModulePreprocessor.cxx @@ -25,13 +25,13 @@ #include #include "AliHLTModulePreprocessor.h" -#include "AliHLTPreprocessor.h" +#include "AliHLTShuttleInterface.h" ClassImp(AliHLTModulePreprocessor) AliHLTModulePreprocessor::AliHLTModulePreprocessor() : - fpContainer(NULL) + fpInterface(NULL) { // see header file for class documentation // or @@ -45,37 +45,37 @@ AliHLTModulePreprocessor::~AliHLTModulePreprocessor() // see header file for function documentation } -void AliHLTModulePreprocessor::SetContainer(AliHLTPreprocessor* pContainer) +void AliHLTModulePreprocessor::SetShuttleInterface(AliHLTShuttleInterface* pInterface) { - assert(fpContainer==NULL || fpContainer==pContainer || pContainer==NULL); - fpContainer=pContainer; + assert(fpInterface==NULL || fpInterface==pInterface || pInterface==NULL); + fpInterface=pInterface; } Int_t AliHLTModulePreprocessor::GetRun() { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetRun(); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetRun(); } UInt_t AliHLTModulePreprocessor::GetStartTime() { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetStartTime(); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetStartTime(); } UInt_t AliHLTModulePreprocessor::GetEndTime() { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetEndTime(); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetEndTime(); } Bool_t AliHLTModulePreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TObject* object, @@ -83,9 +83,9 @@ Bool_t AliHLTModulePreprocessor::Store(const char* pathLevel2, const char* pathL { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->Store(pathLevel2, pathLevel3, object, metaData, validityStart, validityInfinite); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorStore(pathLevel2, pathLevel3, object, metaData, validityStart, validityInfinite); } Bool_t AliHLTModulePreprocessor::StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object, @@ -93,88 +93,88 @@ Bool_t AliHLTModulePreprocessor::StoreReferenceData(const char* pathLevel2, cons { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->StoreReferenceData(pathLevel2, pathLevel3, object, metaData); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorStoreReferenceData(pathLevel2, pathLevel3, object, metaData); } Bool_t AliHLTModulePreprocessor::StoreReferenceFile(const char* localFile, const char* gridFileName) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->StoreReferenceFile(localFile, gridFileName); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorStoreReferenceFile(localFile, gridFileName); } Bool_t AliHLTModulePreprocessor::StoreRunMetadataFile(const char* localFile, const char* gridFileName) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->StoreRunMetadataFile(localFile, gridFileName); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorStoreRunMetadataFile(localFile, gridFileName); } const char* AliHLTModulePreprocessor::GetFile(Int_t system, const char* id, const char* source) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetFile(system, id, source); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetFile(system, id, source); } TList* AliHLTModulePreprocessor::GetFileSources(Int_t system, const char* id) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetFileSources(system, id); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetFileSources(system, id); } TList* AliHLTModulePreprocessor::GetFileIDs(Int_t system, const char* source) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetFileIDs(system, source); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetFileIDs(system, source); } const char* AliHLTModulePreprocessor::GetRunParameter(const char* param) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetRunParameter(param); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetRunParameter(param); } AliCDBEntry* AliHLTModulePreprocessor::GetFromOCDB(const char* pathLevel2, const char* pathLevel3) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetFromOCDB(pathLevel2, pathLevel3); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetFromOCDB(pathLevel2, pathLevel3); } const char* AliHLTModulePreprocessor::GetRunType() { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return 0; - return fpContainer->GetRunType(); + assert(fpInterface); + if (!fpInterface) return 0; + return fpInterface->PreprocessorGetRunType(); } void AliHLTModulePreprocessor::Log(const char* message) { // see header file for function documentation - assert(fpContainer); - if (!fpContainer) return; - fpContainer->Log(message); + assert(fpInterface); + if (!fpInterface) return; + fpInterface->PreprocessorLog(message); } diff --git a/HLT/shuttle/AliHLTModulePreprocessor.h b/HLT/BASE/AliHLTModulePreprocessor.h similarity index 92% rename from HLT/shuttle/AliHLTModulePreprocessor.h rename to HLT/BASE/AliHLTModulePreprocessor.h index 9a957161ef9..f0d12852422 100644 --- a/HLT/shuttle/AliHLTModulePreprocessor.h +++ b/HLT/BASE/AliHLTModulePreprocessor.h @@ -26,6 +26,7 @@ class AliHLTPreprocessor; class TMap; class AliCDBMetaData; class AliCDBEntry; +class AliHLTShuttleInterface; /** * @class AliHLTModulePreprocessor @@ -49,7 +50,7 @@ public: /** * Set the container class which is the gateway to the shuttle. */ - void SetContainer(AliHLTPreprocessor* pContainer); + void SetShuttleInterface(AliHLTShuttleInterface* pInterface); /** * Initialize the Preprocessor. @@ -82,7 +83,7 @@ public: protected: // the AliPreprocessor interface, all functions redirected via the - // AliHLTPreprocessor + // AliHLTShuttleInterface to the AliHLTPreprocessor Bool_t Store(const char* pathLevel2, const char* pathLevel3, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE); Bool_t StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object, @@ -111,13 +112,9 @@ private: /** assignment operator prohibited */ AliHLTModulePreprocessor& operator=(const AliHLTModulePreprocessor& rhs); - /** the contaner class which is the gateway to the shuttle */ - AliHLTPreprocessor* fpContainer; //! transient + /** the interface class which is the gateway to the shuttle */ + AliHLTShuttleInterface* fpInterface; //! transient ClassDef(AliHLTModulePreprocessor, 0); }; - - #endif - - diff --git a/HLT/BASE/AliHLTShuttleInterface.cxx b/HLT/BASE/AliHLTShuttleInterface.cxx new file mode 100644 index 00000000000..2f91227b6de --- /dev/null +++ b/HLT/BASE/AliHLTShuttleInterface.cxx @@ -0,0 +1,43 @@ +// $Id: AliHLTShuttleInterface.cxx 23039 2007-12-13 20:53:02Z richterm $ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Matthias Richter * +//* 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 * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** + * @file AliHLTShuttleInterface.cxx + * @author Matthias Richter + * @date 2008-01-22 + * @brief Pure virtual interface to the HLT shuttle methods + */ + +#include "AliHLTShuttleInterface.h" + +ClassImp(AliHLTShuttleInterface) + +AliHLTShuttleInterface::AliHLTShuttleInterface() +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTShuttleInterface::~AliHLTShuttleInterface() +{ + // see header file for function documentation +} + diff --git a/HLT/BASE/AliHLTShuttleInterface.h b/HLT/BASE/AliHLTShuttleInterface.h new file mode 100644 index 00000000000..848f499dfdc --- /dev/null +++ b/HLT/BASE/AliHLTShuttleInterface.h @@ -0,0 +1,96 @@ +//-*- Mode: C++ -*- +// @(#) $Id: AliHLTShuttleInterface.h 23318 2008-01-14 12:43:28Z hristov $ + +#ifndef ALIHLTSHUTTLEINTERFACE_H +#define ALIHLTSHUTTLEINTERFACE_H +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** + * @file AliHLTShuttleInterface.h + * @author Matthias Richter + * @date 2008-01-22 + * @brief Pure virtual interface to the HLT shuttle methods + */ + +// see below for class documentation +// or +// refer to README to build package +// or +// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + +#include "TObject.h" + +class AliHLTPreprocessor; +class TMap; +class AliCDBMetaData; +class AliCDBEntry; + +/** + * @class AliHLTShuttleInterface + * This class implements the redirection of the shuttle access methods for + * AliHLTModulePreprocessor classes. The AliHLTShuttleInterface has been + * declared pure virtual to avoid dependencies between the libHLTshuttle and + * the component libraries. It implements the same interface to the shuttle + * as the AliPreprocessor. + * + * The AliHLTPreprocessor initializes each AliHLTModulePreprocessor with this + * interface. From the interface methods of AliHLTModulePreprocessor classes, + * the call is redirected via AliHLTShuttleInterface to the AliHLTPreprocessor, + * which makes the methods publicly available AliPreprocessor. + * + * @author Matthias Richter + */ +class AliHLTShuttleInterface +{ +public: + /** Constructor*/ + AliHLTShuttleInterface(); + /** Destructor */ + virtual ~AliHLTShuttleInterface(); + + /** Get the run no */ + virtual Int_t PreprocessorGetRun() = 0; + + /** Get the start time */ + virtual UInt_t PreprocessorGetStartTime() = 0; + + /** Get the end time */ + virtual UInt_t PreprocessorGetEndTime() = 0; + + // the AliPreprocessor interface, all functions redirected via the + // AliHLTPreprocessor + virtual Bool_t PreprocessorStore(const char* pathLevel2, const char* pathLevel3, TObject* object, + AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE) = 0; + virtual Bool_t PreprocessorStoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object, + AliCDBMetaData* metaData) = 0; + virtual Bool_t PreprocessorStoreReferenceFile(const char* localFile, const char* gridFileName) = 0; + + virtual Bool_t PreprocessorStoreRunMetadataFile(const char* localFile, const char* gridFileName) = 0; + + virtual const char* PreprocessorGetFile(Int_t system, const char* id, const char* source) = 0; + + virtual TList* PreprocessorGetFileSources(Int_t system, const char* id = 0) = 0; + + virtual TList* PreprocessorGetFileIDs(Int_t system, const char* source) = 0; + + virtual const char* PreprocessorGetRunParameter(const char* param) = 0; + + virtual AliCDBEntry* PreprocessorGetFromOCDB(const char* pathLevel2, const char* pathLevel3) = 0; + + virtual const char* PreprocessorGetRunType() = 0; + + virtual void PreprocessorLog(const char* message) = 0; + +protected: + +private: + /** copy constructor prohibited */ + AliHLTShuttleInterface(const AliHLTShuttleInterface&); + /** assignment operator prohibited */ + AliHLTShuttleInterface& operator=(const AliHLTShuttleInterface&); + + ClassDef(AliHLTShuttleInterface, 0); +}; +#endif diff --git a/HLT/SampleLib/AliHLTSamplePreprocessor.cxx b/HLT/SampleLib/AliHLTSamplePreprocessor.cxx index 9e6ed36a06f..07c8ea1a40b 100644 --- a/HLT/SampleLib/AliHLTSamplePreprocessor.cxx +++ b/HLT/SampleLib/AliHLTSamplePreprocessor.cxx @@ -21,7 +21,6 @@ * @file AliHLTSamplePreprocessor.cxx * @author Kenneth Aamodt, Sebastian Bablok * @date 2007-12-06 - * @update 2008-01-22 formerly AliHLTPreprocessor splitted into modules * @brief HLT Preprocessor plugin for the AliHLTComp library */ diff --git a/HLT/SampleLib/AliHLTSamplePreprocessor.h b/HLT/SampleLib/AliHLTSamplePreprocessor.h index 4623b3c798d..acf56c8632d 100644 --- a/HLT/SampleLib/AliHLTSamplePreprocessor.h +++ b/HLT/SampleLib/AliHLTSamplePreprocessor.h @@ -11,7 +11,6 @@ * @file AliHLTSamplePreprocessor.h * @author Kenneth Aamodt, Sebastian Bablok * @date 2007-12-06 - * @update 2008-01-22 formerly AliHLTPreprocessor splitted into modules * @brief HLT Preprocessor plugin for the AliHLTComp library */ diff --git a/HLT/libHLTbase.pkg b/HLT/libHLTbase.pkg index 94ae885cc10..01edc8774bb 100644 --- a/HLT/libHLTbase.pkg +++ b/HLT/libHLTbase.pkg @@ -20,6 +20,8 @@ CLASS_HDRS:= AliHLTComponent.h \ AliHLTOfflineDataSource.h \ AliHLTOfflineDataSink.h \ AliHLTModuleAgent.h \ + AliHLTModulePreprocessor.h \ + AliHLTShuttleInterface.h \ AliHLTHOMERLibManager.h \ AliHLTHOMERBlockDesc.h \ AliHLTHOMERSourceDesc.h \ diff --git a/HLT/libHLTshuttle.pkg b/HLT/libHLTshuttle.pkg index c3cb6e30005..a53ce857878 100644 --- a/HLT/libHLTshuttle.pkg +++ b/HLT/libHLTshuttle.pkg @@ -5,8 +5,7 @@ include $(MODDIR)/hlt.conf LIBHLTSHUTTLE_VERSION := 0 -CLASS_HDRS:= AliHLTPreprocessor.h \ - AliHLTModulePreprocessor.h +CLASS_HDRS:= AliHLTPreprocessor.h MODULE_SRCS:= $(CLASS_HDRS:.h=.cxx) diff --git a/HLT/shuttle/AliHLTPreprocessor.cxx b/HLT/shuttle/AliHLTPreprocessor.cxx index 51e24f370f7..65a1fed7da7 100644 --- a/HLT/shuttle/AliHLTPreprocessor.cxx +++ b/HLT/shuttle/AliHLTPreprocessor.cxx @@ -90,7 +90,7 @@ void AliHLTPreprocessor::Initialize(Int_t run, UInt_t startTime, while (pAgent) { AliHLTModulePreprocessor* pProc=pAgent->GetPreprocessor(); if (pProc) { - pProc->SetContainer(this); + pProc->SetShuttleInterface(this); pProc->Initialize(run, startTime, endTime); fProcessors.Add(pProc); TString msg; diff --git a/HLT/shuttle/AliHLTPreprocessor.h b/HLT/shuttle/AliHLTPreprocessor.h index c25bf4986aa..5665bdd5354 100644 --- a/HLT/shuttle/AliHLTPreprocessor.h +++ b/HLT/shuttle/AliHLTPreprocessor.h @@ -17,6 +17,7 @@ #include "TList.h" #include "AliPreprocessor.h" +#include "AliHLTShuttleInterface.h" /** * @class AliHLTPreprocessor @@ -33,7 +34,7 @@ * preprocessors and to make the AliPreprocessor interface methods * publicly available. */ -class AliHLTPreprocessor : public AliPreprocessor +class AliHLTPreprocessor : public AliPreprocessor , public AliHLTShuttleInterface { public: /** @@ -76,60 +77,60 @@ class AliHLTPreprocessor : public AliPreprocessor static const char* fgkHLTPreproc; // see above /** Get the run no which has been previously initialized */ - Int_t GetRun() {return fRun;} + Int_t PreprocessorGetRun() {return fRun;} /** Get the start time no which has been previously initialized */ - UInt_t GetStartTime() {return fStartTime;} + UInt_t PreprocessorGetStartTime() {return fStartTime;} /** Get the end time no which has been previously initialized */ - UInt_t GetEndTime() {return fEndTime;} + UInt_t PreprocessorGetEndTime() {return fEndTime;} // AliPreprocessor methods made publicly available // - Bool_t Store(const char* pathLevel2, const char* pathLevel3, TObject* object, + Bool_t PreprocessorStore(const char* pathLevel2, const char* pathLevel3, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE) { return AliPreprocessor::Store(pathLevel2, pathLevel3, object, metaData, validityStart, validityInfinite); } - Bool_t StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object, + Bool_t PreprocessorStoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object, AliCDBMetaData* metaData) { return AliPreprocessor::StoreReferenceData(pathLevel2, pathLevel3, object, metaData); } - Bool_t StoreReferenceFile(const char* localFile, const char* gridFileName) { + Bool_t PreprocessorStoreReferenceFile(const char* localFile, const char* gridFileName) { return AliPreprocessor::StoreReferenceFile(localFile, gridFileName); } - Bool_t StoreRunMetadataFile(const char* localFile, const char* gridFileName) { + Bool_t PreprocessorStoreRunMetadataFile(const char* localFile, const char* gridFileName) { return AliPreprocessor::StoreRunMetadataFile(localFile, gridFileName); } - const char* GetFile(Int_t system, const char* id, const char* source) { + const char* PreprocessorGetFile(Int_t system, const char* id, const char* source) { return AliPreprocessor::GetFile(system, id, source); } - TList* GetFileSources(Int_t system, const char* id = 0) { + TList* PreprocessorGetFileSources(Int_t system, const char* id = 0) { return AliPreprocessor::GetFileSources(system, id); } - TList* GetFileIDs(Int_t system, const char* source) { + TList* PreprocessorGetFileIDs(Int_t system, const char* source) { return AliPreprocessor::GetFileIDs(system, source); } - const char* GetRunParameter(const char* param) { + const char* PreprocessorGetRunParameter(const char* param) { return AliPreprocessor::GetRunParameter(param); } - AliCDBEntry* GetFromOCDB(const char* pathLevel2, const char* pathLevel3) { + AliCDBEntry* PreprocessorGetFromOCDB(const char* pathLevel2, const char* pathLevel3) { return AliPreprocessor::GetFromOCDB(pathLevel2, pathLevel3); } - const char* GetRunType() { + const char* PreprocessorGetRunType() { return AliPreprocessor::GetRunType(); } - void Log(const char* message) { + void PreprocessorLog(const char* message) { AliPreprocessor::Log(message); } -- 2.43.0