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 */
8 /** @file AliHLTExternalInterface.h
9 @author Matthias Richter, Timm Steinbeck
11 @brief Pure and dynamic C interface to the AliRoot HLT component handler
12 @note Utilized by the HLT Online (PubSub) framework
15 #include <AliHLTDataTypes.h>
25 * @ingroup alihlt_wrapper_interface
27 typedef void* AliHLTComponentHandle;
31 * @ingroup alihlt_wrapper_interface
33 const AliHLTComponentHandle kEmptyHLTComponentHandle = 0;
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
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;
50 typedef int (*AliHLTExtFctInitSystem)( AliHLTComponentEnvironment* );
52 typedef int (*AliHLTExtFctDeinitSystem)();
54 typedef int (*AliHLTExtFctLoadLibrary)( const char* );
56 typedef int (*AliHLTExtFctUnloadLibrary)( const char* );
58 typedef int (*AliHLTExtFctCreateComponent)( const char*, void*, int, const char**, AliHLTComponentHandle* );
60 typedef void (*AliHLTExtFctDestroyComponent)( AliHLTComponentHandle );
62 typedef int (*AliHLTExtFctProcessEvent)( AliHLTComponentHandle, const AliHLTComponentEventData*, const AliHLTComponentBlockData*,
63 AliHLTComponentTriggerData*, AliHLTUInt8_t*,
64 AliHLTUInt32_t*, AliHLTUInt32_t*,
65 AliHLTComponentBlockData**,
66 AliHLTComponentEventDoneData** );
68 typedef int (*AliHLTExtFctGetOutputDataType)( AliHLTComponentHandle, AliHLTComponentDataType* );
70 typedef int (*AliHLTExtFctGetOutputSize)( AliHLTComponentHandle, unsigned long*, double* );
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;
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"
96 * @ingroup alihlt_wrapper_interface
98 int AliHLT_C_Component_InitSystem( AliHLTComponentEnvironment* environ );
102 * @ingroup alihlt_wrapper_interface
104 int AliHLT_C_Component_DeinitSystem();
108 * @ingroup alihlt_wrapper_interface
110 int AliHLT_C_Component_LoadLibrary( const char* libraryPath );
114 * @ingroup alihlt_wrapper_interface
116 int AliHLT_C_Component_UnloadLibrary( const char* libraryPath );
120 * @ingroup alihlt_wrapper_interface
122 int AliHLT_C_CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponentHandle* handle );
126 * @ingroup alihlt_wrapper_interface
128 void AliHLT_C_DestroyComponent( AliHLTComponentHandle );
132 * @ingroup alihlt_wrapper_interface
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 );
142 * @ingroup alihlt_wrapper_interface
144 int AliHLT_C_GetOutputDataType( AliHLTComponentHandle, AliHLTComponent_DataType* dataType );
148 * @ingroup alihlt_wrapper_interface
150 int AliHLT_C_GetOutputSize( AliHLTComponentHandle, unsigned long* constBase, double* inputMultiplier );
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
161 int AliHLTSystemSetOptions(AliHLTSystem*, const char*);
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
172 int AliHLTSystemProcessHLTOUT(AliHLTSystem* pInstance, AliHLTOUT* pHLTOUT, AliESDEvent* esd);
178 #endif //ALIHLT_EXTERNALINTERFACE_H