]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTProcessor.h
high-level component interface added
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTProcessor.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTPROCESSOR_H
5 #define ALIHLTPROCESSOR_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7  * See cxx source for full Copyright notice                               */
8
9 /** @file   AliHLTProcessor.h
10     @author Matthias Richter, Timm Steinbeck
11     @date   
12     @brief  Base class declaration for HLT analysis components. */
13
14 #include "AliHLTComponent.h"
15
16 /**
17  * @class AliHLTProcessor
18  * Base class of HLT data analysis components.
19  * The class provides a common interface for the implementation of HLT data
20  * analysis components. The child class must implement the functions:
21  * - @ref DoInit (optional)
22  * - @ref DoDeinit (optional)
23  * - @ref DoEvent
24  * - @ref GetComponentID
25  * - @ref GetInputDataTypes
26  * - @ref GetOutputDataType
27  * - @ref GetOutputDataSize
28  * - @ref Spawn
29  *
30  * @ingroup alihlt_component
31  */
32 class AliHLTProcessor : public AliHLTComponent {
33  public:
34   /** standard constructor */
35   AliHLTProcessor();
36   /** standard destructor */
37   virtual ~AliHLTProcessor();
38
39   /* depricated */
40   int Init( AliHLTComponentEnvironment* environ, void* environParam, int argc, const char** argv );
41   /* depricated */
42   int Deinit();
43
44   /**
45    * Event processing function.
46    * The method is called by the framework to process one event. After 
47    * preparation of data structures. The call is redirected to DoEvent.
48    * @return neg. error code if failed 
49    */
50   int DoProcessing( const AliHLTComponentEventData& evtData,
51                     const AliHLTComponentBlockData* blocks, 
52                     AliHLTComponentTriggerData& trigData,
53                     AliHLTUInt8_t* outputPtr, 
54                     AliHLTUInt32_t& size,
55                     vector<AliHLTComponentBlockData>& outputBlocks,
56                     AliHLTComponentEventDoneData*& edd );
57
58   // Information member functions for registration.
59
60   /**
61    * Return @ref AliHLTComponent::kProcessor type as component type.
62    * @return component type id
63    */
64   TComponentType GetComponentType() { return AliHLTComponent::kProcessor;}
65
66  private:
67   /**
68    * The low-level data processing method for the component.
69    * This is the custom processing method and can be overloaded by 
70    * the component.
71    * @param evtData       event data structure
72    * @param blocks        input data block descriptors
73    * @param trigData      trigger data structure
74    * @param outputPtr     pointer to target buffer
75    * @param size          <i>input</i>: size of target buffer
76    *                      <i>output</i>:size of produced data
77    * @param outputBlocks  list to receive output block descriptors
78    * @return neg. error code if failed
79    */
80   virtual int DoEvent( const AliHLTComponentEventData& evtData,
81                        const AliHLTComponentBlockData* blocks, 
82                        AliHLTComponentTriggerData& trigData,
83                        AliHLTUInt8_t* outputPtr, 
84                        AliHLTUInt32_t& size,
85                        vector<AliHLTComponentBlockData>& outputBlocks );
86
87   /**
88    * The high-level data processing method.
89    * This is the default processing method; the method is called
90    * if no low level @ref DoEvent method is overloaded by the component.
91    * @param evtData       event data structure
92    * @param trigData      trigger data structure
93    * @return neg. error code if failed
94    */
95   virtual int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
96
97   ClassDef(AliHLTProcessor, 1)
98 };
99 #endif