3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
8 * Artur Szostak <artursz@iafrica.com> *
9 * for The ALICE Off-line Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // pure C interface to the AliRoot HLT component handler //
24 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliHLT_C_Component_WrapperInterface.h"
31 #include "AliHLTComponentHandler.h"
32 #include "AliHLTComponent.h"
35 static AliHLTComponentHandler *gComponentHandler_C = NULL;
38 int AliHLT_C_Component_InitSystem( AliHLTComponentEnvironment* environ )
40 if ( gComponentHandler_C )
44 gComponentHandler_C = new AliHLTComponentHandler();
45 if ( !gComponentHandler_C )
47 gComponentHandler_C->SetEnvironment( environ );
51 int AliHLT_C_Component_DeinitSystem()
53 if ( gComponentHandler_C )
55 delete gComponentHandler_C;
56 gComponentHandler_C = NULL;
61 int AliHLT_C_Component_LoadLibrary( const char* libraryPath )
63 if ( !gComponentHandler_C )
65 return gComponentHandler_C->LoadLibrary( libraryPath );
68 int AliHLT_C_Component_UnloadLibrary( const char* libraryPath )
70 if ( !gComponentHandler_C )
72 return gComponentHandler_C->UnloadLibrary( libraryPath );
75 int AliHLT_C_CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponentHandle* handle )
77 if ( !gComponentHandler_C )
79 AliHLTComponent* comp;
80 int ret = gComponentHandler_C->CreateComponent( componentType, environ_param, argc, argv, comp );
81 *handle = reinterpret_cast<AliHLTComponentHandle>( comp );
85 void AliHLT_C_DestroyComponent( AliHLTComponentHandle handle )
89 delete reinterpret_cast<AliHLTComponent*>( handle );
92 int AliHLT_C_ProcessEvent( AliHLTComponentHandle handle, AliHLTComponent_EventData evtData, AliHLTComponent_BlockData* blocks,
93 AliHLTComponent_TriggerData trigData, AliHLTUInt8_t* outputPtr,
94 AliHLTUInt32_t* size, AliHLTUInt32_t* outputBlockCnt,
95 AliHLTComponent_BlockData** outputBlocks,
96 AliHLTComponent_EventDoneData** edd )
100 AliHLTComponent* comp = reinterpret_cast<AliHLTComponent*>( handle );
101 return comp->ProcessEvent( evtData, blocks, trigData, outputPtr, size, outputBlockCnt, outputBlocks, edd );