]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - HLT/BASE/AliHLTDataSource.cxx
Ignore
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataSource.cxx
... / ...
CommitLineData
1// $Id$
2
3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
6 * *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
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
25using namespace std;
26#endif
27
28#include "AliHLTDataSource.h"
29
30/** ROOT macro for the implementation of ROOT specific class methods */
31ClassImp(AliHLTDataSource)
32
33AliHLTDataSource::AliHLTDataSource()
34{
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
40}
41
42AliHLTDataSource::~AliHLTDataSource()
43{
44 // see header file for class documentation
45}
46
47void AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
48{
49 // see header file for class documentation
50 list.clear(); // there are no input data types
51}
52
53
54int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
55 const AliHLTComponentBlockData* blocks,
56 AliHLTComponentTriggerData& trigData,
57 AliHLTUInt8_t* outputPtr,
58 AliHLTUInt32_t& size,
59 vector<AliHLTComponentBlockData>& outputBlocks,
60 AliHLTComponentEventDoneData*& edd )
61{
62 // see header file for class documentation
63 int iResult=0;
64 if (evtData.fBlockCnt > 0) {
65 int unknown=-1;
66 for (unsigned int block=0; block<evtData.fBlockCnt; block++) {
67 if (blocks[block].fDataType==kAliHLTDataTypeSOR ||
68 blocks[block].fDataType==kAliHLTDataTypeEOR ||
69 blocks[block].fDataType==kAliHLTDataTypeEvent ||
70 blocks[block].fDataType==kAliHLTDataTypeRunType ||
71 blocks[block].fDataType==kAliHLTDataTypeComponentStatistics ||
72 blocks[block].fDataType==kAliHLTDataTypeComponentTable ||
73 blocks[block].fDataType==kAliHLTDataTypeECSParam) {
74 continue;
75 }
76 unknown=block;
77 break;
78 }
79 static int warningCount=0;
80 if (unknown>=0 && warningCount++<5) {
81 HLTWarning("Data source component skips input data blocks: first unknown block %s",
82 DataType2Text(blocks[unknown].fDataType).c_str());
83 }
84 }
85 iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks);
86 HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult);
87 edd = NULL;
88 return iResult;
89}
90
91int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
92 AliHLTComponentTriggerData& trigData,
93 AliHLTUInt8_t* /*outputPtr*/,
94 AliHLTUInt32_t& size,
95 vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
96{
97 // we just forward to the high level method, all other parameters already
98 // have been stored internally
99 size=0;
100 return GetEvent(evtData, trigData);
101}
102
103int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
104{
105 HLTFatal("no processing method implemented");
106 return -ENOSYS;
107}