Line data Source code
1 : //-*- Mode: C++ -*-
2 : // @(#) $Id$
3 :
4 : #ifndef ALIHLTOUTHOMERBUFFER_H
5 : #define ALIHLTOUTHOMERBUFFER_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 AliHLTOUTHomerBuffer.h
11 : @author Matthias Richter
12 : @date
13 : @brief HLTOUT data wrapper for a data buffer.
14 : */
15 :
16 : #include "AliHLTOUT.h"
17 : #include "AliHLTLogging.h"
18 :
19 : class AliHLTHOMERReader;
20 : class AliHLTMonitoringReader;
21 : class AliHLTHOMERLibManager;
22 :
23 : /**
24 : * @class AliHLTOUTHomerBuffer
25 : * Handler of HLTOUT data for buffer input.
26 : *
27 : * The class supports the AliHLTOUT interface in order to access the
28 : * individual data blocks of a HOMER data collection. An AliHOMERReader
29 : * is created to interpret the data. The class can serve as base for
30 : * other HLTOUT implementations supporting different kinds of input like
31 : * the AliHLTOUTHomerCollection and its childs AliHLTOUTRawReader and
32 : * AliHLTOUTDigitReader.
33 : *
34 : * @note The buffer is expected to contain the HOMER data block only, no
35 : * CDH and HLT headers.
36 : */
37 : class AliHLTOUTHomerBuffer : public AliHLTOUT, public AliHLTLogging {
38 : public:
39 : /** constructor */
40 : AliHLTOUTHomerBuffer(const AliHLTUInt8_t* pBuffer, int size);
41 : /** destructor */
42 : virtual ~AliHLTOUTHomerBuffer();
43 :
44 : protected:
45 : /**
46 : * Step trough data blocks of a HOMER reader and generate index.
47 : */
48 : int ScanReader(AliHLTMonitoringReader* pReader, AliHLTUInt32_t majorIndex=0);
49 :
50 : /** dynamic loader manager for HOMER library */
51 : AliHLTHOMERLibManager* fpManager; //!transient
52 :
53 : private:
54 : /** standard constructor prohibited */
55 : AliHLTOUTHomerBuffer();
56 : /** copy constructor prohibited */
57 : AliHLTOUTHomerBuffer(const AliHLTOUTHomerBuffer&);
58 : /** assignment operator prohibited */
59 : AliHLTOUTHomerBuffer& operator=(const AliHLTOUTHomerBuffer&);
60 :
61 : /**
62 : * Generate the index of the HLTOUT data from the data buffer.
63 : */
64 : virtual int GenerateIndex();
65 :
66 : /**
67 : * Get the data buffer
68 : * @param [in] index index of the block
69 : * @param [out] pBuffer buffer of the selected data block
70 : * @param [out] size size of the selected data block
71 : */
72 : virtual int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer,
73 : AliHLTUInt32_t& size);
74 :
75 : /**
76 : * Check byte order of data block
77 : */
78 : virtual AliHLTOUTByteOrder CheckBlockByteOrder(AliHLTUInt32_t index);
79 :
80 : /**
81 : * Check alignment of data block
82 : */
83 : virtual int CheckBlockAlignment(AliHLTUInt32_t index, AliHLTOUT::AliHLTOUTDataType type);
84 :
85 : /** data buffer */
86 : const AliHLTUInt8_t* fpBuffer; //! transient
87 :
88 : /** size of data buffer */
89 : int fSize; //! transient
90 :
91 : /** instance of the HOMER reader */
92 : AliHLTHOMERReader* fpReader; //!transient
93 :
94 126 : ClassDef(AliHLTOUTHomerBuffer, 0)
95 : };
96 : #endif
|