From b948db8dbd3b42d537e958bfbe63897a28569f65 Mon Sep 17 00:00:00 2001 From: jgrosseo Date: Tue, 6 Jun 2006 14:26:40 +0000 Subject: [PATCH] o) removed files that were moved to STEER o) shuttle updated to follow the new interface (Alberto) --- SHUTTLE/AliCDBPreProcessor.cxx | 137 ------ SHUTTLE/AliCDBPreProcessor.h | 56 --- SHUTTLE/AliDCSValue.cxx | 65 --- SHUTTLE/AliDCSValue.h | 43 -- SHUTTLE/AliShuttle.cxx | 225 ++++++--- SHUTTLE/AliShuttle.h | 43 +- SHUTTLE/AliShuttleConfig.cxx | 220 +++++++-- SHUTTLE/AliShuttleConfig.h | 56 ++- SHUTTLE/AliShuttleTrigger.cxx | 57 ++- SHUTTLE/AliShuttleTrigger.h | 6 +- SHUTTLE/AliSimpleValue.cxx | 829 --------------------------------- SHUTTLE/AliSimpleValue.h | 332 ------------- SHUTTLE/SHUTTLELinkDef.h | 15 - SHUTTLE/libSHUTTLE.pkg | 10 +- SHUTTLE/test/LinkDef.h | 3 +- SHUTTLE/test/Makefile | 4 +- 16 files changed, 437 insertions(+), 1664 deletions(-) delete mode 100644 SHUTTLE/AliCDBPreProcessor.cxx delete mode 100644 SHUTTLE/AliCDBPreProcessor.h delete mode 100644 SHUTTLE/AliDCSValue.cxx delete mode 100644 SHUTTLE/AliDCSValue.h delete mode 100644 SHUTTLE/AliSimpleValue.cxx delete mode 100644 SHUTTLE/AliSimpleValue.h diff --git a/SHUTTLE/AliCDBPreProcessor.cxx b/SHUTTLE/AliCDBPreProcessor.cxx deleted file mode 100644 index 30f9427cc68..00000000000 --- a/SHUTTLE/AliCDBPreProcessor.cxx +++ /dev/null @@ -1,137 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * 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. * - **************************************************************************/ - -/* -$Log$ -Revision 1.3 2005/11/17 17:47:34 byordano -TList changed to TObjArray - -Revision 1.2 2005/11/17 14:43:22 byordano -import to local CVS - -Revision 1.1.1.1 2005/10/28 07:33:58 hristov -Initial import as subdirectory in AliRoot - -Revision 1.1.1.1 2005/09/12 22:11:40 byordano -SHUTTLE package - -Revision 1.2 2005/08/29 21:15:47 byordano -some docs added - -*/ - -// Description: -// This class is the CDBPreProcessor interface, -// supposed to be implemented by any detector -// interested in immediate processing of data -// which is retrieved from DCS. -// For every particular run set of aliases and -// their corespoding value sets are returned. -// Usage schema: -// 1) virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime) -// This method is called at the begining of data retrieval. -// run: run number -// startTime: when the run started -// endTime: when the run finished -// -// 2) virtual void Process(const char* alias, TObjArray& valueSet, -// Bool_t hasError) -// -// This method is called for every particular alias which the detector -// is registered in the configuration (see AliShuttleConfig). -// alias: alias name -// valueSet: collection of AliDCSValue -// hasError: flag indicating if some error has happened during -// the retrieaval of the data for this alias. -// -// 3) virtual void Finalize() -// This method is called after the last alias has been processed. -// - - -#include "AliCDBPreProcessor.h" - -#include "AliShuttle.h" -#include "AliLog.h" - -ClassImp(AliCDBPreProcessor) - -AliCDBPreProcessor::AliCDBPreProcessor(const char* detector): - TNamed(detector, "") -{ - SetTitle(Form("AliCDBPreProcessor for %s subdetector.", detector)); -} - -AliCDBPreProcessor::~AliCDBPreProcessor() { - -} - -Int_t AliCDBPreProcessor::GetRun() const { - // - // Returns current run number. - // - - if (!fShuttle) { - AliError(Form("Not registered AliCDBPreProcessor: %s", - GetName())); - return -1; - } - - return fShuttle->GetCurrentRun(); -} - -UInt_t AliCDBPreProcessor::GetStartTime() const { - // - // Returns currernt run start time. - // - if (!fShuttle) { - AliError(Form("Not registered AliCDBPreProcessor: %s", - GetName())); - return 0; - } - - return fShuttle->GetCurrentStartTime(); -} - -UInt_t AliCDBPreProcessor::GetEndTime() const { - // - // Returns current run end time. - // - if (!fShuttle) { - AliError(Form("Not registered AliCDBPreProcessor: %s", - GetName())); - return 0; - } - - return fShuttle->GetCurrentEndTime(); -} - -Bool_t AliCDBPreProcessor::Store(const char* specType, TObject* object, - AliCDBMetaData* metaData) -{ - // - // Store object and metaData into the default AliCDBStorage. - // Storage path: /DCS/ - // - - if (!fShuttle) { - AliError(Form("Not registered AliCDBPreProcessor: %s", - GetName())); - return kFALSE; - } - - return fShuttle->Store(GetName(), specType, object, metaData); -} - diff --git a/SHUTTLE/AliCDBPreProcessor.h b/SHUTTLE/AliCDBPreProcessor.h deleted file mode 100644 index 5f0bfb20168..00000000000 --- a/SHUTTLE/AliCDBPreProcessor.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef ALI_CDB_PRE_PROCESSOR_H -#define ALI_CDB_PRE_PROCESSOR_H - -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -// -// This class is the CDBPreProcessor interface, -// supposed to be implemented by any detector -// interested in immediate processing of data -// which is retrieved from DCS. -// - -#include - -class AliShuttle; -class AliCDBMetaData; - -class AliCDBPreProcessor: public TNamed { - - friend class AliShuttle; - -public: - AliCDBPreProcessor(const char* detector); - virtual ~AliCDBPreProcessor(); - - Int_t GetRun() const; - UInt_t GetStartTime() const; - UInt_t GetEndTime() const; - - Bool_t Store(const char* specType, TObject* object, - AliCDBMetaData* metaData); - - void SetShuttle(AliShuttle* shuttle) {fShuttle = shuttle;}; - AliShuttle* GetShuttle() const {return fShuttle;}; - -protected: - - virtual void Initialize(Int_t /*run*/, UInt_t /*startTime*/, - UInt_t /*endTime*/) {}; - - virtual void Finalize() {}; - - virtual void Process(const char* alias, TObjArray& valueSet, - Bool_t hasError) = 0; - -private: - - AliShuttle* fShuttle; - - ClassDef(AliCDBPreProcessor, 0); -}; - -#endif diff --git a/SHUTTLE/AliDCSValue.cxx b/SHUTTLE/AliDCSValue.cxx deleted file mode 100644 index 1e8da0a7fe6..00000000000 --- a/SHUTTLE/AliDCSValue.cxx +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * 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. * - **************************************************************************/ - -/* -$Log$ -Revision 1.2 2005/11/17 14:43:23 byordano -import to local CVS - -Revision 1.1.1.1 2005/10/28 07:33:58 hristov -Initial import as subdirectory in AliRoot - -Revision 1.1.1.1 2005/09/12 22:11:40 byordano -SHUTTLE package - -Revision 1.2 2005/08/30 10:53:23 byordano -some more descriptions added - -*/ - -// -// This class represents the main value structure -// which forms so called 'historical data' in any SCADA system. -// When a value (which represent a parameter of some real world object) -// is measured in the time, a value serie (called value set) is formed. -// Each element of this value series has two fields: -// fValue - primitive value which represents the real measured value -// fTimestamp - timestamp when the measurement was made -// - -#include "AliDCSValue.h" - -#include "TTimeStamp.h" - -ClassImp(AliDCSValue) - -AliDCSValue::AliDCSValue() { - -} - -AliDCSValue::AliDCSValue(const AliSimpleValue& value, UInt_t timeStamp): - fValue(value), fTimeStamp(timeStamp) -{ - -} - - -TString AliDCSValue::ToString() const { - - return fValue.ToString() + ", Timestmap: " + - TTimeStamp(fTimeStamp).AsString(); -} - - diff --git a/SHUTTLE/AliDCSValue.h b/SHUTTLE/AliDCSValue.h deleted file mode 100644 index 016647d58bb..00000000000 --- a/SHUTTLE/AliDCSValue.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ALI_DCS_VALUE_H -#define ALI_DCS_VALUE_H - -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -// -// This class represents the main value structure -// which forms so called 'historical data' in any SCADA system. -// - -#include "AliSimpleValue.h" - -class AliDCSValue: public TObject { -public: - - AliDCSValue(); - AliDCSValue(const AliSimpleValue& value, UInt_t timeStamp); - - AliSimpleValue& GetSimpleValue() {return fValue;}; - const AliSimpleValue& GetSimpleValue() const {return fValue;}; - void SetSimpleValue(const AliSimpleValue& value) {fValue = value;}; - - UInt_t GetTimeStamp() const {return fTimeStamp;}; - void SetTimeStamp(UInt_t timeStamp) {fTimeStamp = timeStamp;}; - - Int_t GetSize() const {return fValue.GetSize() + sizeof(UInt_t);}; - - TString ToString() const; - -private: - - AliSimpleValue fValue; - - UInt_t fTimeStamp; - - - ClassDef(AliDCSValue, 1); -}; - -#endif diff --git a/SHUTTLE/AliShuttle.cxx b/SHUTTLE/AliShuttle.cxx index 08e79410444..bd24010dfb2 100644 --- a/SHUTTLE/AliShuttle.cxx +++ b/SHUTTLE/AliShuttle.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2006/03/07 07:52:34 hristov +New version (B.Yordanov) + Revision 1.6 2005/11/19 17:19:14 byordano RetrieveDATEEntries and RetrieveConditionsData added @@ -44,12 +47,12 @@ some docs added // // This class is the main manager for AliShuttle. // It organizes the data retrieval from DCS and call the -// interface methods of AliCDBPreProcessor. +// interface methods of AliPreprocessor. // For every detector in AliShuttleConfgi (see AliShuttleConfig), // data for its set of aliases is retrieved. If there is registered -// AliCDBPreProcessor for this detector than it will be used -// accroding to the schema (see AliCDBPreProcessor). -// If there isn't registered AliCDBPreProcessor than the retrieved +// AliPreprocessor for this detector then it will be used +// accroding to the schema (see AliPreprocessor). +// If there isn't registered AliPreprocessor than the retrieved // data is stored automatically to the undelying AliCDBStorage. // For detSpec is used the alias name. // @@ -59,68 +62,104 @@ some docs added #include "AliCDBManager.h" #include "AliCDBStorage.h" #include "AliCDBId.h" -#include "AliCDBPreProcessor.h" #include "AliShuttleConfig.h" #include "AliDCSClient.h" #include "AliLog.h" +#include "AliPreprocessor.h" +#include "AliDefaultPreprocessor.h" +#include #include ClassImp(AliShuttle) -AliShuttle::AliShuttle(const AliShuttleConfig* config, - AliCDBStorage* cdbStorage, UInt_t timeout, Int_t retries): - fConfig(config), fStorage(cdbStorage), fTimeout(timeout), - fRetries(retries), fCurrentRun(-1), fCurrentStartTime(0), - fCurrentEndTime(0) +TString AliShuttle::fgkLocalUri("local://ShuttleCDB"); + +//______________________________________________________________________________________________ +AliShuttle::AliShuttle(const AliShuttleConfig* config, + UInt_t timeout, Int_t retries): + fConfig(config), + fTimeout(timeout), + fRetries(retries), fCurrentRun(-1), fCurrentStartTime(0), + fCurrentEndTime(0), + fLog("") { // // config: AliShuttleConfig used - // cdbStorage: underlying AliCDBStorage + // mainStorage: underlying AliCDBStorage + // localStorage (local) CDB storage to be used if mainStorage is unavailable // timeout: timeout used for AliDCSClient connection // retries: the number of retries in case of connection error. // + RegisterPreprocessor(new AliDefaultPreprocessor("DEFAULT", 0)); + } +//______________________________________________________________________________________________ AliShuttle::~AliShuttle() { - fPreProcessorMap.DeleteAll(); + fPreprocessorMap.DeleteAll(); } -void AliShuttle::RegisterCDBPreProcessor(AliCDBPreProcessor* processor) { +//______________________________________________________________________________________________ +void AliShuttle::RegisterPreprocessor(AliPreprocessor* preprocessor) { // - // Registers new AliCDBPreProcessor. + // Registers new AliPreprocessor. // It uses GetName() for indentificator of the pre processor. // The pre processor is registered it there isn't any other // with the same identificator (GetName()). // - if (fPreProcessorMap.GetValue(processor->GetName())) { - AliWarning(Form("AliCDBPreProcessor %s is already registered!", - processor->GetName())); + if (fPreprocessorMap.GetValue(preprocessor->GetName())) { + AliWarning(Form("AliPreprocessor %s is already registered!", + preprocessor->GetName())); return; } - fPreProcessorMap.Add(new TObjString(processor->GetName()), processor); - processor->SetShuttle(this); + fPreprocessorMap.Add(new TObjString(preprocessor->GetName()), preprocessor); } -Bool_t AliShuttle::Store(const char* detector, const char* specType, +//______________________________________________________________________________________________ +UInt_t AliShuttle::Store(const char* detector, TObject* object, AliCDBMetaData* metaData) { - if (!fStorage) { - AliError("Invalid storage object!"); - return kFALSE; + // store data into CDB + // returns 0 if fail + // 1 if stored in main (Grid) storage + // 2 if stored in backup (Local) storage + + if (!(AliCDBManager::Instance()->IsDefaultStorageSet())) { + AliError("No CDB storage set!"); + return 0; } - AliCDBId id(AliCDBPath(detector, "DCS", specType), + AliCDBId id(AliCDBPath(detector, "DCS", "Data"), GetCurrentRun(), GetCurrentRun()); - return fStorage->Put(object, id, metaData); + + UInt_t result = (UInt_t) AliCDBManager::Instance()->Put(object, id, metaData); + if(!result) { + + Log(detector, "Error while storing object in main storage!"); + AliError("local storage will be used!"); + +// result = fLocalStorage->Put(object, id, metaData); + result = AliCDBManager::Instance()->GetStorage(fgkLocalUri) + ->Put(object, id, metaData); + + if(result) { + result = 2; + }else{ + Log(detector, "Can't store data!"); + } + } + return result; + } +//______________________________________________________________________________________________ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime) { // - // Makes data retrieval for all detectors in the configuration. + // Makes data retrieval for all detectors in the configuration. // run: is the run number used // startTime: is the run start time // endTime: is the run end time @@ -129,22 +168,29 @@ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime) { Bool_t hasError = kFALSE; - TIter iter(fConfig->GetDetectors()); + TIter iter(fConfig->GetDetectors()); TObjString* aDetector; + + ClearLog(); + while ((aDetector = (TObjString*) iter.Next())) { + if(!fConfig->HostProcessDetector(aDetector->GetName())) continue; if(!Process(run, startTime, endTime, aDetector->String())) { hasError = kTRUE; } } + if(fLog != "") StoreLog(run); + return !hasError; } +//______________________________________________________________________________________________ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime, const char* detector) { // - // Makes data retrieval just for one specific detector. + // Makes data retrieval just for one specific detector. // Threre should be a configuration for this detector. // run: is the run number used // startTime: is the run start time @@ -156,8 +202,7 @@ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime, AliInfo(Form("Retrieving values for %s, run %d", detector, run)); if (!fConfig->HasDetector(detector)) { - AliError(Form("There isn't any configuration for %s", - detector)); + Log(detector, "There isn't any configuration for %s !"); return kFALSE; } @@ -165,58 +210,41 @@ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime, fCurrentStartTime = startTime; fCurrentEndTime = endTime; - TString host(fConfig->GetHost(detector)); - Int_t port = fConfig->GetPort(detector); - - AliCDBPreProcessor* aPreProcessor = - (AliCDBPreProcessor*) fPreProcessorMap.GetValue(detector); + TString host(fConfig->GetDCSHost(detector)); + Int_t port = fConfig->GetDCSPort(detector); - TIter iter(fConfig->GetAliases(detector)); + TIter iter(fConfig->GetDCSAliases(detector)); TObjString* anAlias; + TMap aliasMap; Bool_t hasError = kFALSE; + Bool_t result=kFALSE; - if (aPreProcessor) { - aPreProcessor->Initialize(run, startTime, endTime); - - TObjArray valueSet; - while ((anAlias = (TObjString*) iter.Next())) { - Bool_t result = GetValueSet(host, port, - anAlias->String(), valueSet); - - aPreProcessor->Process(anAlias->String(), valueSet, - !result); - - valueSet.Delete(); - } - - aPreProcessor->Finalize(); - - } else { - AliCDBMetaData metaData; - metaData.SetProperty("StartTime", - new AliSimpleValue(startTime)); - metaData.SetProperty("EndTime", - new AliSimpleValue(endTime)); - metaData.SetComment("Automatically stored by AliShuttle!"); - + while ((anAlias = (TObjString*) iter.Next())) { TObjArray valueSet; - while ((anAlias = (TObjString*) iter.Next())) { - if (GetValueSet(host, port, anAlias->String(), - valueSet)) { - if (!Store(detector, anAlias->String(), - &valueSet, &metaData)) { - AliError(Form("Can't store %s for %s!", - anAlias->String().Data(), - detector)); - hasError = kTRUE; - } - } - - valueSet.Delete(); + result = GetValueSet(host, port, anAlias->String(), valueSet); + if(result) { + aliasMap.Add(anAlias->Clone(), valueSet.Clone()); + }else{ + TString message = Form("Error while retrieving alias %s !", + anAlias->GetName()); + Log(detector, message.Data()); + hasError = kTRUE; } } - + + AliPreprocessor* aPreprocessor = + dynamic_cast (fPreprocessorMap.GetValue(detector)); + if(!aPreprocessor){ + AliInfo(Form("No Preprocessor for %s: Using default Preprocessor!",detector)); + aPreprocessor = dynamic_cast (fPreprocessorMap.GetValue("DEFAULT")); + } + + aPreprocessor->Initialize(run, startTime, endTime); + hasError = (Bool_t) !(aPreprocessor->Process(&aliasMap)); + + aliasMap.Delete(); + fCurrentRun = -1; fCurrentStartTime = 0; fCurrentEndTime = 0; @@ -224,12 +252,13 @@ Bool_t AliShuttle::Process(Int_t run, UInt_t startTime, UInt_t endTime, return !hasError; } +//______________________________________________________________________________________________ Bool_t AliShuttle::GetValueSet(const char* host, Int_t port, const char* alias, TObjArray& valueSet) { AliDCSClient client(host, port, fTimeout, fRetries); if (!client.IsConnected()) { - return kFALSE; + return kFALSE; } Int_t result = client.GetAliasValues(alias, @@ -249,3 +278,49 @@ Bool_t AliShuttle::GetValueSet(const char* host, Int_t port, const char* alias, return kTRUE; } + +//______________________________________________________________________________________________ +const char* AliShuttle::GetFile(Int_t /*system*/, const char* /*detector*/, + const char* /*id*/, const char* /*source*/) +{ + + AliInfo("You are in AliShuttle::GetFile!"); + return 0; +} + + +//______________________________________________________________________________________________ +TList* AliShuttle::GetFileSources(Int_t /*system*/, const char* /*detector*/, const char* /*id*/) +{ + + AliInfo("You are in AliShuttle::GetFileSources!"); + return 0; +} + +//______________________________________________________________________________________________ +void AliShuttle::Log(const char* detector, const char* message) +{ + + TString toLog = Form("%s - %s", detector, message); + AliError(toLog.Data()); + + fLog += toLog; + fLog += "\n"; + +} + +//______________________________________________________________________________________________ +void AliShuttle::StoreLog(Int_t run){ + + AliInfo("Printing fLog..."); + AliInfo(fLog.Data()); + // Storing log string for runs with errors in "SHUTTLE/SYSTEM/ERRORLOGS" + TObjString *logString = new TObjString(fLog); + AliCDBId badRunId("SHUTTLE/SYSTEM/ERRORLOGS",run,run); + AliCDBMetaData metaData; + AliCDBManager::Instance()->GetStorage(fgkLocalUri) + ->Put(logString, badRunId,&metaData); + delete logString; + + +} diff --git a/SHUTTLE/AliShuttle.h b/SHUTTLE/AliShuttle.h index 0e682c6ea6d..1c717eb7c2f 100644 --- a/SHUTTLE/AliShuttle.h +++ b/SHUTTLE/AliShuttle.h @@ -16,21 +16,21 @@ #include #include +#include + +#include "AliShuttleInterface.h" class AliShuttleConfig; -class AliCDBStorage; +class AliPreprocessor; class AliCDBMetaData; -class AliCDBParam; -class AliCDBPreProcessor; -class AliShuttle: public TObject { +class AliShuttle: public AliShuttleInterface { public: - AliShuttle(const AliShuttleConfig* config, AliCDBStorage* cdbStorage, - UInt_t timeout = 5000, Int_t retries = 5); + AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5); virtual ~AliShuttle(); - void RegisterCDBPreProcessor(AliCDBPreProcessor* processor); - + virtual void RegisterPreprocessor(AliPreprocessor* preprocessor); + Bool_t Process(Int_t run, UInt_t startTime, UInt_t endTime); Bool_t Process(Int_t run, UInt_t startTime, UInt_t endTime, const char* detector); @@ -39,21 +39,36 @@ public: UInt_t GetCurrentStartTime() const {return fCurrentStartTime;}; UInt_t GetCurrentEndTime() const {return fCurrentEndTime;}; - Bool_t Store(const char* detector, const char* detSpec, - TObject* object, AliCDBMetaData* metaData); + virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData); + virtual const char* GetFile(Int_t system, const char* detector, + const char* id, const char* source); + virtual TList* GetFileSources(Int_t system, const char* detector, const char* id); + virtual void Log(const char* detector, const char* message); + + static TString GetLocalURI () {return fgkLocalUri;} + static void SetLocalURI (TString localUri) {fgkLocalUri = localUri;} private: - const AliShuttleConfig* fConfig; - AliCDBStorage* fStorage; + + static TString fgkLocalUri; + + void ClearLog() {fLog = "";} + void StoreLog(Int_t run); + const AliShuttleConfig* fConfig; + +// AliCDBStorage* fLocalStorage; + UInt_t fTimeout; Int_t fRetries; - - TMap fPreProcessorMap; + + TMap fPreprocessorMap; Int_t fCurrentRun; UInt_t fCurrentStartTime; UInt_t fCurrentEndTime; + TString fLog; + Bool_t GetValueSet(const char* host, Int_t port, const char* alias, TObjArray& result); diff --git a/SHUTTLE/AliShuttleConfig.cxx b/SHUTTLE/AliShuttleConfig.cxx index 1ae8580904d..a8e60a18b5a 100644 --- a/SHUTTLE/AliShuttleConfig.cxx +++ b/SHUTTLE/AliShuttleConfig.cxx @@ -15,6 +15,13 @@ /* $Log$ +Revision 1.7 2006/05/12 09:07:16 colla +12/05/06 +New configuration complete + +Revision 1.2 2006/03/07 07:52:34 hristov +New version (B.Yordanov) + Revision 1.4 2005/11/19 14:20:31 byordano logbook config added to AliShuttleConfig @@ -50,6 +57,7 @@ some docs added #include "AliLog.h" +#include #include #include #include @@ -60,7 +68,7 @@ AliShuttleConfig::ConfigHolder::ConfigHolder(const TLDAPEntry* entry): { TLDAPAttribute* anAttribute; - anAttribute = entry->GetAttribute("dt"); + anAttribute = entry->GetAttribute("det"); if (!anAttribute) { AliError("Invalid configuration! Can't get detector name."); return; @@ -71,62 +79,73 @@ AliShuttleConfig::ConfigHolder::ConfigHolder(const TLDAPEntry* entry): return; } - anAttribute = entry->GetAttribute("ipHost"); + anAttribute = entry->GetAttribute("DCSHost"); if (!anAttribute) { - AliError("Invalid configuration! Can't get ipHost."); + AliError("Invalid configuration! Can't get DCSHost."); return; } - fHost = anAttribute->GetValue(); - if (!fHost.Length()) { + fDCSHost = anAttribute->GetValue(); + if (!fDCSHost.Length()) { AliError("Host can't be an empty string!") return; } - anAttribute = entry->GetAttribute("ipServicePort"); + anAttribute = entry->GetAttribute("DCSPort"); if (!anAttribute) { - AliError("Invalid configuration! Can't get ipServicePort."); + AliError("Invalid configuration! Can't get DCSPort."); return; } TString portStr = anAttribute->GetValue(); if (!portStr.Length()) { - AliError("ipServicePort can't be an empty string!") + AliError("port can't be an empty string!") return; } - fPort = portStr.Atoi(); + fDCSPort = portStr.Atoi(); - anAttribute = entry->GetAttribute("alias"); + anAttribute = entry->GetAttribute("DCSAlias"); if (!anAttribute) { AliError("Invalid configuration! Can't get alias attribute."); return; } const char* anAlias; while ((anAlias = anAttribute->GetValue())) { - fAliases.AddLast(new TObjString(anAlias)); + fDCSAliases.AddLast(new TObjString(anAlias)); + } + + anAttribute = entry->GetAttribute("DAQFileIDs"); + if (!anAttribute) { + AliError("Invalid configuration! Can't get DAQFileIDs attribute."); + return; + } + const char* aFileID; + while ((aFileID = anAttribute->GetValue())) { + fDAQFileIDs.AddLast(new TObjString(aFileID)); } fIsValid = kTRUE; } AliShuttleConfig::ConfigHolder::~ConfigHolder() { - fAliases.Delete(); + fDCSAliases.Delete(); } ClassImp(AliShuttleConfig) AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port, const char* binddn, const char* password, const char* basedn): - fIsValid(kFALSE) + fIsValid(kFALSE), + fProcessAll(kFALSE) { // // host: ldap server host // port: ldap server port // binddn: binddn used for ldap binding (simple bind is used!). // password: password for binddn - // basedn: this is basedn whose childeren entries which have + // basedn: this is basedn whose childeren entries which have // (objectClass=shuttleConfig) will be used as detector configurations. // - TLDAPServer aServer(host, port, binddn, password); + TLDAPServer aServer(host, port, binddn, password, 3); if (!aServer.IsConnected()) { AliError(Form("Can't connect to ldap server %s:%d", @@ -134,15 +153,54 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port, return; } + // reads configuration for the shuttle running on this machine + + fShuttleInstanceHost = gSystem->HostName(); + TString queryFilter = "(ShuttleHost="; + queryFilter += fShuttleInstanceHost; + queryFilter += ")"; + TLDAPResult* aResult = aServer.Search(basedn, LDAP_SCOPE_ONELEVEL, - "(objectClass=shuttleConfig)"); + queryFilter.Data()); + if (!aResult) { AliError(Form("Can't find configuration with base DN: %s", basedn)); return; } + + if (aResult->GetCount() == 0) { + AliError(Form("No Shuttle instance for host = %s!",fShuttleInstanceHost.Data())); + AliError(Form("All detectors will be processed.")); + fProcessAll=kTRUE; + } + + if (aResult->GetCount() > 1) { + AliError(Form("More than one Shuttle instance for host %s!",fShuttleInstanceHost.Data())); + return; + } TLDAPEntry* anEntry; + TLDAPAttribute* anAttribute; + + if(!fProcessAll){ + anEntry = aResult->GetNext(); + anAttribute = anEntry->GetAttribute("detectors"); + const char *detName; + while((detName = anAttribute->GetValue())){ + TObjString *objDet= new TObjString(detName); + fProcessedDetectors.Add(objDet); + } + } + + aResult = aServer.Search(basedn, LDAP_SCOPE_ONELEVEL, + "(objectClass=AliShuttleDetector)"); + if (!aResult) { + AliError(Form("Can't find configuration with base DN: %s", + basedn)); + return; + } + while ((anEntry = aResult->GetNext())) { ConfigHolder* aHolder = new ConfigHolder(anEntry); delete anEntry; @@ -163,7 +221,7 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port, aResult = aServer.Search(basedn, LDAP_SCOPE_ONELEVEL, - "(objectClass=logbookConfig)"); + "(objectClass=AliShuttleGlobalConfig)"); if (!aResult) { AliError(Form("Can't find configuration with base DN: %s", basedn)); @@ -171,38 +229,44 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port, } if (aResult->GetCount() == 0) { - AliError("Can't find DAQ log book configuration!"); + AliError("Can't find DAQ logbook configuration!"); return; } if (aResult->GetCount() > 1) { - AliError("More than one DAQ log book configuration found!"); + AliError("More than one DAQ logbook configuration found!"); return; } anEntry = aResult->GetNext(); - TLDAPAttribute* anAttribute; - anAttribute = anEntry->GetAttribute("lbURI"); + anAttribute = anEntry->GetAttribute("DAQLogbookHost"); if (!anAttribute) { - AliError("Can't find lbURI attribute!"); + AliError("Can't find DAQLogbookHost attribute!"); return; } - fLogBookURI = anAttribute->GetValue(); + fDAQLogBookHost = anAttribute->GetValue(); - anAttribute = anEntry->GetAttribute("lbUser"); + anAttribute = anEntry->GetAttribute("DAQLogbookUser"); if (!anAttribute) { - AliError("Can't find lbUser attribute!"); + AliError("Can't find DAQLogbookUser attribute!"); return; } - fLogBookUser = anAttribute->GetValue(); + fDAQLogBookUser = anAttribute->GetValue(); - anAttribute = anEntry->GetAttribute("lbPassword"); + anAttribute = anEntry->GetAttribute("DAQLogbookPassword"); if (!anAttribute) { - AliError("Can't find lbPassword attribute!"); + AliError("Can't find DAQLogbookPassword attribute!"); return; } - fLogBookPassword = anAttribute->GetValue(); + fDAQLogBookPassword = anAttribute->GetValue(); + + anAttribute = anEntry->GetAttribute("DAQFileSystemHost"); + if (!anAttribute) { + AliError("Can't find DAQFileSystemHost attribute!"); + return; + } + fDAQFSHost = anAttribute->GetValue(); delete anEntry; delete aResult; @@ -230,7 +294,7 @@ Bool_t AliShuttleConfig::HasDetector(const char* detector) const { return fDetectorMap.GetValue(detector) != NULL; } -const char* AliShuttleConfig::GetHost(const char* detector) const { +const char* AliShuttleConfig::GetDCSHost(const char* detector) const { // // returns DCS server host used by particular detector // @@ -242,10 +306,10 @@ const char* AliShuttleConfig::GetHost(const char* detector) const { return NULL; } - return aHolder->GetHost(); + return aHolder->GetDCSHost(); } -Int_t AliShuttleConfig::GetPort(const char* detector) const { +Int_t AliShuttleConfig::GetDCSPort(const char* detector) const { // // returns DCS server port used by particular detector // @@ -258,10 +322,10 @@ Int_t AliShuttleConfig::GetPort(const char* detector) const { return 0; } - return aHolder->GetPort(); + return aHolder->GetDCSPort(); } -const TObjArray* AliShuttleConfig::GetAliases(const char* detector) const { +const TObjArray* AliShuttleConfig::GetDCSAliases(const char* detector) const { // // returns collection of TObjString which represents the set of aliases // which used for data retrieval for particular detector @@ -274,7 +338,35 @@ const TObjArray* AliShuttleConfig::GetAliases(const char* detector) const { return NULL; } - return aHolder->GetAliases(); + return aHolder->GetDCSAliases(); +} + +const TObjArray* AliShuttleConfig::GetDAQFileIDs(const char* detector) const { + // + // returns collection of TObjString which represents the set of DAQ file IDs + // which used for data retrieval for particular detector + // + + ConfigHolder* aHolder = (ConfigHolder*) fDetectorMap.GetValue(detector); + if (!aHolder) { + AliError(Form("There isn't configuration for detector: %s", + detector)); + return NULL; + } + + return aHolder->GetDAQFileIDs(); +} + +Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const { + // return TRUE if detector is handled by host or if fProcessAll is TRUE + + if(fProcessAll) return kTRUE; + TIter iter(&fProcessedDetectors); + TObjString* detName; + while((detName = (TObjString*) iter.Next())){ + if(detName->String() == detector) return kTRUE; + } + return kFALSE; } void AliShuttleConfig::Print(Option_t* /*option*/) const { @@ -282,16 +374,36 @@ void AliShuttleConfig::Print(Option_t* /*option*/) const { TString result; result += '\n'; - result += "LogBook URI: "; - result += fLogBookURI; + result += "Shuttle running on host: "; + result += fShuttleInstanceHost; result += '\n'; - result += "LogBook User: "; - result += fLogBookUser; + result += "Detectors handled by this host: "; + TIter it(&fProcessedDetectors); + TObjString* aDet; + while ((aDet = (TObjString*) it.Next())) { + result += aDet->String(); + result += ' '; + } result += '\n'; - result += "LogBook Password: "; - result.Append('*', fLogBookPassword.Length()); + if(fProcessAll) result += "ProcessAll is ON"; + result += '\n'; - + result += '\n'; + + result += "DAQ LogBook Host: "; + result += fDAQLogBookHost; + result += '\n'; + result += "DAQ LogBook User: "; + result += fDAQLogBookUser; + result += '\n'; + result += "DAQ LogBook Password: "; + result.Append('*', fDAQLogBookPassword.Length()); + result += '\n'; + result += '\n'; + result += "DAQ File System Host: "; + result += fDAQFSHost; + result += '\n'; + TIter iter(fDetectorMap.GetTable()); TPair* aPair; while ((aPair = (TPair*) iter.Next())) { @@ -300,16 +412,16 @@ void AliShuttleConfig::Print(Option_t* /*option*/) const { result += " Detector: "; result += aHolder->GetDetector(); result += '\n'; - result += " Host: "; - result += aHolder->GetHost(); + result += " DCS Host: "; + result += aHolder->GetDCSHost(); result += '\n'; - result += " Port: "; - result += aHolder->GetPort(); + result += " DCS Port: "; + result += aHolder->GetDCSPort(); result += '\n'; - result += " Aliases: "; - const TObjArray* aliases = aHolder->GetAliases(); - TIter it(aliases); + result += " DCS Aliases: "; + const TObjArray* aliases = aHolder->GetDCSAliases(); + TIter it(aliases); TObjString* anAlias; while ((anAlias = (TObjString*) it.Next())) { result += anAlias->String(); @@ -317,6 +429,16 @@ void AliShuttleConfig::Print(Option_t* /*option*/) const { } result += '\n'; + + result += " DAQ File IDs: "; + const TObjArray* fileIDs = aHolder->GetDAQFileIDs(); + TIter it2(fileIDs); + TObjString* aFileID; + while ((aFileID = (TObjString*) it2.Next())) { + result += aFileID->String(); + result += ' '; + } + result += '\n'; } AliInfo(result); diff --git a/SHUTTLE/AliShuttleConfig.h b/SHUTTLE/AliShuttleConfig.h index c1dc0575448..0404857b8f1 100644 --- a/SHUTTLE/AliShuttleConfig.h +++ b/SHUTTLE/AliShuttleConfig.h @@ -19,33 +19,42 @@ class AliShuttleConfig: public TObject { public: - AliShuttleConfig(const char* host, Int_t port = LDAP_PORT, - const char* binddn = 0, const char* password = 0, - const char* basedn = "dc=alice,dc=cern,dc=ch"); + AliShuttleConfig(const char* host, Int_t port = LDAP_PORT, + const char* binddn = 0, const char* password = 0, + const char* basedn = "o=alice,dc=cern,dc=ch"); virtual ~AliShuttleConfig(); Bool_t IsValid() const {return fIsValid;}; - const char* GetLogBookURI() const {return fLogBookURI.Data();} - const char* GetLogBookUser() const {return fLogBookUser.Data();} - const char* GetLogBookPassword() const {return fLogBookPassword.Data();} + const char* GetDAQLogBookHost() const {return fDAQLogBookHost.Data();} + const char* GetDAQLogBookUser() const {return fDAQLogBookUser.Data();} + const char* GetDAQLogBookPassword() const {return fDAQLogBookPassword.Data();} + + const char* GetDAQFSHost() const {return fDAQFSHost.Data();} const TObjArray* GetDetectors() const; Bool_t HasDetector(const char* detector) const; - const char* GetHost(const char* detector) const; - Int_t GetPort(const char* detector) const; - const TObjArray* GetAliases(const char* detector) const; + const char* GetDCSHost(const char* detector) const; + Int_t GetDCSPort(const char* detector) const; + const TObjArray* GetDCSAliases(const char* detector) const; + const TObjArray* GetDAQFileIDs(const char* detector) const; + + void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;} + Bool_t ProcessAll() {return fProcessAll;} + + Bool_t HostProcessDetector(const char* detector) const; virtual void Print(Option_t* option = NULL) const; private: - + class ConfigHolder: public TObject { TString fDetector; - TString fHost; - Int_t fPort; - TObjArray fAliases; + TString fDCSHost; + Int_t fDCSPort; + TObjArray fDCSAliases; + TObjArray fDAQFileIDs; Bool_t fIsValid; public: @@ -53,9 +62,10 @@ private: ~ConfigHolder(); const char* GetDetector() const {return fDetector.Data();}; - const char* GetHost() const {return fHost.Data();}; - Int_t GetPort() const {return fPort;}; - const TObjArray* GetAliases() const {return &fAliases;}; + const char* GetDCSHost() const {return fDCSHost.Data();}; + Int_t GetDCSPort() const {return fDCSPort;}; + const TObjArray* GetDCSAliases() const {return &fDCSAliases;}; + const TObjArray* GetDAQFileIDs() const {return &fDAQFileIDs;}; Bool_t IsValid() const {return fIsValid;}; @@ -65,12 +75,18 @@ private: Bool_t fIsValid; - TString fLogBookURI; - TString fLogBookUser; - TString fLogBookPassword; + TString fDAQLogBookHost; + TString fDAQLogBookUser; + TString fDAQLogBookPassword; + + TString fDAQFSHost; TMap fDetectorMap; - TObjArray fDetectorList; + TObjArray fDetectorList; + + TString fShuttleInstanceHost; + TObjArray fProcessedDetectors; + Bool_t fProcessAll; ClassDef(AliShuttleConfig, 0); }; diff --git a/SHUTTLE/AliShuttleTrigger.cxx b/SHUTTLE/AliShuttleTrigger.cxx index ec2cc255272..0a9d16cd3c4 100644 --- a/SHUTTLE/AliShuttleTrigger.cxx +++ b/SHUTTLE/AliShuttleTrigger.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.1 2006/03/07 07:52:34 hristov + New version (B.Yordanov) + Revision 1.5 2005/11/21 09:03:48 byordano one more print added @@ -28,7 +31,7 @@ // This class is to deal with DAQ LogBook and DAQ "end of run" notification. // It has severeal two modes: // 1) syncrhnized - Collect(), CollectNew() and CollectAll methods -// 2) asynchronized - Run() - starts listening for DAQ "end of run" +// 2) asynchronized - Run() - starts listening for DAQ "end of run" // notification by DIM service. // @@ -41,6 +44,7 @@ #include #include "AliLog.h" +#include "AliCDBManager.h" #include "AliCDBStorage.h" #include "AliCDBEntry.h" @@ -50,6 +54,8 @@ #include "DATENotifier.h" ClassImp(TerminateSignalHandler) + +//______________________________________________________________________________________________ Bool_t TerminateSignalHandler::Notify() { AliInfo("Terminate signal received ..."); @@ -59,9 +65,11 @@ Bool_t TerminateSignalHandler::Notify() { } ClassImp(AliShuttleTrigger) + +//______________________________________________________________________________________________ AliShuttleTrigger::AliShuttleTrigger(const AliShuttleConfig* config, - AliCDBStorage* storage, UInt_t timeout, Int_t retries): - fConfig(config), fStorage(storage), fShuttle(NULL), + UInt_t timeout, Int_t retries): + fConfig(config), fShuttle(NULL), fNotified(kFALSE), fTerminate(kFALSE), fCondition(&fMutex), fQuitSignalHandler(this, kSigQuit), fInterruptSignalHandler(this, kSigInterrupt) @@ -69,15 +77,17 @@ AliShuttleTrigger::AliShuttleTrigger(const AliShuttleConfig* config, // // config - pointer to the AliShuttleConfig object which represents // the configuration - // storage - pointer to AliCDBStorage for the undelying CDBStorage + // mainStorage - pointer to AliCDBStorage for the undelying CDBStorage + // localStorage (local) CDB storage to be used if mainStorage is unavailable // - fShuttle = new AliShuttle(config, storage, timeout, retries); + fShuttle = new AliShuttle(config, timeout, retries); gSystem->AddSignalHandler(&fQuitSignalHandler); gSystem->AddSignalHandler(&fInterruptSignalHandler); } +//______________________________________________________________________________________________ AliShuttleTrigger::~AliShuttleTrigger() { gSystem->RemoveSignalHandler(&fQuitSignalHandler); @@ -86,6 +96,7 @@ AliShuttleTrigger::~AliShuttleTrigger() { delete fShuttle; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::Notify() { // // Trigger CollectNew() methods in asynchronized (listen) mode. @@ -103,6 +114,7 @@ Bool_t AliShuttleTrigger::Notify() { return kTRUE; } +//______________________________________________________________________________________________ void AliShuttleTrigger::Terminate() { // // Stop triggers listen mode and exist from Run() @@ -113,6 +125,7 @@ void AliShuttleTrigger::Terminate() { fCondition.Signal(); } +//______________________________________________________________________________________________ void AliShuttleTrigger::Run() { // // AliShuttleTrigger main loop for asynchronized (listen) mode. @@ -147,6 +160,7 @@ void AliShuttleTrigger::Run() { delete notifier; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::RetrieveDATEEntries(const char* whereClause, TObjArray& entries, Int_t& lastRun) { @@ -156,13 +170,18 @@ Bool_t AliShuttleTrigger::RetrieveDATEEntries(const char* whereClause, sqlQuery += " order by run"; TSQLServer* aServer; - aServer = TSQLServer::Connect(fConfig->GetLogBookURI(), - fConfig->GetLogBookUser(), - fConfig->GetLogBookPassword()); + TString logbookHost="mysql://"; + logbookHost+=fConfig->GetDAQLogBookHost(); + + aServer = TSQLServer::Connect(logbookHost, + fConfig->GetDAQLogBookUser(), + fConfig->GetDAQLogBookPassword()); if (!aServer) { AliError("Can't establish connection to DAQ log book DB!"); return kFALSE; } + + aServer->GetTables("REFSYSLOG"); TSQLResult* aResult; aResult = aServer->Query(sqlQuery); @@ -227,6 +246,7 @@ Bool_t AliShuttleTrigger::RetrieveDATEEntries(const char* whereClause, return kTRUE; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::RetrieveConditionsData(const TObjArray& dateEntries) { Bool_t hasError = kFALSE; @@ -234,16 +254,17 @@ Bool_t AliShuttleTrigger::RetrieveConditionsData(const TObjArray& dateEntries) { TIter iter(&dateEntries); DATEEntry* anEntry; while ((anEntry = (DATEEntry*) iter.Next())) { - if(!fShuttle->Process(anEntry->GetRun(), + if(!fShuttle->Process(anEntry->GetRun(), anEntry->GetStartTime(), anEntry->GetEndTime())) { hasError = kTRUE; - } + } } return !hasError; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::Collect(Int_t run) { // // Collects conditions date for the given run. @@ -280,6 +301,7 @@ Bool_t AliShuttleTrigger::Collect(Int_t run) { return kTRUE; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::CollectNew() { // // Collects conditions data for all new run written to DAQ LogBook. @@ -289,10 +311,11 @@ Bool_t AliShuttleTrigger::CollectNew() { Int_t lastRun; - AliCDBEntry* cdbEntry = fStorage->Get("/SHUTTLE/SYSTEM/LASTRUN", 0); + AliCDBEntry* cdbEntry = AliCDBManager::Instance()->GetStorage(AliShuttle::GetLocalURI()) + ->Get("/SHUTTLE/SYSTEM/LASTRUN", 0); if (cdbEntry) { TObject* anObject = cdbEntry->GetObject(); - if (anObject == NULL || + if (anObject == NULL || anObject->IsA() != AliSimpleValue::Class()) { AliError("Invalid last run object stored to CDB!"); return kFALSE; @@ -301,8 +324,8 @@ Bool_t AliShuttleTrigger::CollectNew() { lastRun = simpleValue->GetInt(); delete cdbEntry; } else { - AliWarning("There isn't last run stored! Starting from run 0"); - lastRun = -1; + AliWarning("There isn't last run stored! Starting from run 21200"); + lastRun = 21200; } AliInfo(Form("Last run number <%d>", lastRun)); @@ -322,7 +345,10 @@ Bool_t AliShuttleTrigger::CollectNew() { AliCDBMetaData metaData; AliCDBId cdbID(AliCDBPath("SHUTTLE", "SYSTEM", "LASTRUN"), 0, 0); - if (!fStorage->Put(&lastRunObj, cdbID, &metaData)) { + UInt_t result = AliCDBManager::Instance()->GetStorage(AliShuttle::GetLocalURI()) + ->Put(&lastRunObj, cdbID, &metaData); + + if (!result) { AliError("Can't store last run to CDB!"); return kFALSE; } @@ -336,6 +362,7 @@ Bool_t AliShuttleTrigger::CollectNew() { return kTRUE; } +//______________________________________________________________________________________________ Bool_t AliShuttleTrigger::CollectAll() { // // Collects conditions data for all run written in DAQ LogBook. diff --git a/SHUTTLE/AliShuttleTrigger.h b/SHUTTLE/AliShuttleTrigger.h index 143cf4c5937..7d88b6c1e6b 100644 --- a/SHUTTLE/AliShuttleTrigger.h +++ b/SHUTTLE/AliShuttleTrigger.h @@ -38,9 +38,7 @@ public: class AliShuttleTrigger: public TObject { public: - AliShuttleTrigger(const AliShuttleConfig* config, - AliCDBStorage* storage, UInt_t timeout = 5000, - Int_t retries = 5); + AliShuttleTrigger(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5); ~AliShuttleTrigger(); AliShuttle* GetShuttle() {return fShuttle;} @@ -76,7 +74,7 @@ private: Bool_t RetrieveConditionsData(const TObjArray& dateEntries); const AliShuttleConfig* fConfig; - AliCDBStorage* fStorage; + //AliCDBStorage* fLocalStorage; AliShuttle* fShuttle; diff --git a/SHUTTLE/AliSimpleValue.cxx b/SHUTTLE/AliSimpleValue.cxx deleted file mode 100644 index f26fdf277f4..00000000000 --- a/SHUTTLE/AliSimpleValue.cxx +++ /dev/null @@ -1,829 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * 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. * - **************************************************************************/ - -/* -$Log$ -Revision 1.2 2005/11/17 14:43:23 byordano -import to local CVS - -Revision 1.1.1.1 2005/10/28 07:33:58 hristov -Initial import as subdirectory in AliRoot - -Revision 1.1.1.1 2005/09/12 22:11:40 byordano -SHUTTLE package - -Revision 1.2 2005/08/30 10:53:23 byordano -some more descriptions added - -*/ - -// -// This class is a simple wrapper of -// all primitive types used in PVSS SCADA system. -// - - -#include "AliSimpleValue.h" - -#include "AliLog.h" -#include - -TObject* AliSimpleValue::BoolHolder::Clone(const char* /*name*/) const { - return new BoolHolder(fValue); -} - -Bool_t AliSimpleValue::BoolHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (BoolHolder::Class() != obj->IsA()) { - return kFALSE; - } - - return fValue == ((const BoolHolder*) obj)->fValue; -} - -TObject* AliSimpleValue::ByteHolder::Clone(const char* /*name*/) const { - return new ByteHolder(fValue); -} - -Bool_t AliSimpleValue::ByteHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (ByteHolder::Class() != obj->IsA()) { - return kFALSE; - } - - return fValue == ((const ByteHolder*) obj)->fValue; -} - -TObject* AliSimpleValue::IntHolder::Clone(const char* /*name*/) const { - return new IntHolder(fValue); -} - -Bool_t AliSimpleValue::IntHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (IntHolder::Class() != obj->IsA()) { - return kFALSE; - } - - return fValue == ((const IntHolder*) obj)->fValue; -} - -TObject* AliSimpleValue::UIntHolder::Clone(const char* /*name*/) const { - return new UIntHolder(fValue); -} - -Bool_t AliSimpleValue::UIntHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (UIntHolder::Class() != obj->IsA()) { - return kFALSE; - } - - return fValue == ((const UIntHolder*) obj)->fValue; -} - -TObject* AliSimpleValue::FloatHolder::Clone(const char* /*name*/) const { - return new FloatHolder(fValue); -} - -Bool_t AliSimpleValue::FloatHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (FloatHolder::Class() != obj->IsA()) { - return kFALSE; - } - - return fValue == ((const FloatHolder*) obj)->fValue; -} - -TObject* AliSimpleValue::DynBoolHolder::Clone(const char* /*name*/) const { - return new DynBoolHolder(fSize, fValues); -} - -Bool_t AliSimpleValue::DynBoolHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (DynBoolHolder::Class() != obj->IsA()) { - return kFALSE; - } - - const DynBoolHolder* other = ((const DynBoolHolder*) obj); - - if (fSize != other->fSize) { - return kFALSE; - } - - return !memcmp(fValues, other->fValues, fSize * sizeof(Bool_t)); -} - -TObject* AliSimpleValue::DynByteHolder::Clone(const char* /*name*/) const { - return new DynByteHolder(fSize, fValues); -} - -Bool_t AliSimpleValue::DynByteHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (DynByteHolder::Class() != obj->IsA()) { - return kFALSE; - } - - const DynByteHolder* other = ((const DynByteHolder*) obj); - - if (fSize != other->fSize) { - return kFALSE; - } - - return !memcmp(fValues, other->fValues, fSize * sizeof(Char_t)); -} - -TObject* AliSimpleValue::DynIntHolder::Clone(const char* /*name*/) const { - return new DynIntHolder(fSize, fValues); -} - -Bool_t AliSimpleValue::DynIntHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (DynIntHolder::Class() != obj->IsA()) { - return kFALSE; - } - - const DynIntHolder* other = ((const DynIntHolder*) obj); - - if (fSize != other->fSize) { - return kFALSE; - } - - return !memcmp(fValues, other->fValues, fSize * sizeof(Int_t)); -} - -TObject* AliSimpleValue::DynUIntHolder::Clone(const char* /*name*/) const { - return new DynUIntHolder(fSize, fValues); -} - -Bool_t AliSimpleValue::DynUIntHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (DynUIntHolder::Class() != obj->IsA()) { - return kFALSE; - } - - const DynUIntHolder* other = ((const DynUIntHolder*) obj); - - if (fSize != other->fSize) { - return kFALSE; - } - - return !memcmp(fValues, other->fValues, fSize * sizeof(UInt_t)); -} - -TObject* AliSimpleValue::DynFloatHolder::Clone(const char* /*name*/) const { - return new DynFloatHolder(fSize, fValues); -} - -Bool_t AliSimpleValue::DynFloatHolder::IsEqual(const TObject* obj) const { - - if (this == obj) { - return kTRUE; - } - - if (DynFloatHolder::Class() != obj->IsA()) { - return kFALSE; - } - - const DynFloatHolder* other = ((const DynFloatHolder*) obj); - - if (fSize != other->fSize) { - return kFALSE; - } - - return !memcmp(fValues, other->fValues, fSize * sizeof(Float_t)); -} - -ClassImp(AliSimpleValue) - -AliSimpleValue::AliSimpleValue(): - fHolder(NULL), fType(kInvalid) -{ - -} - -AliSimpleValue::AliSimpleValue(const AliSimpleValue& other): - TObject(other), fHolder(NULL), fType(other.fType) -{ - if (other.fHolder) { - fHolder = other.fHolder->Clone(); - } -} - -AliSimpleValue::AliSimpleValue(AliSimpleValue::Type type, Int_t size): - fHolder(NULL), fType(type) -{ - - switch (type) { - case kBool: - fHolder = new BoolHolder(); - break; - case kByte: - fHolder = new ByteHolder(); - break; - case kInt: - fHolder = new IntHolder(); - break; - case kUInt: - fHolder = new UIntHolder(); - break; - case kFloat: - fHolder = new FloatHolder(); - break; - case kDynBool: - fHolder = new DynBoolHolder(size); - break; - case kDynByte: - fHolder = new DynByteHolder(size); - break; - case kDynInt: - fHolder = new DynIntHolder(size); - break; - case kDynUInt: - fHolder = new DynUIntHolder(size); - break; - case kDynFloat: - fHolder = new DynFloatHolder(size); - break; - default: - break; - } -} - -AliSimpleValue::AliSimpleValue(Bool_t val) { - - fType = kBool; - fHolder = new BoolHolder(val); -} - -AliSimpleValue::AliSimpleValue(Char_t val) { - - fType = kByte; - fHolder = new ByteHolder(val); -} - -AliSimpleValue::AliSimpleValue(Int_t val) { - - fType = kInt; - fHolder = new IntHolder(val); -} - -AliSimpleValue::AliSimpleValue(UInt_t val) { - - fType = kUInt; - fHolder = new UIntHolder(val); -} - -AliSimpleValue::AliSimpleValue(Float_t val) { - - fType = kFloat; - fHolder = new FloatHolder(val); -} - -AliSimpleValue::AliSimpleValue(Int_t size, const Bool_t* buf) { - - fType = kDynBool; - fHolder = new DynBoolHolder(size, buf); -} - -AliSimpleValue::AliSimpleValue(Int_t size, const Char_t* buf) { - - fType = kDynByte; - fHolder = new DynByteHolder(size, buf); -} - -AliSimpleValue::AliSimpleValue(Int_t size, const Int_t* buf) { - - fType = kDynInt; - fHolder = new DynIntHolder(size, buf); -} - -AliSimpleValue::AliSimpleValue(Int_t size, const UInt_t* buf) { - - fType = kDynUInt; - fHolder = new DynUIntHolder(size, buf); -} - -AliSimpleValue::AliSimpleValue(Int_t size, const Float_t* buf) { - - fType = kDynFloat; - fHolder = new DynFloatHolder(size, buf); -} - -AliSimpleValue::~AliSimpleValue() { - - if (fHolder) { - delete fHolder; - } -} - -AliSimpleValue& AliSimpleValue::operator=(const AliSimpleValue& other) { - - if (fHolder) { - delete fHolder; - } - - fType = other.fType; - - if (other.fHolder) { - fHolder = other.fHolder->Clone(); - } else { - fHolder = NULL; - } - - return *this; -} - -Bool_t AliSimpleValue::operator==(const AliSimpleValue& other) const { - - if (fType != other.fType) { - return kFALSE; - } - - if (!(fHolder && other.fHolder)) { - return kFALSE; - } - - return fHolder->IsEqual(other.fHolder); -} - -void AliSimpleValue::SetBool(Bool_t val) { - - if (!TypeOk(kBool)) { - return; - } - - ((BoolHolder*) fHolder)->fValue = val; -} - -void AliSimpleValue::SetByte(Char_t val) { - - if (!TypeOk(kByte)) { - return; - } - - ((ByteHolder*) fHolder)->fValue = val; -} - -void AliSimpleValue::SetInt(Int_t val) { - - if (!TypeOk(kInt)) { - return; - } - - ((IntHolder*) fHolder)->fValue = val; -} - -void AliSimpleValue::SetUInt(UInt_t val) { - - if (!TypeOk(kUInt)) { - return; - } - - ((UIntHolder*) fHolder)->fValue = val; -} - -void AliSimpleValue::SetFloat(Float_t val) { - - if (!TypeOk(kFloat)) { - return; - } - - ((FloatHolder*) fHolder)->fValue = val; -} - -Bool_t AliSimpleValue::GetBool() const { - - if (!TypeOk(kBool)) { - return kFALSE; - } - - return ((BoolHolder*) fHolder)->fValue; -} - -Char_t AliSimpleValue::GetByte() const { - - if (!TypeOk(kByte)) { - return 0; - } - - return ((ByteHolder*) fHolder)->fValue; -} - -Int_t AliSimpleValue::GetInt() const { - - if (!TypeOk(kInt)) { - return 0; - } - return ((IntHolder*) fHolder)->fValue; -} - -UInt_t AliSimpleValue::GetUInt() const { - - if (!TypeOk(kUInt)) { - return 0; - } - - return ((UIntHolder*) fHolder)->fValue; -} - -Float_t AliSimpleValue::GetFloat() const { - - if (!TypeOk(kFloat)) { - return 0; - } - - return ((FloatHolder*) fHolder)->fValue; -} - -void AliSimpleValue::SetDynBool(Int_t n, Bool_t val) { - - if (!TypeOk(kDynBool)) { - return; - } - - if (!BoundsOk(n)) { - return; - } - - ((DynBoolHolder*) fHolder)->fValues[n] = val; -} - -void AliSimpleValue::SetDynByte(Int_t n, Char_t val) { - - if (!TypeOk(kDynByte)) { - return; - } - - if (!BoundsOk(n)) { - return; - } - - ((DynByteHolder*) fHolder)->fValues[n] = val; -} - -void AliSimpleValue::SetDynInt(Int_t n, Int_t val) { - - if (!TypeOk(kDynInt)) { - return; - } - - if (!BoundsOk(n)) { - return; - } - - ((DynIntHolder*) fHolder)->fValues[n] = val; -} - -void AliSimpleValue::SetDynUInt(Int_t n, UInt_t val) { - - if (!TypeOk(kDynUInt)) { - return; - } - - if (!BoundsOk(n)) { - return; - } - - ((DynUIntHolder*) fHolder)->fValues[n] = val; -} - -void AliSimpleValue::SetDynFloat(Int_t n, Float_t val) { - - if (!TypeOk(kDynFloat)) { - return; - } - - if (!BoundsOk(n)) { - return; - } - - ((DynFloatHolder*) fHolder)->fValues[n] = val; -} - -Bool_t AliSimpleValue::GetDynBool(Int_t n) const { - - if (!TypeOk(kDynBool)) { - return kFALSE; - } - - if (!BoundsOk(n)) { - return kFALSE; - } - - return ((DynBoolHolder*) fHolder)->fValues[n]; -} - -Char_t AliSimpleValue::GetDynByte(Int_t n) const { - - if (!TypeOk(kDynByte)) { - return 0; - } - - if (!BoundsOk(n)) { - return 0; - } - - return ((DynByteHolder*) fHolder)->fValues[n]; -} - -Int_t AliSimpleValue::GetDynInt(Int_t n) const { - - if (!TypeOk(kDynInt)) { - return 0; - } - - if (!BoundsOk(n)) { - return 0; - } - - return ((DynIntHolder*) fHolder)->fValues[n]; -} - -UInt_t AliSimpleValue::GetDynUInt(Int_t n) const { - - if (!TypeOk(kDynUInt)) { - return 0; - } - - if (!BoundsOk(n)) { - return 0; - } - - return ((DynUIntHolder*) fHolder)->fValues[n]; -} - -Float_t AliSimpleValue::GetDynFloat(Int_t n) const { - - if (!TypeOk(kDynFloat)) { - return 0; - } - - if (!BoundsOk(n)) { - return 0; - } - - return ((DynFloatHolder*) fHolder)->fValues[n]; -} - -Bool_t AliSimpleValue::TypeOk(AliSimpleValue::Type type) const { - - if (fType != type) { - AliError(Form("SimpleValue type is not %s!", - GetTypeString(type))); - return kFALSE; - } - - return kTRUE; -} - -Bool_t AliSimpleValue::BoundsOk(Int_t n) const { - - switch (fType) { - case kDynBool: - case kDynByte: - case kDynInt: - case kDynUInt: - case kDynFloat: { - Int_t size = ((DynHolder*) fHolder)->fSize; - if (n < 0 || n >= size) { - AliError(Form("Index %d out of bounds!", n)); - return kFALSE; - } - return kTRUE; - } - case kBool: - case kByte: - case kInt: - case kUInt: - case kFloat: - AliError(Form("SimpleValue type %s is not dynamic!", - GetTypeString(fType))); - return kFALSE; - default: - AliError("Invalid or unknown type!"); - return kFALSE; - } -} - -Int_t AliSimpleValue::GetDynamicSize() const { - // - // returns the size of dynamic type or 0 in case of - // none dynamic type. - // - - if (!fHolder) { - return 0; - } - - if (!fHolder->IsA()->InheritsFrom(DynHolder::Class())) { - return 0; - } - - return ((DynHolder*) fHolder)->fSize; -} - -TString AliSimpleValue::ToString() const { - - TString result; - - result += "Type: "; - result += GetTypeString(fType); - - result += ", Value: "; - switch (fType) { - case kBool: - result += GetBool(); - break; - case kByte: - result += (Int_t) GetByte(); - break; - case kInt: - result += GetInt(); - break; - case kUInt: - result += GetUInt(); - break; - case kFloat: - result += GetFloat(); - break; - case kDynBool: { - result += "["; - Int_t size = GetDynamicSize(); - for (Int_t k = 0; k < size; k ++) { - result += GetDynBool(k); - if (k + 1 < size) { - result += ", "; - } - } - result += "]"; - } - break; - case kDynByte: { - result += "["; - Int_t size = GetDynamicSize(); - for (Int_t k = 0; k < size; k ++) { - result += GetDynByte(k); - if (k + 1 < size) { - result += ", "; - } - } - result += "]"; - } - break; - case kDynInt: { - result += "["; - Int_t size = GetDynamicSize(); - for (Int_t k = 0; k < size; k ++) { - result += GetDynInt(k); - if (k + 1 < size) { - result += ", "; - } - } - result += "]"; - } - break; - case kDynUInt: { - result += "["; - Int_t size = GetDynamicSize(); - for (Int_t k = 0; k < size; k ++) { - result += GetDynUInt(k); - if (k + 1 < size) { - result += ", "; - } - } - result += "]"; - } - break; - case kDynFloat: { - result += "["; - Int_t size = GetDynamicSize(); - for (Int_t k = 0; k < size; k ++) { - result += GetDynFloat(k); - if (k + 1 < size) { - result += ", "; - } - } - result += "]"; - } - break; - default: - result += "Unknown"; - } - - return result; -} - -Bool_t AliSimpleValue::IsDynamic(AliSimpleValue::Type type) { - - switch (type) { - case kDynBool: - case kDynByte: - case kDynInt: - case kDynUInt: - case kDynFloat: - return kTRUE; - default: - return kFALSE; - } -} - -Int_t AliSimpleValue::GetSize() const { - // - // return the number of bytes used by this value. - // In case of dynamic type it returns dynamic size multiplied - // by the size of corresponding primitive type. - // - - return IsDynamic(fType) ? - GetDynamicSize() * AliSimpleValue::GetPrimitiveSize(fType): - AliSimpleValue::GetPrimitiveSize(fType); -} - -Int_t AliSimpleValue::GetPrimitiveSize(AliSimpleValue::Type type) { - // - // returns the number of bytes used by particular primitive type - // or by the corresponding primitive type in case of dynamic type. - // - - - switch (type) { - - case kBool: - case kDynBool: return sizeof(Bool_t); - case kByte: - case kDynByte: return sizeof(Char_t); - case kInt: - case kDynInt: return sizeof(Int_t); - case kUInt: - case kDynUInt: return sizeof(UInt_t); - case kFloat: - case kDynFloat: return sizeof(Float_t); - default: - return 0; - } -} - -const char* AliSimpleValue::GetTypeString(AliSimpleValue::Type type) { - - switch (type) { - case kBool: return "Bool"; - case kByte: return "Byte"; - case kInt: return "Int"; - case kUInt: return "UInt"; - case kFloat: return "Float"; - case kDynBool: return "DynBool"; - case kDynByte: return "DynByte"; - case kDynInt: return "DynInt"; - case kDynUInt: return "DynUInt"; - case kDynFloat: return "DynFloat"; - default: - return "Unknown"; - } -} diff --git a/SHUTTLE/AliSimpleValue.h b/SHUTTLE/AliSimpleValue.h deleted file mode 100644 index 4aa35b696c3..00000000000 --- a/SHUTTLE/AliSimpleValue.h +++ /dev/null @@ -1,332 +0,0 @@ -#ifndef ALI_SIMPLE_VALUE_H -#define ALI_SIMPLE_VALUE_H - -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -// -// This class is a simple wrapper of -// all primitive types used in PVSS SCADA system. -// - -#include -#include - -class AliSimpleValue: public TObject { -public: - enum Type { - kInvalid = 0, - kBool = 1, - kByte = 2, - kInt = 3, - kUInt = 4, - kFloat = 5, - kDynBool = 11, - kDynByte = 12, - kDynInt = 13, - kDynUInt = 14, - kDynFloat = 15 - }; - - - AliSimpleValue(); - - AliSimpleValue(const AliSimpleValue& other); - - AliSimpleValue(Type type, Int_t size = 0); - - AliSimpleValue(Bool_t val); - - AliSimpleValue(Char_t val); - - AliSimpleValue(Int_t val); - - AliSimpleValue(UInt_t val); - - AliSimpleValue(Float_t val); - - AliSimpleValue(Int_t size, const Bool_t* vals); - - AliSimpleValue(Int_t size, const Char_t* vals); - - AliSimpleValue(Int_t size, const Int_t* vals); - - AliSimpleValue(Int_t size, const UInt_t* vals); - - AliSimpleValue(Int_t size, const Float_t* vals); - - ~AliSimpleValue(); - - - AliSimpleValue& operator=(const AliSimpleValue& other); - - Bool_t operator==(const AliSimpleValue& other) const; - - void SetBool(Bool_t val); - - void SetByte(Char_t val); - - void SetInt(Int_t val); - - void SetUInt(UInt_t val); - - void SetFloat(Float_t val); - - - Bool_t GetBool() const; - - Char_t GetByte() const; - - Int_t GetInt() const; - - UInt_t GetUInt() const; - - Float_t GetFloat() const; - - - void SetDynBool(Int_t n, Bool_t val); - - void SetDynByte(Int_t n, Char_t val); - - void SetDynInt(Int_t n, Int_t val); - - void SetDynUInt(Int_t n, UInt_t val); - - void SetDynFloat(Int_t n, Float_t val); - - - Bool_t GetDynBool(Int_t n) const; - - Char_t GetDynByte(Int_t n) const; - - Int_t GetDynInt(Int_t n) const; - - UInt_t GetDynUInt(Int_t n) const; - - Float_t GetDynFloat(Int_t n) const; - - - Type GetType() const {return fType;}; - - Int_t GetSize() const; - - Int_t GetDynamicSize() const; - - TString ToString() const; - - - static Bool_t IsDynamic(Type type); - - static Int_t GetPrimitiveSize(Type type); - - static const char* GetTypeString(Type type); - -private: - - class BoolHolder: public TObject { - public: - Bool_t fValue; - - BoolHolder() {} - - BoolHolder(Bool_t val):fValue(val) {} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(BoolHolder, 1); - }; - - class ByteHolder: public TObject { - public: - Char_t fValue; - - ByteHolder() {}; - - ByteHolder(Char_t val):fValue(val) {} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(ByteHolder, 1); - }; - - class IntHolder: public TObject { - public: - Int_t fValue; - - IntHolder() {} - - IntHolder(Int_t val):fValue(val) {} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(IntHolder, 1); - }; - - class UIntHolder: public TObject { - public: - UInt_t fValue; - - UIntHolder() {} - - UIntHolder(UInt_t val):fValue(val) {} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(UIntHolder, 1); - }; - - class FloatHolder: public TObject { - public: - Float_t fValue; - - FloatHolder() {} - - FloatHolder(Float_t val):fValue(val) {} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(FloatHolder, 1); - }; - - class DynHolder: public TObject { - public: - Int_t fSize; - - DynHolder(): fSize(0) {} - DynHolder(Int_t size): fSize(size){} - - ClassDef(DynHolder, 0); - }; - - class DynBoolHolder: public DynHolder { - public: - Bool_t* fValues; //[fSize] - - DynBoolHolder(): fValues(NULL) {} - - DynBoolHolder(Int_t size, const Bool_t* buf = NULL): - DynHolder(size) { - fValues = new Bool_t[size]; - if (buf) memcpy(fValues, buf, size * sizeof(Bool_t)); - } - - virtual ~DynBoolHolder() {if (fValues) delete[] fValues;} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(DynBoolHolder, 1); - }; - - class DynByteHolder: public DynHolder { - public: - Char_t* fValues; //[fSize] - - DynByteHolder(): fValues(NULL) {} - - DynByteHolder(Int_t size, const Char_t* buf = NULL): - DynHolder(size) { - fValues = new Char_t[size]; - if (buf) memcpy(fValues, buf, size * sizeof(Char_t)); - } - - virtual ~DynByteHolder() {if (fValues) delete[] fValues;} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(DynByteHolder, 1); - }; - - class DynIntHolder: public DynHolder { - public: - Int_t* fValues; //[fSize] - - DynIntHolder(): fValues(NULL) {} - - DynIntHolder(Int_t size, const Int_t* buf = NULL): - DynHolder(size) { - fValues = new Int_t[size]; - if (buf) memcpy(fValues, buf, size * sizeof(Int_t)); - } - - virtual ~DynIntHolder() {if (fValues) delete[] fValues;} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(DynIntHolder, 1); - }; - - class DynUIntHolder: public DynHolder { - public: - UInt_t* fValues; //[fSize] - - DynUIntHolder(): fValues(NULL) {} - - DynUIntHolder(Int_t size, const UInt_t* buf = NULL): - DynHolder(size) { - fValues = new UInt_t[size]; - if (buf) memcpy(fValues, buf, size * sizeof(UInt_t)); - } - - virtual ~DynUIntHolder() {if (fValues) delete[] fValues;} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(DynUIntHolder, 1); - }; - - class DynFloatHolder: public DynHolder { - public: - Float_t* fValues; //[fSize] - - DynFloatHolder(): fValues(NULL) {} - - DynFloatHolder(Int_t size, const Float_t* buf = NULL): - DynHolder(size) { - fValues = new Float_t[size]; - if (buf) memcpy(fValues, buf, size * sizeof(Float_t)); - } - - virtual ~DynFloatHolder() {if (fValues) delete[] fValues;} - - virtual TObject* Clone(const char* name) const; - - virtual Bool_t IsEqual(const TObject* object) const; - - ClassDef(DynFloatHolder, 1); - }; - - - TObject* fHolder; - - Type fType; - - - Bool_t TypeOk(Type type) const; - - Bool_t BoundsOk(Int_t n) const; - - - ClassDef(AliSimpleValue, 1); -}; - -#endif diff --git a/SHUTTLE/SHUTTLELinkDef.h b/SHUTTLE/SHUTTLELinkDef.h index 757cf0435e2..78f47a9cdf2 100644 --- a/SHUTTLE/SHUTTLELinkDef.h +++ b/SHUTTLE/SHUTTLELinkDef.h @@ -12,20 +12,6 @@ #pragma link C++ global gMC; // AliDCSClient classes ... -#pragma link C++ class AliSimpleValue; -#pragma link C++ class AliSimpleValue::BoolHolder; -#pragma link C++ class AliSimpleValue::ByteHolder; -#pragma link C++ class AliSimpleValue::IntHolder; -#pragma link C++ class AliSimpleValue::UIntHolder; -#pragma link C++ class AliSimpleValue::FloatHolder; -#pragma link C++ class AliSimpleValue::DynHolder; -#pragma link C++ class AliSimpleValue::DynBoolHolder; -#pragma link C++ class AliSimpleValue::DynByteHolder; -#pragma link C++ class AliSimpleValue::DynIntHolder; -#pragma link C++ class AliSimpleValue::DynUIntHolder; -#pragma link C++ class AliSimpleValue::DynFloatHolder; -#pragma link C++ class AliDCSValue; - #pragma link C++ class AliDCSMessage; #pragma link C++ class AliDCSClient; @@ -33,7 +19,6 @@ #pragma link C++ class AliShuttleConfig; #pragma link C++ class AliShuttleConfig::ConfigHolder; #pragma link C++ class AliShuttle; -#pragma link C++ class AliCDBPreProcessor; #pragma link C++ class AliShuttleTrigger; #pragma link C++ class TerminateSignalHandler; #pragma link C++ class AliShuttleTrigger::DATEEntry; diff --git a/SHUTTLE/libSHUTTLE.pkg b/SHUTTLE/libSHUTTLE.pkg index 965fb2be113..3683dae3f4e 100644 --- a/SHUTTLE/libSHUTTLE.pkg +++ b/SHUTTLE/libSHUTTLE.pkg @@ -1,6 +1,6 @@ -SRCS = AliSimpleValue.cxx AliDCSValue.cxx AliDCSMessage.cxx\ +SRCS = AliDCSMessage.cxx\ AliDCSClient.cxx AliShuttle.cxx AliShuttleConfig.cxx\ - AliCDBPreProcessor.cxx AliShuttleTrigger.cxx + AliShuttleTrigger.cxx CINTHDRS:= $(patsubst %,$(MODDIR)/%,$(SRCS:.cxx=.h)) @@ -11,10 +11,6 @@ EINCLUDE := $(DIMDIR)/dim ELIBS := dim ELIBSDIR := $(DIMDIR)/$(ODIR) - DHDR= SHUTTLELinkDef.h - -EXPORT:= AliSimpleValue.h AliDCSValue.h AliDCSClient.h\ - AliShuttle.h AliShuttleConfig.h AliCDBPreProcessor.h - +EXPORT:= diff --git a/SHUTTLE/test/LinkDef.h b/SHUTTLE/test/LinkDef.h index f8b2d06c1b6..30dfeaf1dc5 100644 --- a/SHUTTLE/test/LinkDef.h +++ b/SHUTTLE/test/LinkDef.h @@ -9,6 +9,7 @@ #pragma link off all functions; #pragma link C++ class TestServer; -#pragma link C++ class TestITSPreProcessor; +#pragma link C++ class TestITSPreprocessor; +#pragma link C++ class TestTPCPreprocessor; #endif diff --git a/SHUTTLE/test/Makefile b/SHUTTLE/test/Makefile index 441cef908f9..5e89dd2cfe7 100644 --- a/SHUTTLE/test/Makefile +++ b/SHUTTLE/test/Makefile @@ -2,7 +2,7 @@ include ../../build/Makefile.$(ALICE_TARGET) -CLASSES = TestServer.cxx TestITSPreProcessor.cxx +CLASSES = TestServer.cxx TestITSPreprocessor.cxx TestTPCPreprocessor.cxx DICT = DictTest.cxx @@ -13,7 +13,7 @@ SRCS = $(CLASSES) $(DICT) OBJS := $(patsubst %.cxx,.obj/%.o,$(SRCS)) DEPS := $(patsubst .obj/%.o,.dep/%.d,$(OBJS)) -INCDIR = -I$(shell root-config --incdir) -I../ -I../../include +INCDIR = -I$(shell root-config --incdir) -I../ -I../../include -I../../TPC CXXFLAGS += $(INCDIR) LIBDIR = $(shell root-config --libdir) LIBS = $(shell root-config --libs) -- 2.39.3