3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
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.
29 #include "AliHLTConsumerDescriptor.h"
31 /** ROOT macro for the implementation of ROOT specific class methods */
32 ClassImp(AliHLTConsumerDescriptor)
34 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor()
39 // see header file for class documentation
41 // refer to README to build package
43 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
47 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(AliHLTComponent* pConsumer)
49 fpConsumer(pConsumer),
52 // see header file for function documentation
56 AliHLTConsumerDescriptor::~AliHLTConsumerDescriptor()
58 // see header file for function documentation
59 if (fSegments.size()>0) {
60 //HLTWarning("unreleased data segments found");
64 int AliHLTConsumerDescriptor::SetActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
66 // see header file for function documentation
68 AliHLTDataBuffer::AliHLTDataSegment segment(offset, size);
69 fSegments.push_back(segment);
70 //HLTDebug("set active segment (%d:%d) for consumer %p", offset, size, this);
74 int AliHLTConsumerDescriptor::CheckActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
76 // see header file for function documentation
78 if (fSegments.size()>0) {
79 vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
80 while (segment!=fSegments.end()) {
81 if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
87 //HLTWarning("no data segment active for consumer %p", this);
93 int AliHLTConsumerDescriptor::ReleaseActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
95 // see header file for function documentation
97 if (fSegments.size()>0) {
98 vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
99 while (segment!=fSegments.end()) {
100 if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
101 fSegments.erase(segment);
107 //HLTWarning("no data segment (%d:%d) active for consumer %p", offset, size, this);
111 //HLTWarning("no data segment active for consumer %p", this);