]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataSource.h
869183edb2facbb9330cfa4b037488d8ef86cbaf
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataSource.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTDATASOURCE_H
4 #define ALIHLTDATASOURCE_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTDataSource.h
9     @author Matthias Richter
10     @date   
11     @brief  Base class declaration for HLT data source components.
12     @note   The class is used in Offline (AliRoot) context
13 */
14
15 #include "AliHLTComponent.h"
16
17 /**
18  * @class AliHLTDataSource
19  * Base class of HLT data source components.
20  * The class provides a common interface for the implementation of HLT data
21  * source components. The child class must implement the functions:
22  * - @ref DoInit (optional)
23  * - @ref DoDeinit (optional)
24  * - @ref GetEvent
25  * - @ref GetComponentID
26  * - @ref GetInputDataTypes
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 ProcessEvent( const AliHLTComponentEventData& evtData,
47                     const AliHLTComponentBlockData* blocks, 
48                     AliHLTComponentTriggerData& trigData,
49                     AliHLTUInt8_t* outputPtr, 
50                     AliHLTUInt32_t& size,
51                     AliHLTUInt32_t& outputBlockCnt, 
52                     AliHLTComponentBlockData*& outputBlocks,
53                     AliHLTComponentEventDoneData*& edd );
54
55   // Information member functions for registration.
56
57   /**
58    * Return @ref AliHLTComponent::kSource type as component type.
59    * @return component type id
60    */
61   TComponentType GetComponentType() { return AliHLTComponent::kSource;}
62
63  private:
64   /**
65    * Data processing method for the component.
66    * @param evtData       event data structure
67    * @param trigData      trigger data structure
68    * @param outputPtr     pointer to target buffer
69    * @param size          <i>input</i>: size of target buffer
70    *                      <i>output</i>:size of produced data
71    * @param outputBlocks  list to receive output block descriptors
72    * @return
73    */
74   virtual int GetEvent( const AliHLTComponentEventData& evtData,
75                         AliHLTComponentTriggerData& trigData,
76                         AliHLTUInt8_t* outputPtr, 
77                         AliHLTUInt32_t& size,
78                         vector<AliHLTComponentBlockData>& outputBlocks ) = 0;
79
80   ClassDef(AliHLTDataSource, 0)
81 };
82 #endif