]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/SampleLib/AliHLTAgentSample.h
coding conventions
[u/mrichter/AliRoot.git] / HLT / SampleLib / AliHLTAgentSample.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTAGENTSAMPLE_H
4 #define ALIHLTAGENTSAMPLE_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTAgentSample.h
9     @author Matthias Richter
10     @date   
11     @brief  Agent of the libAliHLTSample library
12 */
13
14 #include "AliHLTModuleAgent.h"
15
16 /**
17  * @class AliHLTAgentSample
18  * This is the agent for the AliHLTSample library.<br>
19  * The AliHLTSample library illustrates usage of the HLT framework. The
20  * agent provides information on the features of the sample components
21  * and the configuration which should be run during AliRoot reconstruction.
22  *
23  * The sample agent implements all interface function provided by @ref
24  * AliHLTModuleAgent :
25  * - @ref CreateConfigurations <br>
26  *   The method gets an instance of the AliHLTConfigurationHanler to add
27  *   configurations, e.g. 
28  *   <pre>
29  *   handler->CreateConfiguration("my-puplisher"  , "FilePublisher", NULL , "data.bin");
30  *   ...
31  *   handler->CreateConfiguration("my-analysis-chain"  , "FileWriter", "my-processor" , "my arguments");
32  *   </pre>
33  * - @ref GetReconstructionChains <br>
34  *   returns a string of blank separated configurations to be run during
35  *   local event reconstruction.
36  *   <pre>
37  *   return "my-data-sink my-analysis-chain";
38  *   </pre>
39  * - @ref GetRequiredComponentLibraries <br>
40  *   returns a string of blank separated libraries which have to be loaded
41  *   in addition in order to load all required components. <br>
42  *   @note Not the right place for library dependencies.
43  *   <pre>
44  *   return "libAliHLTUtil.so";
45  *   </pre>
46  * - not implemented are the in iterface methods
47  *   - @ref AliHLTModuleAgent::RegisterComponents
48  *
49  * In order to hook the sample library up to the HLT system on global object
50  * @ref gAliHLTAgentSample of the agent is defined in the source code.
51  * 
52  * @ingroup alihlt_system
53  */
54 class AliHLTAgentSample : public AliHLTModuleAgent {
55  public:
56   /**
57    * standard constructor. The agent is automatically registered in the
58    * global agent manager
59    */
60   AliHLTAgentSample();
61   /** destructor */
62   virtual ~AliHLTAgentSample();
63
64   /**
65    * Register all configurations belonging to the sample library with the
66    * AliHLTConfigurationHandler. The agent can adapt the configurations
67    * to be registered to the current AliRoot setup by checking the
68    * runloader.
69    * @param handler   [in] the configuration handler
70    * @param rawReader [in] AliRoot RawReader instance 
71    * @param runloader [in] AliRoot runloader
72    * @return neg. error code if failed
73    */
74   int CreateConfigurations(AliHLTConfigurationHandler* handler,
75                            AliRawReader* rawReader=NULL,
76                            AliRunLoader* runloader=NULL) const;
77
78   /**
79    * Get the top configurations for local event reconstruction.
80    * A top configuration describes a processing chain. It can simply be
81    * described by the last configuration(s) in the chain. 
82    * The agent can adapt the configurations to be registered to the current
83    * AliRoot setup by checking the runloader.
84    * @param rawReader [in] AliRoot RawReader instance 
85    * @param runloader [in] AliRoot runloader
86    * @return string containing the top configurations separated by blanks
87    */
88   const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
89                                       AliRunLoader* runloader=NULL) const;
90
91   /**
92    * Component libraries which the configurations of this agent depend on.
93    * @return list of component libraries as a blank-separated string.
94    */
95   const char* GetRequiredComponentLibraries() const;
96
97  protected:
98
99  private:
100   /** file name of the generated test data*/
101   static const char* fgkAliHLTAgentSampleData;                      //!transient
102
103   /** file name of the output file */
104   static const char* fgkAliHLTAgentSampleOut;                       //!transient
105
106   /** ROOT specific member definition */
107   ClassDef(AliHLTAgentSample, 1);
108 };
109
110 #endif