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 *
10 /** @file AliHLTTPCCompDumpComponent.h
11 @author Timm Steinbeck
13 @brief Declaration of a copy component. */
16 #include "AliHLTProcessor.h"
19 * @class AliHLTTPCCompDumpComponent
20 * @author Timm Steinbeck
21 * @brief A dummy HLT processing component.
24 * An implementiation of a copy component that just copies its input data
25 * to debug a components input data
28 class AliHLTTPCCompDumpComponent : public AliHLTProcessor
32 /** standard constructor */
33 AliHLTTPCCompDumpComponent();
35 /** standard destructor */
36 virtual ~AliHLTTPCCompDumpComponent();
38 // Public functions to implement AliHLTComponent's interface.
39 // These functions are required for the registration process
41 /** function to get component id
42 * @return const char* pointer to componentid
44 const char* GetComponentID();
46 /** function to get input data types
47 * @param list vecotr of AliHLTComponent_DataType
49 void GetInputDataTypes( vector<AliHLTComponent_DataType>& list);
51 /** function to get output data type
52 * @return AliHLTComponent_DataType
54 AliHLTComponent_DataType GetOutputDataType();
56 /** function to get output data size
57 * @param constBase address of an unsigned long
58 * @param inputMultiplier address of a double
60 virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
63 * @return AliHLTComponent* pointer to instance
65 AliHLTComponent* Spawn();
69 // Protected functions to implement AliHLTComponent's interface.
70 // These functions provide initialization as well as the actual processing
71 // capabilities of the component.
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
78 int DoInit( int argc, const char** argv );
80 /** deinitialisation function
81 * @return zero upon success
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
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 );
99 /** function to initialise bit input
100 * @param input AliHLTUInt8_t
101 * @param inputSize UInt_t
103 void InitBitDataInput( AliHLTUInt8_t* input, UInt_t inputSize );
105 /** function to close bit data input */
106 void CloseBitDataInput()
110 /** function to get current byte input position
111 * @return unsigned long value of current byte input position
113 unsigned long GetCurrentByteInputPosition() const
115 return (unsigned long)( fBitDataCurrentInput - fBitDataCurrentInputStart );
118 /** function to get current bit input position
119 * @return fBitDataCurrentPosInWord unsigned value
121 unsigned GetCurrentBitInputPosition() const
123 return fBitDataCurrentPosInWord;
126 /** function to get current input byte
127 * @return fBitDataCurrentWord AliHLTUInt8_t value
129 AliHLTUInt8_t GetCurrentInputByte() const
131 return fBitDataCurrentWord;
134 /** function to get end of bit input
135 * @return boolean if input is at end or not
137 bool EndOfBitInput() const
139 return (fBitDataCurrentInput>=fBitDataCurrentInputEnd);
142 /** function got get bit data input size bytes
143 * @return UInt_t value
145 UInt_t GetBitDataInputSizeBytes() const
147 return fBitDataCurrentInput-fBitDataCurrentInputStart;
150 /** function to determine input bit
151 * @param value AliHLTUInt8_t &
152 * @return boolean (input bit = 1 or = 0)
154 bool InputBit( AliHLTUInt8_t & value );
156 /** function to determine input bits below 8 bits
157 * @param value AliHLTUInt8_t &
158 * @param bitCount UInt_t const &
161 bool InputBits( AliHLTUInt8_t & value, UInt_t const & bitCount );
163 /** function to determine input bits between 8 and 16 bits
164 * @param value AliHLTUInt16_t &
165 * @param bitCount UInt_t const &
168 bool InputBits( AliHLTUInt16_t & value, UInt_t const & bitCount );
170 /** function to determine input bits between 16 and 32 bits
171 * @param value AliHLTUInt32_t &
172 * @param bitCount UInt_t const &
175 bool InputBits( AliHLTUInt32_t & value, UInt_t const & bitCount );
177 /** function to determine input bits between 16 and 32 bits II
178 * @param value Int_t &
179 * @param bitCount UInt_t const &
182 bool InputBits( Int_t & value, UInt_t const & bitCount );
184 /** function to determine input bits between 32 and 64 bits
185 * @param value AliHLTUInt64_t &
186 * @param bitCount UInt_t const &
189 bool InputBits( AliHLTUInt64_t & value, UInt_t const & bitCount );
191 /** pad function for 8 bits */
194 /** function for input bytes
195 * @param data AliHLTUInt8_t*
196 * @param byteCount UInt_t const &
198 bool InputBytes( AliHLTUInt8_t* data, UInt_t const & byteCount );
201 /** copy constructor prohibited */
202 AliHLTTPCCompDumpComponent(const AliHLTTPCCompDumpComponent&);
203 /** assignment operator prohibited */
204 AliHLTTPCCompDumpComponent& operator=(const AliHLTTPCCompDumpComponent&);
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
217 ClassDef(AliHLTTPCCompDumpComponent, 0)