]> git.uio.no Git - u/mrichter/AliRoot.git/blob - 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
1 // XEmacs -*-C++-*-
2 // $Id$
3
4 #ifndef ALIHLTTPCCOMPDUMPCOMPONENT_H
5 #define ALIHLTTPCCOMPDUMPCOMPONENT_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   AliHLTTPCCompDumpComponent.h
11     @author Timm Steinbeck
12     @date   
13     @brief  Declaration of a copy component. */
14
15
16 #include "AliHLTProcessor.h"
17
18 /**
19  * @class AliHLTTPCCompDumpComponent
20  * @author Timm Steinbeck
21  * @brief A dummy HLT processing component. 
22  * @data 05-03-2008
23  *
24  * An implementiation of a copy component that just copies its input data
25  * to debug a components input data
26  * @ingroup alihlt_tpc
27  */
28 class AliHLTTPCCompDumpComponent : public AliHLTProcessor
29     {
30     public:
31       
32       /** standard constructor */
33       AliHLTTPCCompDumpComponent();
34
35       /** standard destructor */
36       virtual ~AliHLTTPCCompDumpComponent();
37
38         // Public functions to implement AliHLTComponent's interface.
39         // These functions are required for the registration process
40
41       /** function to get component id 
42        * @return const char* pointer to componentid
43        */
44       const char* GetComponentID();
45
46       /** function to get input data types
47        * @param list vecotr of AliHLTComponent_DataType
48        */
49       void GetInputDataTypes( vector<AliHLTComponent_DataType>& list);
50
51       /** function to get output data type
52        * @return AliHLTComponent_DataType
53        */
54       AliHLTComponent_DataType GetOutputDataType();
55
56       /** function to get output data size
57        * @param constBase address of an unsigned long
58        * @param inputMultiplier address of a double
59        */
60       virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
61
62       /** spawn function
63        * @return AliHLTComponent* pointer to instance
64        */
65       AliHLTComponent* Spawn();
66         
67     protected:
68         
69         // Protected functions to implement AliHLTComponent's interface.
70         // These functions provide initialization as well as the actual processing
71         // capabilities of the component. 
72
73       /** initialisation function
74        * @param argc integer counting number of input arguments
75        * @param argv const char** for parameter values
76        * @return zero upon success
77        */
78         int DoInit( int argc, const char** argv );
79
80       /** deinitialisation function
81        * @return zero upon success
82        */
83         int DoDeinit();
84
85       /** do event function
86        * @param evtData      const AliHLTComponent_EventData& to event data
87        * @param blocks       const AliHLTComponent_BlockData* to blocks of event data
88        * @param trigData     AliHLTComponent_TriggerData& of trigger data
89        * @param outputPtr    AliHLTUInt8_t* pointer to output data
90        * @param size         AliHLTUInt32_t& of output size
91        * @param outputBlocks vector<AliHLTComponent_BlockData>& of output block data
92        * @return zero upon success
93       */
94       int DoEvent( const AliHLTComponent_EventData& evtData, const AliHLTComponent_BlockData* blocks, 
95                    AliHLTComponent_TriggerData& trigData, AliHLTUInt8_t* outputPtr, 
96                    AliHLTUInt32_t& size, vector<AliHLTComponent_BlockData>& outputBlocks );
97       
98       
99       /** function to initialise bit input
100        * @param input     AliHLTUInt8_t
101        * @param inputSize UInt_t
102        */
103       void InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize );
104
105       /** function to close bit data input */   
106       void CloseBitDataInput()
107       {
108       }
109
110       /** function to get current byte input position
111        * @return unsigned long value of current byte input position
112        */
113       unsigned long GetCurrentByteInputPosition() const
114       {
115         return (unsigned long)( fBitDataCurrentInput - fBitDataCurrentInputStart );
116       }
117       
118       /** function to get current bit input position
119        * @return fBitDataCurrentPosInWord unsigned value
120        */
121       unsigned GetCurrentBitInputPosition() const
122       {
123         return fBitDataCurrentPosInWord;
124       }
125
126       /** function to get current input byte
127        * @return fBitDataCurrentWord AliHLTUInt8_t value
128        */
129       AliHLTUInt8_t GetCurrentInputByte() const
130       {
131         return fBitDataCurrentWord;
132       }
133       
134       /** function to get end of bit input
135        * @return boolean if input is at end or not
136        */
137       bool EndOfBitInput() const
138       {
139         return (fBitDataCurrentInput>=fBitDataCurrentInputEnd);
140       }
141       
142       /** function got get bit data input size bytes
143        * @return UInt_t value
144        */
145       UInt_t GetBitDataInputSizeBytes() const
146       {
147         return fBitDataCurrentInput-fBitDataCurrentInputStart;
148       }
149       
150       /** function to determine input bit
151        * @param value  AliHLTUInt8_t &
152        * @return boolean (input bit = 1 or = 0)
153        */
154       bool InputBit( AliHLTUInt8_t & value );
155
156       /** function to determine input bits below 8 bits
157        * @param value     AliHLTUInt8_t &
158        * @param bitCount  UInt_t const &
159        * @return boolean
160        */
161       bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount );
162
163       /** function to determine input bits between 8 and 16 bits
164        * @param value     AliHLTUInt16_t &
165        * @param bitCount  UInt_t const &
166        * @return boolean
167        */
168       bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount );
169
170       /** function to determine input bits between 16 and 32 bits
171        * @param value     AliHLTUInt32_t &
172        * @param bitCount  UInt_t const &
173        * @return boolean
174        */
175       bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount );
176
177       /** function to determine input bits between 16 and 32 bits II
178        * @param value     Int_t &
179        * @param bitCount  UInt_t const &
180        * @return boolean
181        */
182       bool InputBits( Int_t & value, UInt_t const & bitCount );
183
184       /** function to determine input bits between 32 and 64 bits
185        * @param value     AliHLTUInt64_t &
186        * @param bitCount  UInt_t const &
187        * @return boolean
188        */
189       bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount );
190
191       /** pad function for 8 bits */
192       void Pad8Bits();
193
194       /** function for input bytes 
195        * @param data      AliHLTUInt8_t*
196        * @param byteCount UInt_t const &
197        */
198       bool InputBytes( AliHLTUInt8_t* data, UInt_t const & byteCount );
199
200     private:
201       /** copy constructor prohibited */
202       AliHLTTPCCompDumpComponent(const AliHLTTPCCompDumpComponent&);
203       /** assignment operator prohibited */
204       AliHLTTPCCompDumpComponent& operator=(const AliHLTTPCCompDumpComponent&);
205       
206       /** member varibable for current bit data word */
207       AliHLTUInt8_t fBitDataCurrentWord; // member varibable for current bit data word
208       /** member variable for current bit data position in word */
209       UInt_t fBitDataCurrentPosInWord; // member variable for current bit data position in word
210       /** member variable for current input bit data */
211       AliHLTUInt8_t *fBitDataCurrentInput; // member variable for current input bit data
212       /** member variable for current bit data input start */
213       AliHLTUInt8_t *fBitDataCurrentInputStart; // member variable for current bit data input start
214       /** member variable for current bit data input end */
215       AliHLTUInt8_t *fBitDataCurrentInputEnd; // member variable for current bit data input end
216
217       ClassDef(AliHLTTPCCompDumpComponent, 0)
218
219     };
220 #endif