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