]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataSource.h
Fixing compilation problem. fBlock was not dereferenced in BlockHeader() method.
[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 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
21
22 #include "AliHLTComponent.h"
23
24 /**
25  * @class AliHLTDataSource
26  * Base class of HLT data source components.
27  * The class provides a common interface for the implementation of HLT data
28  * source components. The child class must implement the functions:
29  * - @ref DoInit (optional)
30  * - @ref DoDeinit (optional)
31  * - @ref GetEvent
32  * - @ref GetComponentID
33  * - @ref GetOutputDataType
34  * - @ref GetOutputDataSize
35  * - @ref Spawn
36  *
37  * @ingroup alihlt_component
38  */
39 class AliHLTDataSource : public AliHLTComponent {
40  public:
41   /** standard constructor */
42   AliHLTDataSource();
43   /** standard destructor */
44   virtual ~AliHLTDataSource();
45
46   /**
47    * Event processing function.
48    * The method is called by the framework to process one event. After 
49    * preparation of data structures. The call is redirected to GetEvent.
50    * @return neg. error code if failed
51    */
52   int DoProcessing( const AliHLTComponentEventData& evtData,
53                     const AliHLTComponentBlockData* blocks, 
54                     AliHLTComponentTriggerData& trigData,
55                     AliHLTUInt8_t* outputPtr, 
56                     AliHLTUInt32_t& size,
57                     vector<AliHLTComponentBlockData>& outputBlocks,
58                     AliHLTComponentEventDoneData*& edd );
59
60   // Information member functions for registration.
61
62   /**
63    * Return @ref AliHLTComponent::kSource type as component type.
64    * @return component type id
65    */
66   TComponentType GetComponentType() { return AliHLTComponent::kSource;}
67
68   /**
69    * Default implementation for all data sources.
70    * There are no input data types.
71    */
72   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
73
74  private:
75
76   /**
77    * The low-level data processing method for the component.
78    * This is the custom processing method and can be overloaded by 
79    * the component.
80    * @param evtData       event data structure
81    * @param trigData      trigger data structure
82    * @param outputPtr     pointer to target buffer
83    * @param size          <i>input</i>: size of target buffer
84    *                      <i>output</i>:size of produced data
85    * @param outputBlocks  list to receive output block descriptors
86    * @return neg. error code if failed
87    */
88   virtual int GetEvent( const AliHLTComponentEventData& evtData,
89                 AliHLTComponentTriggerData& trigData,
90                 AliHLTUInt8_t* outputPtr, 
91                 AliHLTUInt32_t& size,
92                 vector<AliHLTComponentBlockData>& outputBlocks );
93
94   /**
95    * The high-level data processing method.
96    * This is the default processing method; the method is called
97    * if no low level @ref GetEvent method is overloaded by the component.
98    * @param evtData       event data structure
99    * @param trigData      trigger data structure
100    * @return neg. error code if failed
101    */
102   virtual int GetEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
103
104   ClassDef(AliHLTDataSource, 1)
105 };
106 #endif