LCOV - code coverage report
Current view: top level - HLT/BASE - AliHLTDataSource.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 5 29 17.2 %
Date: 2016-06-14 17:26:59 Functions: 3 9 33.3 %

          Line data    Source code
       1             : // $Id$
       2             : 
       3             : //**************************************************************************
       4             : //* This file is property of and copyright by the                          * 
       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             : 
      25             : #include "AliHLTDataSource.h"
      26             : 
      27             : /** ROOT macro for the implementation of ROOT specific class methods */
      28         126 : ClassImp(AliHLTDataSource)
      29             : 
      30          39 : AliHLTDataSource::AliHLTDataSource()
      31         117 : {
      32             :   // Base class of HLT data source components.
      33             :   // The class provides a common interface for the implementation of HLT data
      34             :   // source components.
      35             :   // Source components do not consume any input consequently the processing
      36             :   // function is called 'GetEvent'.
      37          39 : }
      38             : 
      39             : AliHLTDataSource::~AliHLTDataSource()
      40           0 : { 
      41             :   // destructor
      42          78 : }
      43             : 
      44             : void AliHLTDataSource::GetInputDataTypes( AliHLTComponentDataTypeList& list)
      45             : {
      46             :   // default method as source components do not consume input
      47           0 :   list.clear(); // there are no input data types
      48           0 : }
      49             : 
      50             : 
      51             : int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
      52             :                                     const AliHLTComponentBlockData* blocks, 
      53             :                                     AliHLTComponentTriggerData& trigData,
      54             :                                     AliHLTUInt8_t* outputPtr, 
      55             :                                     AliHLTUInt32_t& size,
      56             :                                     AliHLTComponentBlockDataList& outputBlocks,
      57             :                                     AliHLTComponentEventDoneData*& edd )
      58             : {
      59             :   // Processing method, calls child's GetEvent
      60             :   int iResult=0;
      61           0 :   if (evtData.fBlockCnt > 0) {
      62             :     int unknown=-1;
      63           0 :     for (unsigned int block=0; block<evtData.fBlockCnt; block++) {
      64           0 :       if (blocks[block].fDataType==kAliHLTDataTypeSOR ||
      65           0 :           blocks[block].fDataType==kAliHLTDataTypeEOR ||
      66           0 :           blocks[block].fDataType==kAliHLTDataTypeEvent ||
      67           0 :           blocks[block].fDataType==kAliHLTDataTypeRunType ||
      68           0 :           blocks[block].fDataType==kAliHLTDataTypeComponentStatistics ||
      69           0 :           blocks[block].fDataType==kAliHLTDataTypeComponentTable ||
      70           0 :           blocks[block].fDataType==kAliHLTDataTypeECSParam) {
      71             :         continue;
      72             :       }
      73             :       unknown=block;
      74           0 :       break;
      75             :     }
      76             :     static int warningCount=0;
      77           0 :     if (unknown>=0 && warningCount++<5) {
      78           0 :       HLTWarning("Data source component skips input data blocks: first unknown block %s",
      79             :                  DataType2Text(blocks[unknown].fDataType).c_str());
      80             :     }
      81           0 :   }
      82           0 :   iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks);
      83             :   HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult);
      84           0 :   edd = NULL;
      85           0 :   return iResult;
      86           0 : }
      87             : 
      88             : int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
      89             :                                 AliHLTComponentTriggerData& trigData,
      90             :                                 AliHLTUInt8_t* /*outputPtr*/, 
      91             :                                 AliHLTUInt32_t& size,
      92             :                                 AliHLTComponentBlockDataList& /*outputBlocks*/ )
      93             : {
      94             :   // we just forward to the high level method, all other parameters already
      95             :   // have been stored internally
      96           0 :   size=0;
      97           0 :   return GetEvent(evtData, trigData);
      98             : }
      99             : 
     100             : int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
     101             : {
     102             :   // default method: one of GetEvent methods must be implemented
     103           0 :   HLTFatal("no processing method implemented");
     104           0 :   return -ENOSYS;
     105             : }

Generated by: LCOV version 1.11