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