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 *
10 /// @file AliHLTDataSource.h
11 /// @author Matthias Richter
13 /// @brief Base class declaration for HLT data source components.
14 /// @note The class is used in Offline (AliRoot) context
17 #include "AliHLTComponent.h"
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)
27 * - @ref GetComponentID
28 * - @ref GetOutputDataType
29 * - @ref GetOutputDataSize
32 * @ingroup alihlt_component
34 class AliHLTDataSource : public AliHLTComponent {
36 /** standard constructor */
38 /** standard destructor */
39 virtual ~AliHLTDataSource();
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
48 int DoProcessing( const AliHLTComponentEventData& evtData,
49 const AliHLTComponentBlockData* blocks,
50 AliHLTComponentTriggerData& trigData,
51 AliHLTUInt8_t* outputPtr,
53 AliHLTComponentBlockDataList& outputBlocks,
54 AliHLTComponentEventDoneData*& edd );
56 // Information member functions for registration.
59 * Return @ref AliHLTComponent::kSource type as component type.
60 * @return component type id
62 TComponentType GetComponentType() { return AliHLTComponent::kSource;}
65 * Default implementation for all data sources.
66 * There are no input data types.
68 void GetInputDataTypes( AliHLTComponentDataTypeList& list);
73 * The low-level data processing method for the component.
74 * This is the custom processing method and can be overloaded by
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
84 virtual int GetEvent( const AliHLTComponentEventData& evtData,
85 AliHLTComponentTriggerData& trigData,
86 AliHLTUInt8_t* outputPtr,
88 AliHLTComponentBlockDataList& outputBlocks );
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
98 virtual int GetEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
102 ClassDef(AliHLTDataSource, 3)