]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataSource.h
- changes according to coding conventions and documentation
[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 GetOutputDataType
27  * - @ref GetOutputDataSize
28  * - @ref Spawn
29  *
30  * @ingroup alihlt_component
31  */
32 class AliHLTDataSource : public AliHLTComponent {
33  public:
34   /** standard constructor */
35   AliHLTDataSource();
36   /** standard destructor */
37   virtual ~AliHLTDataSource();
38
39   /**
40    * Event processing function.
41    * The method is called by the framework to process one event. After 
42    * preparation of data structures. The call is redirected to GetEvent.
43    * @return neg. error code if failed
44    */
45   int ProcessEvent( const AliHLTComponentEventData& evtData,
46                     const AliHLTComponentBlockData* blocks, 
47                     AliHLTComponentTriggerData& trigData,
48                     AliHLTUInt8_t* outputPtr, 
49                     AliHLTUInt32_t& size,
50                     AliHLTUInt32_t& outputBlockCnt, 
51                     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 AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list);
67
68  private:
69   /**
70    * Data processing method for the component.
71    * @param evtData       event data structure
72    * @param trigData      trigger data structure
73    * @param outputPtr     pointer to target buffer
74    * @param size          <i>input</i>: size of target buffer
75    *                      <i>output</i>:size of produced data
76    * @param outputBlocks  list to receive output block descriptors
77    * @return
78    */
79   virtual int GetEvent( const AliHLTComponentEventData& evtData,
80                         AliHLTComponentTriggerData& trigData,
81                         AliHLTUInt8_t* outputPtr, 
82                         AliHLTUInt32_t& size,
83                         vector<AliHLTComponentBlockData>& outputBlocks ) = 0;
84
85   ClassDef(AliHLTDataSource, 0)
86 };
87 #endif