X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FBASE%2FAliHLTDataSource.cxx;h=bca288bfc4575e90dd3c0552147e2b850daa5fa6;hb=0728a4f6d9ae5fd7c14a3495e61caef65fd999c3;hp=80fdab33f647a6d183cc0272fc2a6bc1f6238d67;hpb=2d7ff71057caa5cb41ef394864420f2934cf9c0d;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/BASE/AliHLTDataSource.cxx b/HLT/BASE/AliHLTDataSource.cxx index 80fdab33f64..bca288bfc45 100644 --- a/HLT/BASE/AliHLTDataSource.cxx +++ b/HLT/BASE/AliHLTDataSource.cxx @@ -1,10 +1,11 @@ // $Id$ /************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * This file is property of and copyright by the ALICE HLT Project * + * ALICE Experiment at CERN, All rights reserved. * * * - * Authors: Matthias Richter * - * for The ALICE Off-line Project. * + * Primary Authors: Matthias Richter * + * for The ALICE HLT Project. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * @@ -31,39 +32,96 @@ ClassImp(AliHLTDataSource) AliHLTDataSource::AliHLTDataSource() { + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt } +void* AliHLTDataSource::fgpSpecialEvent=NULL; +int AliHLTDataSource::fgSpecialEventSize=0; +AliHLTComponentDataType AliHLTDataSource::fgSpecialEventDataType=kAliHLTVoidDataType; +AliHLTUInt32_t AliHLTDataSource::fgSpecialEventSpecification=kAliHLTVoidDataSpec; + AliHLTDataSource::~AliHLTDataSource() { + // see header file for class documentation } void AliHLTDataSource::GetInputDataTypes( vector& list) { + // see header file for class documentation list.clear(); // there are no input data types } -int AliHLTDataSource::ProcessEvent( const AliHLTComponentEventData& evtData, - const AliHLTComponentBlockData* blocks, +int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData, + const AliHLTComponentBlockData* /*blocks*/, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, - AliHLTUInt32_t& outputBlockCnt, - AliHLTComponentBlockData*& outputBlocks, + vector& outputBlocks, AliHLTComponentEventDoneData*& edd ) { + // see header file for class documentation int iResult=0; - if (blocks) { - // this is currently just to get rid of the warning "unused parameter" - } - vector blockData; if (evtData.fBlockCnt > 0) { - HLTWarning("Data source component skips imput data blocks"); + HLTWarning("Data source component skips input data blocks"); } - iResult=GetEvent(evtData, trigData, outputPtr, size, blockData); - if (iResult>=0) { - iResult=MakeOutputDataBlockList(blockData, &outputBlockCnt, &outputBlocks); + if (fgpSpecialEvent==NULL || fgSpecialEventSize==0) { + // normal event publishing + iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks); + HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult); + } else { + // publish special event + if (size>=(unsigned)fgSpecialEventSize) { + memcpy(outputPtr, fgpSpecialEvent, fgSpecialEventSize); + AliHLTComponentBlockData bd; + FillBlockData(bd); + bd.fOffset=0; + bd.fSize=fgSpecialEventSize; + bd.fDataType=fgSpecialEventDataType; + bd.fSpecification=fgSpecialEventSpecification; + outputBlocks.push_back(bd); + size=bd.fSize; + } else { + iResult=-ENOSPC; + } } edd = NULL; return iResult; } + +int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData, + AliHLTComponentTriggerData& trigData, + AliHLTUInt8_t* /*outputPtr*/, + AliHLTUInt32_t& /*size*/, + vector& /*outputBlocks*/ ) +{ + // we just forward to the high level method, all other parameters already + // have been stored internally + return GetEvent(evtData, trigData); +} + +int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/) +{ + HLTFatal("no processing method implemented"); + return -ENOSYS; +} + +AliHLTDataSource::AliSpecialEventGuard::AliSpecialEventGuard(AliHLTRunDesc* pDesc, AliHLTComponentDataType dt, AliHLTUInt32_t spec) +{ + AliHLTDataSource::fgpSpecialEvent=pDesc; + AliHLTDataSource::fgSpecialEventSize=sizeof(AliHLTRunDesc); + AliHLTDataSource::fgSpecialEventDataType=dt; + AliHLTDataSource::fgSpecialEventSpecification=spec; +} + +AliHLTDataSource::AliSpecialEventGuard::~AliSpecialEventGuard() +{ + AliHLTDataSource::fgpSpecialEvent=NULL; + AliHLTDataSource::fgSpecialEventSize=0; + AliHLTDataSource::fgSpecialEventDataType=kAliHLTVoidDataType; + AliHLTDataSource::fgSpecialEventSpecification=kAliHLTVoidDataSpec; +}