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