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 AliHLTConsumerDescriptor.cxx
20 /// @author Matthias Richter
22 /// @brief Helper class to describe a consumer component.
25 #include "AliHLTConsumerDescriptor.h"
27 /** ROOT macro for the implementation of ROOT specific class methods */
28 ClassImp(AliHLTConsumerDescriptor)
30 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor()
35 // see header file for class documentation
37 // refer to README to build package
39 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
43 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(AliHLTComponent* pConsumer)
45 fpConsumer(pConsumer),
48 // see header file for function documentation
52 AliHLTConsumerDescriptor::~AliHLTConsumerDescriptor()
54 // see header file for function documentation
55 if (fSegments.size()>0) {
56 //HLTWarning("unreleased data segments found");
60 int AliHLTConsumerDescriptor::SetActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
62 // see header file for function documentation
64 fSegments.push_back(segment);
65 //HLTDebug("set active segment (%d:%d) for consumer %p", offset, size, this);
69 int AliHLTConsumerDescriptor::CheckActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
71 // see header file for function documentation
73 if (fSegments.size()>0) {
74 AliHLTDataBuffer::AliHLTDataSegmentList::iterator element=fSegments.begin();
75 while (element!=fSegments.end()) {
76 if ((iResult=(segment==(*element)))>0) {
82 //HLTWarning("no data segment active for consumer %p", this);
88 int AliHLTConsumerDescriptor::ReleaseActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment)
90 // see header file for function documentation
92 if (fSegments.size()>0) {
93 AliHLTDataBuffer::AliHLTDataSegmentList::iterator element=fSegments.begin();
94 while (element!=fSegments.end()) {
95 if ((iResult=(segment==(*element)))>0) {
96 fSegments.erase(element);
102 //HLTWarning("no data segment (%d:%d) active for consumer %p", offset, size, this);
106 //HLTWarning("no data segment active for consumer %p", this);
112 void AliHLTConsumerDescriptor::Print(const char* /*option*/) const
114 // print info about this descriptor
115 cout << "AliHLTConsumerDescriptor " << this
116 << " component ID " << (fpConsumer?fpConsumer->GetComponentID():"NULL")
117 //<< " chain ID " << (fpConsumer?fpConsumer->GetChainId():"NULL")
119 for (unsigned i=0; i<fSegments.size(); i++) {
121 fSegments[i].Print("");