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