4 #ifndef ALIHLTCONSUMERDESCRIPTOR_H
5 #define ALIHLTCONSUMERDESCRIPTOR_H
6 //* This file is property of and copyright by the *
7 //* ALICE Experiment at CERN, All rights reserved. *
8 //* See cxx source for full Copyright notice *
10 /// @file AliHLTConsumerDescriptor.h
11 /// @author Matthias Richter
13 /// @brief Helper class to describe a consumer component.
14 /// @note The class is used in Offline (AliRoot) context
16 #include "AliHLTDataBuffer.h"
19 * @class AliHLTConsumerDescriptor
20 * @brief Helper class to describe a consumer component.
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
27 * @note This class is only used for the @ref alihlt_system.
29 * @ingroup alihlt_system
31 class AliHLTConsumerDescriptor : public TObject, public AliHLTLogging {
33 /** standard constructur */
34 AliHLTConsumerDescriptor();
36 * @param pConsumer pointer to the consumer component
38 AliHLTConsumerDescriptor(AliHLTComponent* pConsumer);
40 ~AliHLTConsumerDescriptor();
43 * Get the component of this descriptor.
44 * @return pointer to the component
46 AliHLTComponent* GetComponent() {return fpConsumer;}
49 * Set an active data segment.
50 * the pointer will be handled in a container, no allocation, copy or
52 * @param segment segment descriptor
53 * @return >=0 if succeeded
55 int SetActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
58 * Check whether there is an active data segment of certain size with
60 * @param segment segment descriptor
61 * @return > if existend, 0 if not
63 int CheckActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
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
71 //AliHLTUInt32_t FindActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size);
73 /** get the number of active segments for this consumer
74 * @return number of active segments
76 int GetNofActiveSegments() {return fSegments.size();};
79 * @param segment segment descriptor
81 int ReleaseActiveDataSegment(AliHLTDataBuffer::AliHLTDataSegment segment);
83 virtual void Print(const char* option) const;
86 /** copy constructor prohibited */
87 AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor&);
88 /** assignment operator prohibited */
89 AliHLTConsumerDescriptor& operator=(const AliHLTConsumerDescriptor&);
91 /** consumer object */
92 AliHLTComponent* fpConsumer; //! transient
94 /** list of data segments */
95 AliHLTDataBuffer::AliHLTDataSegmentList fSegments; // list of data segments
97 ClassDef(AliHLTConsumerDescriptor, 0)
100 #endif // ALIHLTCONSUMERDESCRIPTOR_H