]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - HLT/BASE/AliHLTConsumerDescriptor.h
changes in .pkg for chaoticity task + remove couts
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTConsumerDescriptor.h
... / ...
CommitLineData
1//-*- Mode: C++ -*-
2// $Id$
3
4#ifndef ALIHLTCONSUMERDESCRIPTOR_H
5#define ALIHLTCONSUMERDESCRIPTOR_H
6//* This file is property of and copyright by the ALICE HLT Project *
7//* ALICE Experiment at CERN, All rights reserved. *
8//* See cxx source for full Copyright notice *
9
10/// @file AliHLTConsumerDescriptor.h
11/// @author Matthias Richter
12/// @date
13/// @brief Helper class to describe a consumer component.
14/// @note The class is used in Offline (AliRoot) context
15
16#include "AliHLTDataBuffer.h"
17
18/**
19 * @class AliHLTConsumerDescriptor
20 * @brief Helper class to describe a consumer component.
21 *
22 * There is unfortunately no unique determination of the data type from the
23 * component itself possible, thats why both component and data type have to
24 * be initialized and are stored in a compound. The class is intended to make
25 * bookkeeping easier.
26 *
27 * @note This class is only used for the @ref alihlt_system.
28 *
29 * @ingroup alihlt_system
30 */
31class AliHLTConsumerDescriptor : public TObject, public AliHLTLogging {
32 public:
33 /** standard constructur */
34 AliHLTConsumerDescriptor();
35 /** constructur
36 * @param pConsumer pointer to the consumer component
37 */
38 AliHLTConsumerDescriptor(AliHLTComponent* pConsumer);
39 /** destructor */
40 ~AliHLTConsumerDescriptor();
41
42 /**
43 * Get the component of this descriptor.
44 * @return pointer to the component
45 */
46 AliHLTComponent* GetComponent() {return fpConsumer;}
47
48 /**
49 * Set an active data segment.
50 * the pointer will be handled in a container, no allocation, copy or
51 * cleanup.
52 * @param segment segment descriptor
53 * @return >=0 if succeeded
54 */
55 int SetActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
56
57 /**
58 * Check whether there is an active data segment of certain size with
59 * certain offset.
60 * @param segment segment descriptor
61 * @return > if existend, 0 if not
62 */
63 int CheckActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
64
65 /** find an active data segment of certain size with certain offset
66 * will see if this is necessary
67 * @param offset offset of the data segment in the data buffer
68 * @param size size of the data segment in the data buffer
69 * @return offset of the data segment
70 */
71 //AliHLTUInt32_t FindActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size);
72
73 /** get the number of active segments for this consumer
74 * @return number of active segments
75 */
76 int GetNofActiveSegments() {return fSegments.size();};
77
78 /**
79 * @param segment segment descriptor
80 */
81 int ReleaseActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
82
83 virtual void Print(const char* option) const;
84
85 private:
86 /** copy constructor prohibited */
87 AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor&);
88 /** assignment operator prohibited */
89 AliHLTConsumerDescriptor& operator=(const AliHLTConsumerDescriptor&);
90
91 /** consumer object */
92 AliHLTComponent* fpConsumer; //! transient
93
94 /** list of data segments */
95 vector<AliHLTDataBuffer::AliHLTDataSegment> fSegments; // see above
96
97 ClassDef(AliHLTConsumerDescriptor, 0)
98};
99
100#endif // ALIHLTCONSUMERDESCRIPTOR_H