]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawHLTManager.h
Finally we have the new RCU trailer decoding code. Now it should be propagated to...
[u/mrichter/AliRoot.git] / RAW / AliRawHLTManager.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id: AliRawHLTManager.h 23318 2008-01-14 12:43:28Z hristov $
3
4 #ifndef ALIRAWHLTMANAGER_H
5 #define ALIRAWHLTMANAGER_H
6 //* This file is property of and copyright by the ALICE HLT Project        * 
7 //* ALICE Experiment at CERN, All rights reserved.                         *
8 //* See cxx source for full Copyright notice                               *
9
10 /** @file   AliRawHLTManager.h
11     @author Matthias Richter
12     @date   
13     @brief  dynamic generation of HLT RAW readers and streams
14 */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
22 class AliRawReader;
23 #include "TObject.h"
24                         
25 /**
26  * @class AliRawHLTManager
27  * The class gives dynamic access to creater methods for HLT RAW readers and
28  * streams without any library dependencies to HLT libraries.
29  */
30 class AliRawHLTManager {
31  public:
32   AliRawHLTManager();
33   virtual ~AliRawHLTManager();
34
35   /**
36    * Create an instance of the AliRawReaderHLT.
37    * The AliRawReaderHLT instance needs the parent RAW reader and a list
38    * of detectors for which it should access data from the HLT stream.
39    */
40   static AliRawReader* CreateRawReaderHLT(AliRawReader* pParent, const char* detectors);
41
42   /**
43    * Create an instance of a RAW stream.
44    * There is no common base class for RAW streams due to the different nature of the
45    * detectors and the data. The least common class is the TObject. The calling code
46    * should check if the right class has been created by
47    * <pre>
48    * TObject pObject=AliRawHLTManager::CreateRawStream("MyClass");
49    * MyClass* pClass=dynamic_cast<MyClass*>(pObject)
50    * </pre>
51    *
52    * \b NOTE: The function redirects the request to the HLT framework, a handler
53    * to actually create the RAW stream must be implemented in the corresponding
54    * component library.
55    */
56   static TObject* CreateRawStream(const char* className);
57  protected:
58  private:
59   enum {kUnloaded=0, kLoaded, kUnavailable};
60
61   /**
62    * Load the HLT interface library
63    */
64   static int LoadLibrary();
65
66   /** status of the loading of the HOMER library */
67   static int fLibraryStatus; //!transient
68
69   /** entry in the HOMER library */
70   static void* fFctCreateRawReaderHLT; //!transient
71
72   /** entry in the HOMER library */
73   static void* fFctCreateRawStream; //!transient
74
75   ClassDef(AliRawHLTManager, 0)
76 };
77
78 // those definitions have been copied one to one from rec/AliRawReaderHLT.h
79 // to avoid including this header file
80 #define ALIHLTREC_LIBRARY                   "libHLTrec.so"
81 #define ALIHLTREC_LIBRARY_VERSION           0
82 #define ALIRAWREADERHLT_CREATE_INSTANCE     "AliRawReaderHLTCreateInstance"
83
84 #ifdef __cplusplus
85 extern "C" {
86 #endif
87   typedef AliRawReader* (*AliRawReaderHLTCreateInstance_t)(AliRawReader* pParentReader, const char* options);
88 }
89
90 #endif //ALIRAWHLTMANAGER_H