1 // $Id: AliRawHLTManager.cxx 23039 2007-12-13 20:53:02Z richterm $
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 AliRawHLTManager.cxx
20 @author Matthias Richter
22 @brief dynamic generation of HLT RAW readers and streams
25 #include "AliRawHLTManager.h"
30 ClassImp(AliRawHLTManager)
32 AliRawHLTManager::AliRawHLTManager()
34 // The class gives dynamic access to creater methods for HLT RAW readers and
35 // streams without any library dependencies to HLT libraries.
37 // The AliRawReaderHLT allows the redirection of input from the HLT DDL links
38 // to the detector equipment ids. To access the data, the AliRawReaderHLT
39 // needs a valid RAW reader (parent).
41 // AliRawReader* pHLTReader=AliRawHLTManager::CreateRawReaderHLT(pParent, "TPC");
44 AliRawHLTManager::~AliRawHLTManager()
49 int AliRawHLTManager::fLibraryStatus=kUnloaded;
50 void* AliRawHLTManager::fFctCreateRawReaderHLT=NULL;
51 void* AliRawHLTManager::fFctCreateRawStream=NULL;
53 AliRawReader* AliRawHLTManager::CreateRawReaderHLT(AliRawReader* pParent, const char* detectors)
55 // see header file for class documentation
56 if (fLibraryStatus==kUnloaded) fLibraryStatus=LoadLibrary();
57 if (fLibraryStatus==kUnavailable) return NULL;
59 if (!fFctCreateRawReaderHLT) {
60 AliErrorClass("internal error, library loaded but function entry not known");
63 return ((AliRawReaderHLTCreateInstance_t)fFctCreateRawReaderHLT)(pParent, detectors);
66 TObject* AliRawHLTManager::CreateRawStream(const char* /*className*/)
68 // see header file for class documentation
70 // not yet implemented
74 int AliRawHLTManager::LoadLibrary()
76 // see header file for class documentation
77 int iResult=kUnavailable;
78 if (fLibraryStatus!=kUnloaded) return fLibraryStatus;
80 // strictly speaken we do not need a trial counter as gSystem->Load only returns 1 if the
81 // library has been loaded. If it was already loaded we get 0
84 fFctCreateRawReaderHLT=gSystem->DynFindSymbol(ALIHLTREC_LIBRARY, ALIRAWREADERHLT_CREATE_INSTANCE);
85 } while (fFctCreateRawReaderHLT==NULL && gSystem->Load(ALIHLTREC_LIBRARY)==0 && iTrials++<1);
86 if (fFctCreateRawReaderHLT) {
89 AliErrorClass(Form("can not find library/entry %s/%s", ALIHLTREC_LIBRARY, ALIRAWREADERHLT_CREATE_INSTANCE));