3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7 * for The ALICE Off-line Project. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 /** @file AliHLTConsumerDescriptor.cxx
19 @author Matthias Richter
21 @brief Helper class to describe a consumer component.
28 #include "AliHLTConsumerDescriptor.h"
30 /** ROOT macro for the implementation of ROOT specific class methods */
31 ClassImp(AliHLTConsumerDescriptor)
33 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor()
38 // see header file for class documentation
40 // refer to README to build package
42 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(AliHLTComponent* pConsumer)
48 fpConsumer(pConsumer),
51 // see header file for function documentation
55 AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor& desc)
59 fpConsumer(desc.fpConsumer),
62 // see header file for function documentation
64 // we can simply transfer the pointer to th new object since there are no
65 // release actions in the destructor
68 AliHLTConsumerDescriptor& AliHLTConsumerDescriptor::operator=(const AliHLTConsumerDescriptor& desc)
70 // see header file for function documentation
72 // we can simply transfer the pointer to th new object since there are no
73 // release actions in the destructor
74 fpConsumer=desc.fpConsumer;
78 AliHLTConsumerDescriptor::~AliHLTConsumerDescriptor()
80 // see header file for function documentation
81 if (fSegments.size()>0) {
82 //HLTWarning("unreleased data segments found");
86 int AliHLTConsumerDescriptor::SetActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
88 // see header file for function documentation
90 AliHLTDataBuffer::AliHLTDataSegment segment(offset, size);
91 fSegments.push_back(segment);
92 //HLTDebug("set active segment (%d:%d) for consumer %p", offset, size, this);
96 int AliHLTConsumerDescriptor::CheckActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
98 // see header file for function documentation
100 if (fSegments.size()>0) {
101 vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
102 while (segment!=fSegments.end()) {
103 if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
109 //HLTWarning("no data segment active for consumer %p", this);
115 int AliHLTConsumerDescriptor::ReleaseActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size)
117 // see header file for function documentation
119 if (fSegments.size()>0) {
120 vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
121 while (segment!=fSegments.end()) {
122 if ((iResult=((*segment).fSegmentOffset==offset && (*segment).fSegmentSize==size))>0) {
123 fSegments.erase(segment);
129 //HLTWarning("no data segment (%d:%d) active for consumer %p", offset, size, this);
133 //HLTWarning("no data segment active for consumer %p", this);