3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 /// @file AliHLTMisc.h
20 /// @author Matthias Richter
22 /// @brief Definition of various glue functions implemented in dynamically
25 #include "AliHLTMisc.h"
26 #include "AliHLTLogging.h"
30 /** ROOT macro for the implementation of ROOT specific class methods */
33 AliHLTMisc::AliHLTMisc()
35 // see header file for function documentation
38 AliHLTMisc::~AliHLTMisc()
40 // see header file for function documentation
43 AliHLTMisc* AliHLTMisc::fgInstance=NULL;
46 T* AliHLTMisc::LoadInstance(const T* /*t*/, const char* classname, const char* library)
48 // see header file for function documentation
53 ROOT::NewFunc_t pNewFunc=NULL;
55 pCl=TClass::GetClass(classname);
56 } while (!pCl && (iLibResult=gSystem->Load(library))==0);
58 if (pCl && (pNewFunc=pCl->GetNew())!=NULL) {
59 void* p=(*pNewFunc)(NULL);
61 pInstance=reinterpret_cast<T*>(p);
63 log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "type cast (%s) to instance failed", classname);
66 log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not create instance of type %s from class descriptor", classname);
69 log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not find class descriptor %s", classname);
72 log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not load %s library in order to find class descriptor %s", library, classname);
77 AliHLTMisc& AliHLTMisc::Instance()
79 // see header file for function documentation
81 fgInstance=LoadInstance((AliHLTMisc*)NULL, "AliHLTMiscImplementation", ALIHLTMISC_LIBRARY);
85 fgInstance=new AliHLTMisc;
86 log.Logging(kHLTLogError, "AliHLTMisc::Instance", "HLT Analysis", "falling back to default AliHLTMisc instance");
91 int AliHLTMisc::InitCDB(const char* /*cdbpath*/)
93 // see header file for function documentation
97 int AliHLTMisc::SetCDBRunNo(int /*runNo*/)
99 // see header file for function documentation
103 AliCDBEntry* AliHLTMisc::LoadOCDBEntry(const char* /*path*/, int /*runNo*/, int /*version*/, int /*subVersion*/)
105 // see header file for function documentation
109 TObject* AliHLTMisc::ExtractObject(AliCDBEntry* /*entry*/)
111 // see header file for function documentation