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 */
9 /** @file AliHLTDataSource.h
10 @author Matthias Richter
12 @brief Base class declaration for HLT data source components.
13 @note The class is used in Offline (AliRoot) context
16 #include "AliHLTComponent.h"
19 * @class AliHLTDataSource
20 * Base class of HLT data source components.
21 * The class provides a common interface for the implementation of HLT data
22 * source components. The child class must implement the functions:
23 * - @ref DoInit (optional)
24 * - @ref DoDeinit (optional)
26 * - @ref GetComponentID
27 * - @ref GetOutputDataType
28 * - @ref GetOutputDataSize
31 * @ingroup alihlt_component
33 class AliHLTDataSource : public AliHLTComponent {
35 /** standard constructor */
37 /** standard destructor */
38 virtual ~AliHLTDataSource();
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
46 int DoProcessing( const AliHLTComponentEventData& evtData,
47 const AliHLTComponentBlockData* blocks,
48 AliHLTComponentTriggerData& trigData,
49 AliHLTUInt8_t* outputPtr,
51 vector<AliHLTComponentBlockData>& outputBlocks,
52 AliHLTComponentEventDoneData*& edd );
54 // Information member functions for registration.
57 * Return @ref AliHLTComponent::kSource type as component type.
58 * @return component type id
60 TComponentType GetComponentType() { return AliHLTComponent::kSource;}
63 * Default implementation for all data sources.
64 * There are no input data types.
66 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
71 * The low-level data processing method for the component.
72 * This is the custom processing method and can be overloaded by
74 * @param evtData event data structure
75 * @param trigData trigger data structure
76 * @param outputPtr pointer to target buffer
77 * @param size <i>input</i>: size of target buffer
78 * <i>output</i>:size of produced data
79 * @param outputBlocks list to receive output block descriptors
80 * @return neg. error code if failed
82 virtual int GetEvent( const AliHLTComponentEventData& evtData,
83 AliHLTComponentTriggerData& trigData,
84 AliHLTUInt8_t* outputPtr,
86 vector<AliHLTComponentBlockData>& outputBlocks );
89 * The high-level data processing method.
90 * This is the default processing method; the method is called
91 * if no low level @ref GetEvent method is overloaded by the component.
92 * @param evtData event data structure
93 * @param trigData trigger data structure
94 * @return neg. error code if failed
96 virtual int GetEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
98 ClassDef(AliHLTDataSource, 1)