3 //**************************************************************************
4 //* This file is property of and copyright by the *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 /// @file AliHLTDataSource.cxx
20 /// @author Matthias Richter
22 /// @brief Base class implementation for HLT data source components.
25 #include "AliHLTDataSource.h"
27 /** ROOT macro for the implementation of ROOT specific class methods */
28 ClassImp(AliHLTDataSource)
30 AliHLTDataSource::AliHLTDataSource()
32 // Base class of HLT data source components.
33 // The class provides a common interface for the implementation of HLT data
35 // Source components do not consume any input consequently the processing
36 // function is called 'GetEvent'.
39 AliHLTDataSource::~AliHLTDataSource()
44 void AliHLTDataSource::GetInputDataTypes( AliHLTComponentDataTypeList& list)
46 // default method as source components do not consume input
47 list.clear(); // there are no input data types
51 int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
52 const AliHLTComponentBlockData* blocks,
53 AliHLTComponentTriggerData& trigData,
54 AliHLTUInt8_t* outputPtr,
56 AliHLTComponentBlockDataList& outputBlocks,
57 AliHLTComponentEventDoneData*& edd )
59 // Processing method, calls child's GetEvent
61 if (evtData.fBlockCnt > 0) {
63 for (unsigned int block=0; block<evtData.fBlockCnt; block++) {
64 if (blocks[block].fDataType==kAliHLTDataTypeSOR ||
65 blocks[block].fDataType==kAliHLTDataTypeEOR ||
66 blocks[block].fDataType==kAliHLTDataTypeEvent ||
67 blocks[block].fDataType==kAliHLTDataTypeRunType ||
68 blocks[block].fDataType==kAliHLTDataTypeComponentStatistics ||
69 blocks[block].fDataType==kAliHLTDataTypeComponentTable ||
70 blocks[block].fDataType==kAliHLTDataTypeECSParam) {
76 static int warningCount=0;
77 if (unknown>=0 && warningCount++<5) {
78 HLTWarning("Data source component skips input data blocks: first unknown block %s",
79 DataType2Text(blocks[unknown].fDataType).c_str());
82 iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks);
83 HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult);
88 int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
89 AliHLTComponentTriggerData& trigData,
90 AliHLTUInt8_t* /*outputPtr*/,
92 AliHLTComponentBlockDataList& /*outputBlocks*/ )
94 // we just forward to the high level method, all other parameters already
95 // have been stored internally
97 return GetEvent(evtData, trigData);
100 int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
102 // default method: one of GetEvent methods must be implemented
103 HLTFatal("no processing method implemented");