]>
Commit | Line | Data |
---|---|---|
9409b4b1 | 1 | //-*- Mode: C++ -*- |
2 | // $Id$ | |
3 | #ifndef ALIHLTDATAINFLATERHUFFMAN_H | |
4 | #define ALIHLTDATAINFLATERHUFFMAN_H | |
5 | //* This file is property of and copyright by the ALICE HLT Project * | |
6 | //* ALICE Experiment at CERN, All rights reserved. * | |
7 | //* See cxx source for full Copyright notice * | |
8 | ||
9 | /// @file AliHLTDataInflaterHuffman.h | |
10 | /// @author Matthias Richter | |
11 | /// @date 2011-09-01 | |
12 | /// @brief Data inflater implementation for huffman encoded data | |
13 | /// @note | |
14 | ||
15 | #include "AliHLTDataInflater.h" | |
16 | ||
17 | class AliHLTHuffman; | |
18 | class TList; | |
19 | ||
20 | class AliHLTDataInflaterHuffman : public AliHLTDataInflater | |
21 | { | |
22 | public: | |
23 | /// standard constructor | |
24 | AliHLTDataInflaterHuffman(); | |
25 | /// destructor | |
26 | ~AliHLTDataInflaterHuffman(); | |
27 | ||
28 | /// add a parameter definition to the configuration, return reference id | |
29 | int AddParameterDefinition(const char* name, unsigned bitLength); | |
30 | ||
31 | /// init list of decoders | |
32 | int InitDecoders(TList* decoderlist); | |
33 | ||
34 | /// overloaded from AliHLTDataInflater | |
35 | virtual bool NextValue(AliHLTUInt64_t& value, AliHLTUInt32_t& length); | |
70d61ae2 | 36 | /// switch to next parameter |
37 | virtual int NextParameter() { | |
38 | if (fHuffmanCoders.size()==0) return -1; | |
39 | if (fLegacyMode>0) return fCurrentParameter; | |
40 | fLegacyMode=0; | |
41 | if ((++fCurrentParameter)>=(int)fHuffmanCoders.size()) fCurrentParameter=0; | |
42 | return fCurrentParameter; | |
43 | } | |
9409b4b1 | 44 | |
c33c6e06 | 45 | /// clear the object and reset pointer references |
46 | virtual void Clear(Option_t * option =""); | |
47 | ||
9409b4b1 | 48 | protected: |
49 | private: | |
50 | /** copy constructor prohibited */ | |
51 | AliHLTDataInflaterHuffman(const AliHLTDataInflaterHuffman&); | |
52 | /** assignment operator prohibited */ | |
53 | AliHLTDataInflaterHuffman& operator=(const AliHLTDataInflaterHuffman&); | |
54 | ||
55 | /// index of the decoders in the decoder list | |
56 | vector<AliHLTHuffman*> fHuffmanCoders; //! index of decoders | |
57 | ||
58 | /// list of huffman coders identified by parameter name | |
59 | TList* fHuffmanCoderList; //! list of huffman coders | |
60 | ||
61 | /// current parameter during reading | |
62 | int fCurrentParameter; //! | |
70d61ae2 | 63 | /// legacy mode to handle code not using NextParameter() |
64 | int fLegacyMode; | |
9409b4b1 | 65 | |
66 | ClassDef(AliHLTDataInflaterHuffman, 0) | |
67 | }; | |
68 | ||
69 | #endif //ALIHLTDATAINFLATERHUFFMAN_H |