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 /** @file AliHLTComponentHandler.h
9 @author Matthias Richter, Timm Steinbeck
11 @brief Global handling of HLT processing components
12 @note The handler is part of the interface and both used in the
13 Online (PubSub) and Offline (AliRoot) context.
18 #include "AliHLTDataTypes.h"
19 #include "AliHLTLogging.h"
21 class AliHLTComponent;
22 struct AliHLTComponentEnvironment;
23 struct AliHLTComponent_DataType;
25 typedef void* AliHLTLibHandle;
27 class AliHLTComponentHandler : public AliHLTLogging {
29 AliHLTComponentHandler();
30 virtual ~AliHLTComponentHandler();
32 void SetEnvironment(AliHLTComponentEnvironment* pEnv);
34 // Load a component shared library
35 int LoadLibrary( const char* libraryPath );
36 int UnloadLibrary( const char* libraryPath );
38 /* Component registration funcions
39 * registration is done by passing a sample object of the component to the handler
40 * the object has to be valid during the whole runtime and should thus be a global object
42 // Schedule a component for registration, full registration will be done
43 // after successfull loading of the shared library
44 int ScheduleRegister(AliHLTComponent* pSample );
46 // Register a component with the list of available components
47 int RegisterComponent(AliHLTComponent* pSample );
48 int DeregisterComponent( const char* componentID );
50 // Find the ID of a component with the given output data
51 // prevType can be used to iterate if there are multiple components with the same output data type.
52 const char* FindComponentType( AliHLTComponent_DataType, const char* prevType = NULL ) { return NULL;}
54 // Create a component of the given name
55 int CreateComponent( const char* componentType, void* environ_param, int argc, const char** argv, AliHLTComponent*& component );
56 int CreateComponent( const char* componentType, void* environ_param, AliHLTComponent*& component ) {
57 return CreateComponent( componentType, environ_param, 0, NULL, component );
60 /* print registered components to stdout
69 int FindComponentIndex(const char* componentID);
74 AliHLTComponent* FindComponent(const char* componentID);
76 int InsertComponent(AliHLTComponent* pSample);
78 // close all libraries
79 int UnloadLibraries();
81 /* list of registered components
83 vector<AliHLTComponent*> fComponentList;
85 /* list of scheduled components
87 vector<AliHLTComponent*> fScheduleList;
91 vector<AliHLTLibHandle> fLibraryList;
93 AliHLTComponentEnvironment fEnvironment;
95 ClassDef(AliHLTComponentHandler, 0)