421b7534 |
1 | // $Id$ |
2 | |
3 | /************************************************************************** |
9be2600f |
4 | * This file is property of and copyright by the ALICE HLT Project * |
5 | * ALICE Experiment at CERN, All rights reserved. * |
421b7534 |
6 | * * |
9be2600f |
7 | * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> * |
8 | * for The ALICE HLT Project. * |
421b7534 |
9 | * * |
10 | * Permission to use, copy, modify and distribute this software and its * |
11 | * documentation strictly for non-commercial purposes is hereby granted * |
12 | * without fee, provided that the above copyright notice appears in all * |
13 | * copies and that both the copyright notice and this permission notice * |
14 | * appear in the supporting documentation. The authors make no claims * |
15 | * about the suitability of this software for any purpose. It is * |
16 | * provided "as is" without express or implied warranty. * |
17 | **************************************************************************/ |
18 | |
19 | /** @file AliHLTDataSource.cxx |
20 | @author Matthias Richter |
21 | @date |
22 | @brief Base class implementation for HLT data source components. */ |
23 | |
24 | #if __GNUC__>= 3 |
25 | using namespace std; |
26 | #endif |
27 | |
28 | #include "AliHLTDataSource.h" |
29 | |
b22e91eb |
30 | /** ROOT macro for the implementation of ROOT specific class methods */ |
421b7534 |
31 | ClassImp(AliHLTDataSource) |
32 | |
33 | AliHLTDataSource::AliHLTDataSource() |
34 | { |
70ed7d01 |
35 | // see header file for class documentation |
36 | // or |
37 | // refer to README to build package |
38 | // or |
39 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt |
421b7534 |
40 | } |
41 | |
42 | AliHLTDataSource::~AliHLTDataSource() |
43 | { |
70ed7d01 |
44 | // see header file for class documentation |
421b7534 |
45 | } |
46 | |
2d7ff710 |
47 | void AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list) |
48 | { |
70ed7d01 |
49 | // see header file for class documentation |
2d7ff710 |
50 | list.clear(); // there are no input data types |
51 | } |
52 | |
53 | |
3cde846d |
54 | int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData, |
48abe484 |
55 | const AliHLTComponentBlockData* blocks, |
8ede8717 |
56 | AliHLTComponentTriggerData& trigData, |
421b7534 |
57 | AliHLTUInt8_t* outputPtr, |
58 | AliHLTUInt32_t& size, |
a655eae3 |
59 | vector<AliHLTComponentBlockData>& outputBlocks, |
8ede8717 |
60 | AliHLTComponentEventDoneData*& edd ) |
421b7534 |
61 | { |
70ed7d01 |
62 | // see header file for class documentation |
421b7534 |
63 | int iResult=0; |
421b7534 |
64 | if (evtData.fBlockCnt > 0) { |
48abe484 |
65 | int unknown=-1; |
66 | for (unsigned int block; block<evtData.fBlockCnt; block++) { |
67 | if (blocks[block].fDataType==kAliHLTDataTypeSOR || |
42a6dea2 |
68 | blocks[block].fDataType==kAliHLTDataTypeEOR || |
69 | blocks[block].fDataType==kAliHLTDataTypeEvent) { |
48abe484 |
70 | continue; |
71 | } |
72 | unknown=block; |
73 | break; |
74 | } |
75 | if (unknown>=0) { |
76 | HLTWarning("Data source component skips input data blocks: first unknown block %s", |
77 | DataType2Text(blocks[unknown].fDataType).c_str()); |
457ec821 |
78 | } |
79 | } |
48abe484 |
80 | iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks); |
81 | HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult); |
421b7534 |
82 | edd = NULL; |
83 | return iResult; |
84 | } |
a655eae3 |
85 | |
86 | int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData, |
298ef463 |
87 | AliHLTComponentTriggerData& trigData, |
88 | AliHLTUInt8_t* /*outputPtr*/, |
53f79557 |
89 | AliHLTUInt32_t& size, |
298ef463 |
90 | vector<AliHLTComponentBlockData>& /*outputBlocks*/ ) |
a655eae3 |
91 | { |
92 | // we just forward to the high level method, all other parameters already |
93 | // have been stored internally |
53f79557 |
94 | size=0; |
a655eae3 |
95 | return GetEvent(evtData, trigData); |
96 | } |
97 | |
298ef463 |
98 | int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/) |
a655eae3 |
99 | { |
100 | HLTFatal("no processing method implemented"); |
101 | return -ENOSYS; |
102 | } |