]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/interface/AliHLTExternalInterface.h
- HLT simulation writes digit data in addition to raw data
[u/mrichter/AliRoot.git] / HLT / BASE / interface / AliHLTExternalInterface.h
1 // @(#) $Id$
2
3 #ifndef ALIHLT_EXTERNALINTERFACE_H
4 #define ALIHLT_EXTERNALINTERFACE_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTExternalInterface.h
9     @author Matthias Richter, Timm Steinbeck
10     @date   
11     @brief  Pure and dynamic C interface to the AliRoot HLT component handler
12     @note   Utilized by the HLT Online (PubSub) framework
13 */
14
15 #include <AliHLTDataTypes.h>
16 class AliHLTSystem;
17 class AliHLTOUT;
18 class AliESDEvent;
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 /**
24  * 
25  * @ingroup alihlt_wrapper_interface
26  */
27 typedef void* AliHLTComponentHandle;
28
29 /**
30  * 
31  * @ingroup alihlt_wrapper_interface
32  */
33 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
34
35 /* Matthias Dec 2006
36  * The names have been changed for Aliroot's coding conventions sake
37  * The old names are defined for backward compatibility with the 
38  * PublisherSubscriber framework
39  */
40 typedef AliHLTComponentLogSeverity AliHLTComponent_LogSeverity;
41 typedef AliHLTComponentEventData AliHLTComponent_EventData;
42 typedef AliHLTComponentShmData AliHLTComponent_ShmData;
43 typedef AliHLTComponentDataType AliHLTComponent_DataType;
44 typedef AliHLTComponentBlockData AliHLTComponent_BlockData;
45 typedef AliHLTComponentTriggerData AliHLTComponent_TriggerData;
46 typedef AliHLTComponentEventDoneData AliHLTComponent_EventDoneData;
47 const AliHLTUInt32_t gkAliHLTComponent_InvalidShmType = gkAliHLTComponentInvalidShmType;
48 const AliHLTUInt64_t gkAliHLTComponent_InvalidShmID = gkAliHLTComponentInvalidShmID;
49
50 typedef int (*AliHLTExtFctInitSystem)( AliHLTComponentEnvironment* );
51
52 typedef int (*AliHLTExtFctDeinitSystem)();
53
54 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
55
56 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
57
58 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle* );
59
60 typedef void (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
61
62 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*, 
63                                          AliHLTComponentTriggerData*, AliHLTUInt8_t*,
64                                          AliHLTUInt32_t*, AliHLTUInt32_t*, 
65                                          AliHLTComponentBlockData**,
66                                          AliHLTComponentEventDoneData** );
67
68 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
69
70 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
71
72 struct AliHLTExternalFuctions_t {
73   AliHLTExtFctInitSystem        fctInitSystem;
74   AliHLTExtFctDeinitSystem      fctDeinitSystem;
75   AliHLTExtFctLoadLibrary       fctLoadLibrary;
76   AliHLTExtFctUnloadLibrary     fctUnloadLibrary;
77   AliHLTExtFctCreateComponent   fctCreateComponent;
78   AliHLTExtFctDestroyComponent  fctDestroyComponent;
79   AliHLTExtFctProcessEvent      fctProcessEvent;
80   AliHLTExtFctGetOutputDataType fctGetOutputDataType;
81   AliHLTExtFctGetOutputSize     fctGetOutputSize;
82 };
83
84 #define ALIHLT_FCT_ENTRY_INITSYSTEM        "AliHLT_C_Component_InitSystem"
85 #define ALIHLT_FCT_ENTRY_DEINITSYSTEM      "AliHLT_C_Component_DeinitSystem"
86 #define ALIHLT_FCT_ENTRY_LOADLIBRARY       "AliHLT_C_Component_LoadLibrary"
87 #define ALIHLT_FCT_ENTRY_UNLOADLIBRARY     "AliHLT_C_Component_UnloadLibrary"
88 #define ALIHLT_FCT_ENTRY_CREATECOMPONENT   "AliHLT_C_Component_CreateComponent"
89 #define ALIHLT_FCT_ENTRY_DESTROYCOMPONENT  "AliHLT_C_Component_DestroyComponent"
90 #define ALIHLT_FCT_ENTRY_PROCESSEVENT      "AliHLT_C_Component_ProcessEvent"
91 #define ALIHLT_FCT_ENTRY_GETOUTPUTDATATYPE "AliHLT_C_Component_GetOutputDataType"
92 #define ALIHLT_FCT_ENTRY_GETOUTPUTSIZE     "AliHLT_C_Component_GetOutputSize"
93
94 /**
95  * 
96  * @ingroup alihlt_wrapper_interface
97  */
98 int AliHLT_C_Component_InitSystem( AliHLTComponentEnvironment* environ );
99
100 /**
101  * 
102  * @ingroup alihlt_wrapper_interface
103  */
104 int AliHLT_C_Component_DeinitSystem();
105
106 /**
107  * 
108  * @ingroup alihlt_wrapper_interface
109  */
110 int AliHLT_C_Component_LoadLibrary( const char* libraryPath );
111
112 /**
113  * 
114  * @ingroup alihlt_wrapper_interface
115  */
116 int AliHLT_C_Component_UnloadLibrary( const char* libraryPath );
117
118 /**
119  * 
120  * @ingroup alihlt_wrapper_interface
121  */
122 int AliHLT_C_CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponentHandle* handle );
123
124 /**
125  * 
126  * @ingroup alihlt_wrapper_interface
127  */
128 void AliHLT_C_DestroyComponent( AliHLTComponentHandle );
129
130 /**
131  * 
132  * @ingroup alihlt_wrapper_interface
133  */
134 int AliHLT_C_ProcessEvent( AliHLTComponentHandle handle, const AliHLTComponent_EventData* evtData, const AliHLTComponent_BlockData* blocks, 
135                            AliHLTComponent_TriggerData* trigData, AliHLTUInt8_t* outputPtr,
136                            AliHLTUInt32_t* size, AliHLTUInt32_t* outputBlockCnt, 
137                            AliHLTComponent_BlockData** outputBlocks,
138                            AliHLTComponent_EventDoneData** edd );
139
140 /**
141  * 
142  * @ingroup alihlt_wrapper_interface
143  */
144 int AliHLT_C_GetOutputDataType( AliHLTComponentHandle, AliHLTComponent_DataType* dataType );
145
146 /**
147  * 
148  * @ingroup alihlt_wrapper_interface
149  */
150 int AliHLT_C_GetOutputSize( AliHLTComponentHandle, unsigned long* constBase, double* inputMultiplier );
151
152 /**
153  * Set options for an AliHLTSystem instance.
154  * The function is introduced for the sake of backward compatibility.
155  * Called from AliHLTReconstructor, which loads the function dynamically.
156  * @return neg. error code if failed                                     <br>
157  *         -EFAULT    type cast failed                                   <br>
158  *         -EINVAL    invalid parameter
159  * @ingroup alihlt_system_interface
160  */
161 int AliHLTSystemSetOptions(AliHLTSystem*, const char*);
162
163 /**
164  * Process the HLTOUT data with the specified system instance.
165  * The function is introduced for the sake of backward compatibility.
166  * Called from AliHLTReconstructor, which loads the function dynamically.
167  * @return neg. error code if failed                                     <br>
168  *         -EFAULT    type cast failed                                   <br>
169  *         -EINVAL    invalid parameter
170  * @ingroup alihlt_system_interface
171  */
172 int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd);
173
174 #ifdef __cplusplus
175 }
176 #endif
177
178 #endif //ALIHLT_EXTERNALINTERFACE_H