]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/comp/AliHLTTPCCompDumpComponent.h
coding conventions and compilation warnings and work on adaptive TPC data compression...
[u/mrichter/AliRoot.git] / HLT / TPCLib / comp / AliHLTTPCCompDumpComponent.h
index 694f69cc0ca7a8ab8a1f1f3ed4dad4198ca4a59d..6c473bbeebc99a4471ac235bb845142f318d46e9 100644 (file)
@@ -3,8 +3,9 @@
 
 #ifndef ALIHLTTPCCOMPDUMPCOMPONENT_H
 #define ALIHLTTPCCOMPDUMPCOMPONENT_H
-/* TPCCompDumpright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full TPCCompDumpright notice                               */
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//* See cxx source for full Copyright notice                               *
 
 /** @file   AliHLTTPCCompDumpComponent.h
     @author Timm Steinbeck
  * @class AliHLTTPCCompDumpComponent
  * @author Timm Steinbeck
  * @brief A dummy HLT processing component. 
+ * @data 05-03-2008
  *
  * An implementiation of a copy component that just copies its input data
  * to debug a components input data
- * @ingroup alihlt_tutorial
+ * @ingroup alihlt_tpc
  */
 class AliHLTTPCCompDumpComponent : public AliHLTProcessor
     {
@@ -98,14 +100,7 @@ class AliHLTTPCCompDumpComponent : public AliHLTProcessor
        * @param input     AliHLTUInt8_t
        * @param inputSize UInt_t
        */
-      void InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize )
-      {
-       fBitDataCurrentWord = 0;
-       fBitDataCurrentPosInWord = 7;
-       fBitDataCurrentInput = fBitDataCurrentInputStart = input;
-       fBitDataCurrentInputEnd = input+inputSize;
-       fBitDataCurrentWord = *fBitDataCurrentInput;
-      }
+      void InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize );
 
       /** function to close bit data input */  
       void CloseBitDataInput()
@@ -156,172 +151,51 @@ class AliHLTTPCCompDumpComponent : public AliHLTProcessor
        * @param value  AliHLTUInt8_t &
        * @return boolean (input bit = 1 or = 0)
        */
-      bool InputBit( AliHLTUInt8_t & value )
-      {
-       if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd )
-         return false;
-       value = (fBitDataCurrentWord >> fBitDataCurrentPosInWord) & 1;
-       if ( fBitDataCurrentPosInWord )
-         fBitDataCurrentPosInWord--;
-       else
-         {
-           fBitDataCurrentInput++;
-           if ( fBitDataCurrentInput<fBitDataCurrentInputEnd )
-             {
-               fBitDataCurrentWord = *fBitDataCurrentInput;
-               fBitDataCurrentPosInWord = 7;
-             }
-         }
-       return true;
-      }
+      bool InputBit( AliHLTUInt8_t & value );
 
       /** function to determine input bits below 8 bits
        * @param value     AliHLTUInt8_t &
        * @param bitCount  UInt_t const &
        * @return boolean
        */
-      bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount )
-      {
-       if ( bitCount>8 )
-         {
-           HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount );
-           return false;
-         }
-       AliHLTUInt64_t temp;
-       if ( !InputBits( temp, bitCount ) )
-         return false;
-       value = (AliHLTUInt8_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL );
-       return true;
-      }
+      bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount );
 
       /** function to determine input bits between 8 and 16 bits
        * @param value     AliHLTUInt16_t &
        * @param bitCount  UInt_t const &
        * @return boolean
        */
-      bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount )
-      {
-       if ( bitCount>16 )
-         {
-           HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount );
-           return false;
-         }
-       AliHLTUInt64_t temp;
-       if ( !InputBits( temp, bitCount ) )
-         return false;
-       value = (AliHLTUInt16_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL );
-       return true;
-      }
+      bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount );
 
       /** function to determine input bits between 16 and 32 bits
        * @param value     AliHLTUInt32_t &
        * @param bitCount  UInt_t const &
        * @return boolean
        */
-      bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount )
-      {
-       if ( bitCount>32 )
-         {
-           HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount );
-           return false;
-         }
-       AliHLTUInt64_t temp;
-       if ( !InputBits( temp, bitCount ) )
-         return false;
-       value = (AliHLTUInt32_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL );
-       return true;
-      }
+      bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount );
 
       /** function to determine input bits between 16 and 32 bits II
        * @param value     Int_t &
        * @param bitCount  UInt_t const &
        * @return boolean
        */
-      bool InputBits( Int_t & value, UInt_t const & bitCount )
-      {
-       if ( bitCount>32 )
-         {
-           HLTFatal( "Internal error: Attempt to write more than 32 bits (%u)", (unsigned)bitCount );
-           return false;
-         }
-       AliHLTUInt64_t temp;
-       if ( !InputBits( temp, bitCount ) )
-         return false;
-       value = (Int_t)( temp & (AliHLTUInt64_t)0xFFFFFFFFULL );
-       return true;
-      }
+      bool InputBits( Int_t & value, UInt_t const & bitCount );
 
       /** function to determine input bits between 32 and 64 bits
        * @param value     AliHLTUInt64_t &
        * @param bitCount  UInt_t const &
        * @return boolean
        */
-      bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount )
-      {
-       if ( bitCount>64 )
-         {
-           HLTFatal( "Internal error: Attempt to write more than 64 bits (%u)", (unsigned)bitCount );
-           return false;
-         }
-       UInt_t bitsToRead=bitCount;
-       UInt_t curBitCount;
-       value = 0;
-       while ( bitsToRead>0 )
-         {
-           if ( fBitDataCurrentInput>=fBitDataCurrentInputEnd )
-             return false;
-           if ( bitsToRead >= fBitDataCurrentPosInWord+1 )
-             curBitCount = fBitDataCurrentPosInWord+1;
-           else
-             curBitCount = bitsToRead;
-           value = (value << curBitCount) | ( (fBitDataCurrentWord >> (fBitDataCurrentPosInWord-curBitCount+1)) & ((1 << curBitCount)-1) );
-           if ( fBitDataCurrentPosInWord < curBitCount )
-             {
-               fBitDataCurrentInput++;
-               if ( fBitDataCurrentInput<fBitDataCurrentInputEnd )
-                 {
-                   fBitDataCurrentWord = *fBitDataCurrentInput;
-                   fBitDataCurrentPosInWord = 7;
-                 }
-             }
-           else
-             fBitDataCurrentPosInWord -= curBitCount;
-           bitsToRead -= curBitCount;
-         }
-       return true;
-      }
+      bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount );
 
       /** pad function for 8 bits */
-      void Pad8Bits()
-      {
-       if ( fBitDataCurrentPosInWord == 7 )
-         return;
-       fBitDataCurrentInput++;
-       if ( fBitDataCurrentInput<fBitDataCurrentInputEnd )
-         {
-           fBitDataCurrentWord = *fBitDataCurrentInput;
-           fBitDataCurrentPosInWord = 7;
-         }
-      }
+      void Pad8Bits();
 
       /** function for input bytes 
        * @param data      AliHLTUInt8_t*
        * @param byteCount UInt_t const &
        */
-      bool InputBytes( AliHLTUInt8_t* data, UInt_t const & byteCount )
-      {
-       Pad8Bits();
-       if ( fBitDataCurrentInput+byteCount>fBitDataCurrentInputEnd )
-         return false;
-       memcpy( data, fBitDataCurrentInput, byteCount );
-       fBitDataCurrentInput += byteCount;
-       if ( fBitDataCurrentInput<fBitDataCurrentInputEnd )
-         {
-           fBitDataCurrentWord = *fBitDataCurrentInput;
-           fBitDataCurrentPosInWord = 7;
-         }
-       return true;
-      }
+      bool InputBytes( AliHLTUInt8_t* data, UInt_t const & byteCount );
 
     private:
       /** copy constructor prohibited */
@@ -330,15 +204,15 @@ class AliHLTTPCCompDumpComponent : public AliHLTProcessor
       AliHLTTPCCompDumpComponent& operator=(const AliHLTTPCCompDumpComponent&);
       
       /** member varibable for current bit data word */
-      AliHLTUInt8_t fBitDataCurrentWord;
+      AliHLTUInt8_t fBitDataCurrentWord; // member varibable for current bit data word
       /** member variable for current bit data position in word */
-      UInt_t fBitDataCurrentPosInWord;
+      UInt_t fBitDataCurrentPosInWord; // member variable for current bit data position in word
       /** member variable for current input bit data */
-      AliHLTUInt8_t *fBitDataCurrentInput;
+      AliHLTUInt8_t *fBitDataCurrentInput; // member variable for current input bit data
       /** member variable for current bit data input start */
-      AliHLTUInt8_t *fBitDataCurrentInputStart;
+      AliHLTUInt8_t *fBitDataCurrentInputStart; // member variable for current bit data input start
       /** member variable for current bit data input end */
-      AliHLTUInt8_t *fBitDataCurrentInputEnd;
+      AliHLTUInt8_t *fBitDataCurrentInputEnd; // member variable for current bit data input end
 
       ClassDef(AliHLTTPCCompDumpComponent, 0)