3 #ifndef ALIHLTCOMPONENTHANDLER_H
4 #define ALIHLTCOMPONENTHANDLER_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
8 /* AliHltcomponentHandler
9 handler of HLT processing components
13 #include "AliHLTDataTypes.h"
14 #include "AliHLTLogging.h"
16 class AliHLTComponent;
17 struct AliHLTComponentEnvironment;
18 struct AliHLTComponent_DataType;
20 typedef void* AliHLTLibHandle;
22 class AliHLTComponentHandler : public AliHLTLogging {
24 AliHLTComponentHandler();
25 virtual ~AliHLTComponentHandler();
27 void SetEnvironment(AliHLTComponentEnvironment* pEnv);
29 // Load a component shared library
30 int LoadLibrary( const char* libraryPath );
31 int UnloadLibrary( const char* libraryPath );
33 /* Component registration funcions
34 * registration is done by passing a sample object of the component to the handler
35 * the object has to be valid during the whole runtime and should thus be a global object
37 // Schedule a component for registration, full registration will be done
38 // after successfull loading of the shared library
39 int ScheduleRegister(AliHLTComponent* pSample );
41 // Register a component with the list of available components
42 int RegisterComponent(AliHLTComponent* pSample );
43 int DeregisterComponent( const char* componentID );
45 // Find the ID of a component with the given output data
46 // prevType can be used to iterate if there are multiple components with the same output data type.
47 const char* FindComponentType( AliHLTComponent_DataType, const char* prevType = NULL ) { return NULL;}
49 // Create a component of the given name
50 int CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponent*& component );
51 int CreateComponent( const char* componentType, void* environ_param, AliHLTComponent*& component ) {
52 return CreateComponent( componentType, environ_param, 0, NULL, component );
55 /* print registered components to stdout
64 int FindComponentIndex(const char* componentID);
69 AliHLTComponent* FindComponent(const char* componentID);
71 int InsertComponent(AliHLTComponent* pSample);
73 // close all libraries
74 int UnloadLibraries();
76 /* list of registered components
78 vector<AliHLTComponent*> fComponentList;
80 /* list of scheduled components
82 vector<AliHLTComponent*> fScheduleList;
86 vector<AliHLTLibHandle> fLibraryList;
88 AliHLTComponentEnvironment fEnvironment;
90 ClassDef(AliHLTComponentHandler, 0)