3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 //* for The ALICE HLT Project. *
10 //* Permission to use, copy, modify and distribute this software and its *
11 //* documentation strictly for non-commercial purposes is hereby granted *
12 //* without fee, provided that the above copyright notice appears in all *
13 //* copies and that both the copyright notice and this permission notice *
14 //* appear in the supporting documentation. The authors make no claims *
15 //* about the suitability of this software for any purpose. It is *
16 //* provided "as is" without express or implied warranty. *
17 //**************************************************************************
19 /// @file AliHLTDataInflaterSimple.cxx
20 /// @author Matthias Richter
22 /// @brief Data inflater implementation for format of AliHLTDataDeflaterSimple
25 #include "AliHLTDataInflaterSimple.h"
27 /** ROOT macro for the implementation of ROOT specific class methods */
28 ClassImp(AliHLTDataInflaterSimple)
30 AliHLTDataInflaterSimple::AliHLTDataInflaterSimple()
31 : AliHLTDataInflater()
32 , fParameterDefinitions()
33 , fCurrentParameter(-1)
36 // see header file for class documentation
38 // refer to README to build package
40 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
43 AliHLTDataInflaterSimple::~AliHLTDataInflaterSimple()
48 int AliHLTDataInflaterSimple::AddParameterDefinition(const char* name, int bitLength, int reducedBitLength)
50 /// add a parameter definition to the configuration, return reference id
51 fParameterDefinitions.push_back(AliHLTDataDeflaterSimple::AliHLTDataDeflaterParameter(name, bitLength, reducedBitLength));
52 return fParameterDefinitions.size()-1;
55 bool AliHLTDataInflaterSimple::NextValue(AliHLTUInt64_t& value, AliHLTUInt32_t& length)
57 /// overloaded from AliHLTDataInflater
58 /// functions reads the sequence of parameters as defined by the decoder
59 /// list, than it starts at the first parameter again
63 if ((++fCurrentParameter)>=(int)fParameterDefinitions.size()) fCurrentParameter=0;
66 if (fParameterDefinitions.size()==0 || fCurrentParameter<0) return false;
67 const AliHLTDataDeflaterSimple::AliHLTDataDeflaterParameter& parameter
68 =fParameterDefinitions[fCurrentParameter];
70 AliHLTUInt8_t switchBit=0;
71 if (!InputBit(switchBit))
73 int readlength=switchBit?parameter.GetBitLength():parameter.GetReducedBitLength();
74 if (!InputBits(value, readlength))
76 length=parameter.GetBitLength();