]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTHomerBuffer.h
further work on HLTOUT treatment
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTOUTHomerBuffer.h
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 // see below for class documentation
16 // or
17 // refer to README to build package
18 // or
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
20                                                                           */
21 #include "AliHLTOUT.h"
22
23 class AliHLTHOMERReader;
24 class AliHLTHOMERLibManager;
25
26 /**
27  * @class AliHLTOUTHomerBuffer
28  * Handler of HLTOUT data for buffer input.
29  */
30 class AliHLTOUTHomerBuffer : public AliHLTOUT {
31  public:
32   /** constructor */
33   AliHLTOUTHomerBuffer(const AliHLTUInt8_t* pBuffer, int size);
34   /** destructor */
35   virtual ~AliHLTOUTHomerBuffer();
36
37  protected:
38   /**
39    * Step trough data blocks of a HOMER reader and generate index.
40    */
41   int ScanReader(AliHLTHOMERReader* pReader, AliHLTUInt32_t majorIndex=0);
42
43   /** dynamic loader manager for HOMER library */
44   AliHLTHOMERLibManager* fpManager; //!transient
45
46  private:
47   /** standard constructor prohibited */
48   AliHLTOUTHomerBuffer();
49   /** copy constructor prohibited */
50   AliHLTOUTHomerBuffer(const AliHLTOUTHomerBuffer&);
51   /** assignment operator prohibited */
52   AliHLTOUTHomerBuffer& operator=(const AliHLTOUTHomerBuffer&);
53
54   /**
55    * Generate the index of the HLTOUT data from the data buffer.
56    */
57   virtual int GenerateIndex();
58
59   /**
60    * Get the data buffer
61    * @param index   [in]  index of the block
62    * @param pBuffer [out] buffer of the selected data block
63    * @param size    [out] size of the selected data block
64    */
65   virtual int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, 
66                             AliHLTUInt32_t& size);
67
68   /**
69    * Check byte order of data block
70    */
71   virtual AliHLTOUTByteOrder_t CheckBlockByteOrder(AliHLTUInt32_t index);
72
73   /**
74    * Check alignment of data block
75    */
76   virtual int CheckBlockAlignment(AliHLTUInt32_t index, AliHLTOUT::AliHLTOUTDataType_t type);
77
78   /** data buffer */
79   const AliHLTUInt8_t* fpBuffer; //! transient
80
81   /** size of data buffer */
82   int fSize; //! transient
83
84   /** instance of the HOMER reader */
85   AliHLTHOMERReader* fpReader;  //!transient
86
87   ClassDef(AliHLTOUTHomerBuffer, 0)
88 };
89 #endif