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

          Line data    Source code
       1             : #include "AliHLTObjectRenamer.h"
       2             : #include "AliHLTOUT.h"
       3             : #include "AliHLTMisc.h"
       4             : #include "AliHLTSystem.h"
       5             : #include "AliHLTComponentHandler.h"
       6             : #include "AliHLTPluginBase.h"
       7             : #include "AliHLTConfiguration.h"
       8             : #include "AliHLTHOMERLibManager.h"
       9             : #include "AliHLTHOMERBlockDesc.h"
      10             : #include "AliHLTDataSource.h"
      11             : #include "AliHLTProcessor.h"
      12             : #include "AliHLTDataSink.h"
      13             : #include "AliHLTMessage.h"
      14             : #include "AliHLTGlobalTriggerDecision.h"
      15             : #include "AliHLTCTPData.h"
      16             : #include "AliCDBManager.h"
      17             : #include "AliDAQ.h"
      18             : #include "TServerSocket.h"
      19             : #include "TObjArray.h"
      20             : #include "TSystem.h"
      21             : #include "TTimeStamp.h"
      22             : #include <vector>
      23             : #include <iostream>
      24             : #include <iomanip>
      25             : using namespace std;
      26             : 
      27             : #include <sys/ioctl.h>
      28             : #include <arpa/inet.h>
      29             : 
      30           8 : ClassImp(AliHLTObjectRenamer)
      31             : 
      32             : int AliHLTObjectRenamer::DoInit(int argc, const char** argv)
      33             : {
      34           0 :         fSuffix = "";
      35             :         bool suffixSet = false;
      36           0 :         for (int i = 0; i < argc; i++)
      37             :         {
      38           0 :                 if (strcmp( argv[i], "-suffix" ) == 0)
      39             :                 {
      40           0 :                         if (suffixSet)
      41             :                         {
      42           0 :                                 HLTWarning("The suffix has already been specified."
      43             :                                         " Will replace previous value given by -suffix."
      44             :                                 );
      45             :                         }
      46           0 :                         if ( argc <= i+1 )
      47             :                         {
      48           0 :                                 HLTError("The suffix value was not specified.");
      49           0 :                                 return -EINVAL;
      50             :                         }
      51           0 :                         fSuffix = argv[i+1];
      52             :                         i++;
      53             :                         continue;
      54             :                 }
      55             :                 
      56           0 :                 HLTError("Unknown option '%s'.", argv[i]);
      57           0 :                 return -EINVAL;
      58             :         }
      59             :         
      60           0 :         return 0;
      61           0 : }
      62             : 
      63             : int AliHLTObjectRenamer::DoEvent(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
      64             : {
      65             :         const TObject* obj = NULL;
      66           0 :         for (obj = GetFirstInputObject(); obj != NULL; obj = GetNextInputObject())
      67             :         {
      68           0 :                 TObject* newObj = NULL; CloneList<TObjArray>(obj, fSuffix);
      69           0 :                 if (newObj == NULL) newObj = CloneList<TList>(obj, fSuffix);
      70           0 :                 if (newObj == NULL)
      71             :                 {
      72           0 :                         TString name = obj->GetName();
      73           0 :                         name += fSuffix;
      74           0 :                         newObj = obj->Clone(name);
      75           0 :                 }
      76           0 :                 PushBack(newObj, GetDataType(), GetSpecification());
      77           0 :                 delete newObj;
      78             :         }
      79           0 :         return 0;
      80           0 : }
      81             : 

Generated by: LCOV version 1.11