ROOT logo
// $Id$

//**************************************************************************
//* This file is property of and copyright by the ALICE HLT Project        * 
//* ALICE Experiment at CERN, All rights reserved.                         *
//*                                                                        *
//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
//*                  for The ALICE HLT Project.                            *
//*                                                                        *
//* Permission to use, copy, modify and distribute this software and its   *
//* documentation strictly for non-commercial purposes is hereby granted   *
//* without fee, provided that the above copyright notice appears in all   *
//* copies and that both the copyright notice and this permission notice   *
//* appear in the supporting documentation. The authors make no claims     *
//* about the suitability of this software for any purpose. It is          *
//* provided "as is" without express or implied warranty.                  *
//**************************************************************************

/// @file   AliHLTDataInflaterSimple.cxx
/// @author Matthias Richter
/// @date   2011-09-01
/// @brief  Data inflater implementation for format of AliHLTDataDeflaterSimple
/// @note   

#include "AliHLTDataInflaterSimple.h"

/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTDataInflaterSimple)

AliHLTDataInflaterSimple::AliHLTDataInflaterSimple()
  : AliHLTDataInflater()
  , fParameterDefinitions()
  , fCurrentParameter(-1)
  , fLegacyMode(-1)
{
  // see header file for class documentation
  // or
  // refer to README to build package
  // or
  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
}

AliHLTDataInflaterSimple::~AliHLTDataInflaterSimple()
{
  // destructor
}

int AliHLTDataInflaterSimple::AddParameterDefinition(const char* name, int bitLength, int reducedBitLength)
{
  /// add a parameter definition to the configuration, return reference id
  fParameterDefinitions.push_back(AliHLTDataDeflaterSimple::AliHLTDataDeflaterParameter(name, bitLength, reducedBitLength));
  return fParameterDefinitions.size()-1;
}

bool AliHLTDataInflaterSimple::NextValue(AliHLTUInt64_t& value, AliHLTUInt32_t& length)
{
  /// overloaded from AliHLTDataInflater
  /// functions reads the sequence of parameters as defined by the decoder
  /// list, than it starts at the first parameter again
  value=0;
  length=0;
  if (fLegacyMode!=0) {
  if ((++fCurrentParameter)>=(int)fParameterDefinitions.size()) fCurrentParameter=0;
  fLegacyMode=1;
  }
  if (fParameterDefinitions.size()==0 || fCurrentParameter<0) return false;
  const AliHLTDataDeflaterSimple::AliHLTDataDeflaterParameter& parameter
    =fParameterDefinitions[fCurrentParameter];

  AliHLTUInt8_t switchBit=0;
  if (!InputBit(switchBit))
    return false;
  int readlength=switchBit?parameter.GetBitLength():parameter.GetReducedBitLength();
  if (!InputBits(value, readlength))
    return false;
  length=parameter.GetBitLength();

  return true;
}
 AliHLTDataInflaterSimple.cxx:1
 AliHLTDataInflaterSimple.cxx:2
 AliHLTDataInflaterSimple.cxx:3
 AliHLTDataInflaterSimple.cxx:4
 AliHLTDataInflaterSimple.cxx:5
 AliHLTDataInflaterSimple.cxx:6
 AliHLTDataInflaterSimple.cxx:7
 AliHLTDataInflaterSimple.cxx:8
 AliHLTDataInflaterSimple.cxx:9
 AliHLTDataInflaterSimple.cxx:10
 AliHLTDataInflaterSimple.cxx:11
 AliHLTDataInflaterSimple.cxx:12
 AliHLTDataInflaterSimple.cxx:13
 AliHLTDataInflaterSimple.cxx:14
 AliHLTDataInflaterSimple.cxx:15
 AliHLTDataInflaterSimple.cxx:16
 AliHLTDataInflaterSimple.cxx:17
 AliHLTDataInflaterSimple.cxx:18
 AliHLTDataInflaterSimple.cxx:19
 AliHLTDataInflaterSimple.cxx:20
 AliHLTDataInflaterSimple.cxx:21
 AliHLTDataInflaterSimple.cxx:22
 AliHLTDataInflaterSimple.cxx:23
 AliHLTDataInflaterSimple.cxx:24
 AliHLTDataInflaterSimple.cxx:25
 AliHLTDataInflaterSimple.cxx:26
 AliHLTDataInflaterSimple.cxx:27
 AliHLTDataInflaterSimple.cxx:28
 AliHLTDataInflaterSimple.cxx:29
 AliHLTDataInflaterSimple.cxx:30
 AliHLTDataInflaterSimple.cxx:31
 AliHLTDataInflaterSimple.cxx:32
 AliHLTDataInflaterSimple.cxx:33
 AliHLTDataInflaterSimple.cxx:34
 AliHLTDataInflaterSimple.cxx:35
 AliHLTDataInflaterSimple.cxx:36
 AliHLTDataInflaterSimple.cxx:37
 AliHLTDataInflaterSimple.cxx:38
 AliHLTDataInflaterSimple.cxx:39
 AliHLTDataInflaterSimple.cxx:40
 AliHLTDataInflaterSimple.cxx:41
 AliHLTDataInflaterSimple.cxx:42
 AliHLTDataInflaterSimple.cxx:43
 AliHLTDataInflaterSimple.cxx:44
 AliHLTDataInflaterSimple.cxx:45
 AliHLTDataInflaterSimple.cxx:46
 AliHLTDataInflaterSimple.cxx:47
 AliHLTDataInflaterSimple.cxx:48
 AliHLTDataInflaterSimple.cxx:49
 AliHLTDataInflaterSimple.cxx:50
 AliHLTDataInflaterSimple.cxx:51
 AliHLTDataInflaterSimple.cxx:52
 AliHLTDataInflaterSimple.cxx:53
 AliHLTDataInflaterSimple.cxx:54
 AliHLTDataInflaterSimple.cxx:55
 AliHLTDataInflaterSimple.cxx:56
 AliHLTDataInflaterSimple.cxx:57
 AliHLTDataInflaterSimple.cxx:58
 AliHLTDataInflaterSimple.cxx:59
 AliHLTDataInflaterSimple.cxx:60
 AliHLTDataInflaterSimple.cxx:61
 AliHLTDataInflaterSimple.cxx:62
 AliHLTDataInflaterSimple.cxx:63
 AliHLTDataInflaterSimple.cxx:64
 AliHLTDataInflaterSimple.cxx:65
 AliHLTDataInflaterSimple.cxx:66
 AliHLTDataInflaterSimple.cxx:67
 AliHLTDataInflaterSimple.cxx:68
 AliHLTDataInflaterSimple.cxx:69
 AliHLTDataInflaterSimple.cxx:70
 AliHLTDataInflaterSimple.cxx:71
 AliHLTDataInflaterSimple.cxx:72
 AliHLTDataInflaterSimple.cxx:73
 AliHLTDataInflaterSimple.cxx:74
 AliHLTDataInflaterSimple.cxx:75
 AliHLTDataInflaterSimple.cxx:76
 AliHLTDataInflaterSimple.cxx:77
 AliHLTDataInflaterSimple.cxx:78
 AliHLTDataInflaterSimple.cxx:79