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"
15 class AliHLTComponent;
16 struct AliHLTComponentEnvironment;
17 struct AliHLTComponent_DataType;
19 typedef void* AliHLTLibHandle;
21 class AliHLTComponentHandler {
23 AliHLTComponentHandler();
24 virtual ~AliHLTComponentHandler();
26 void SetEnvironment(AliHLTComponentEnvironment* pEnv);
28 // Load a component shared library
29 int LoadLibrary( const char* libraryPath );
30 int UnloadLibrary( const char* libraryPath );
32 /* Component registration funcions
33 * registration is done by passing a sample object of the component to the handler
34 * the object has to be valid during the whole runtime and should thus be a global object
36 // Schedule a component for registration, full registration will be done
37 // after successfull loading of the shared library
38 int ScheduleRegister(AliHLTComponent* pSample );
40 // Register a component with the list of available components
41 int RegisterComponent(AliHLTComponent* pSample );
42 int DeregisterComponent( const char* componentID );
44 // Find the ID of a component with the given output data
45 // prevType can be used to iterate if there are multiple components with the same output data type.
46 const char* FindComponentType( AliHLTComponent_DataType, const char* prevType = NULL ) { return NULL;}
48 // Create a component of the given name
49 int CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponent*& component );
50 int CreateComponent( const char* componentType, void* environ_param, AliHLTComponent*& component ) {
51 return CreateComponent( componentType, environ_param, 0, NULL, component );
54 /* print registered components to stdout
58 int Logging( AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* message, ... );
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)