]>
Commit | Line | Data |
---|---|---|
a655eae3 | 1 | //-*- Mode: C++ -*- |
c515df4c | 2 | // $Id$ |
421b7534 | 3 | |
4 | #ifndef ALIHLTDATASOURCE_H | |
5 | #define ALIHLTDATASOURCE_H | |
c515df4c | 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 * | |
421b7534 | 9 | |
c515df4c | 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 | /// | |
30338a30 | 16 | |
421b7534 | 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: | |
b22e91eb | 24 | * - @ref DoInit (optional) |
25 | * - @ref DoDeinit (optional) | |
26 | * - @ref GetEvent | |
27 | * - @ref GetComponentID | |
b22e91eb | 28 | * - @ref GetOutputDataType |
29 | * - @ref GetOutputDataSize | |
30 | * - @ref Spawn | |
421b7534 | 31 | * |
b22e91eb | 32 | * @ingroup alihlt_component |
421b7534 | 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. | |
b6800be0 | 45 | * @return neg. error code if failed <br> |
46 | * -ENOSPC output buffer too small | |
421b7534 | 47 | */ |
3cde846d | 48 | int DoProcessing( const AliHLTComponentEventData& evtData, |
8ede8717 | 49 | const AliHLTComponentBlockData* blocks, |
50 | AliHLTComponentTriggerData& trigData, | |
421b7534 | 51 | AliHLTUInt8_t* outputPtr, |
52 | AliHLTUInt32_t& size, | |
c515df4c | 53 | AliHLTComponentBlockDataList& outputBlocks, |
8ede8717 | 54 | AliHLTComponentEventDoneData*& edd ); |
421b7534 | 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 | ||
2d7ff710 | 64 | /** |
65 | * Default implementation for all data sources. | |
66 | * There are no input data types. | |
67 | */ | |
c515df4c | 68 | void GetInputDataTypes( AliHLTComponentDataTypeList& list); |
2d7ff710 | 69 | |
457ec821 | 70 | protected: |
a655eae3 | 71 | |
421b7534 | 72 | /** |
a655eae3 | 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. | |
9bb806cd | 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 | |
421b7534 | 80 | * <i>output</i>:size of produced data |
9bb806cd | 81 | * @param [in] outputBlocks list to receive output block descriptors |
a655eae3 | 82 | * @return neg. error code if failed |
421b7534 | 83 | */ |
8ede8717 | 84 | virtual int GetEvent( const AliHLTComponentEventData& evtData, |
a655eae3 | 85 | AliHLTComponentTriggerData& trigData, |
86 | AliHLTUInt8_t* outputPtr, | |
87 | AliHLTUInt32_t& size, | |
c515df4c | 88 | AliHLTComponentBlockDataList& outputBlocks ); |
a655eae3 | 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); | |
421b7534 | 99 | |
457ec821 | 100 | private: |
457ec821 | 101 | |
48abe484 | 102 | ClassDef(AliHLTDataSource, 3) |
421b7534 | 103 | }; |
104 | #endif |