LCOV - code coverage report
Current view: top level - HLT/BASE - AliHLTConsumerDescriptor.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 44 2.3 %
Date: 2016-06-14 17:26:59 Functions: 1 14 7.1 %

          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   AliHLTConsumerDescriptor.cxx
      20             : /// @author Matthias Richter
      21             : /// @date   
      22             : /// @brief  Helper class to describe a consumer component.
      23             : ///
      24             : 
      25             : #include "AliHLTConsumerDescriptor.h"
      26             : 
      27             : /** ROOT macro for the implementation of ROOT specific class methods */
      28         126 : ClassImp(AliHLTConsumerDescriptor)
      29             : 
      30           0 : AliHLTConsumerDescriptor::AliHLTConsumerDescriptor()
      31             :   :
      32           0 :   fpConsumer(NULL),
      33           0 :   fSegments()
      34           0 : {
      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           0 :   fSegments.clear();
      41           0 : }
      42             : 
      43           0 : AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(AliHLTComponent* pConsumer)
      44             :   :
      45           0 :   fpConsumer(pConsumer),
      46           0 :   fSegments()
      47           0 : {
      48             :   // see header file for function documentation
      49           0 :   fSegments.clear();
      50           0 : }
      51             : 
      52           0 : AliHLTConsumerDescriptor::~AliHLTConsumerDescriptor()
      53           0 : {
      54             :   // see header file for function documentation
      55           0 :   if (fSegments.size()>0) {
      56             :     //HLTWarning("unreleased data segments found");
      57             :   }
      58           0 : }
      59             : 
      60             : int AliHLTConsumerDescriptor::SetActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
      61             : {
      62             :   // see header file for function documentation
      63             :   int iResult=0;
      64           0 :   fSegments.push_back(segment);
      65             :   //HLTDebug("set active segment (%d:%d) for consumer %p", offset, size, this);
      66           0 :   return iResult;
      67             : }
      68             : 
      69             : int AliHLTConsumerDescriptor::CheckActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
      70             : {
      71             :   // see header file for function documentation
      72             :   int iResult=0;
      73           0 :   if (fSegments.size()>0) {
      74           0 :     AliHLTDataBuffer::AliHLTDataSegmentList::iterator element=fSegments.begin();
      75           0 :     while (element!=fSegments.end()) {
      76           0 :       if ((iResult=(segment==(*element)))>0) {
      77             :         break;
      78             :       }
      79           0 :       element++;
      80             :     }
      81           0 :   } else {
      82             :     //HLTWarning("no data segment active for consumer %p", this);
      83             :     iResult=-ENODATA;
      84             :   }
      85           0 :   return iResult;
      86             : }
      87             : 
      88             : int AliHLTConsumerDescriptor::ReleaseActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
      89             : {
      90             :   // see header file for function documentation
      91             :   int iResult=0;
      92           0 :   if (fSegments.size()>0) {
      93           0 :     AliHLTDataBuffer::AliHLTDataSegmentList::iterator element=fSegments.begin();
      94           0 :     while (element!=fSegments.end()) {
      95           0 :       if ((iResult=(segment==(*element)))>0) {
      96           0 :         fSegments.erase(element);
      97           0 :         break;
      98             :       }
      99           0 :       element++;
     100             :     }
     101           0 :     if (iResult==0) {
     102             :       //HLTWarning("no data segment (%d:%d) active for consumer %p", offset, size, this);
     103             :       iResult=-ENOENT;
     104           0 :     }
     105           0 :   } else {
     106             :     //HLTWarning("no data segment active for consumer %p", this);
     107             :     iResult=-ENODATA;
     108             :   }
     109           0 :   return iResult;
     110             : }
     111             : 
     112             : void AliHLTConsumerDescriptor::Print(const char* /*option*/) const
     113             : {
     114             :   // print info about this descriptor
     115           0 :   cout << "AliHLTConsumerDescriptor " << this
     116           0 :        << " component ID " << (fpConsumer?fpConsumer->GetComponentID():"NULL")
     117             :     //<< " chain ID " << (fpConsumer?fpConsumer->GetChainId():"NULL")
     118           0 :        << endl;
     119           0 :   for (unsigned i=0; i<fSegments.size(); i++) {
     120           0 :     cout << "     ";
     121           0 :     fSegments[i].Print("");
     122             :   }
     123           0 : }

Generated by: LCOV version 1.11