]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTBlockFilterComponent.h
component documentation corrected, initialization of member
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTBlockFilterComponent.h
1 // -*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTBLOCKFILTERCOMPONENT_H
5 #define ALIHLTBLOCKFILTERCOMPONENT_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   AliHLTBlockFilterComponent.h
11     @author Matthias Richter
12     @date   
13     @brief  A simple data block filter and merger, merges block descriptors
14
15 // see below for class documentation
16 // or
17 // refer to README to build package
18 // or
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
20                                                                           */
21 #include "AliHLTProcessor.h"
22
23 /**
24  * @class AliHLTBlockFilterComponent
25  * A data block merger and filter.
26  * It merges data block descriptors fulfilling the filtering rules and
27  * forwards the descriptors to the output. The actual data is not touched.
28  */
29 class AliHLTBlockFilterComponent : public AliHLTProcessor
30 {
31  public:
32   /** standard constructor */
33   AliHLTBlockFilterComponent();
34   /** destructor */
35   virtual ~AliHLTBlockFilterComponent();
36
37   /**
38    * The id of the component.
39    * @return component id (string)
40    */
41   virtual const char* GetComponentID() {return "BlockFilter";};
42
43   /**
44    * Get the input data types of the component.
45    * @return list of data types in the vector reference
46    */
47   void GetInputDataTypes( AliHLTComponentDataTypeList& );
48
49   /**
50    * Get the output data type of the component.
51    * If @ref kAliHLTMultipleDataType is returned, the framework invokes
52    * @ref GetOutputDataTypes.
53    * @return output data type
54    */
55   AliHLTComponentDataType GetOutputDataType();
56
57   /**
58    * Get the output data types of the component.
59    * The function can be implemented to indicate multiple output data types
60    * in the target array.
61    * @ref GetOutputDataType must return @ref kAliHLTMultipleDataType in order
62    * to invoke this method.
63    * @param tgtList          list to receive the data types
64    * @return no of output data types, data types in the target list
65    */
66   int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
67
68   /**
69    * Get a ratio by how much the data volume is shrinked or enhanced.
70    * @param constBase        <i>return</i>: additive part, independent of the
71    *                                   input data volume  
72    * @param inputMultiplier  <i>return</i>: multiplication ratio
73    * @return values in the reference variables
74    */
75   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
76
77   /**
78    * Spawn function.
79    * @return new class instance
80    */
81   virtual AliHLTComponent* Spawn() {return new AliHLTBlockFilterComponent;}
82
83  protected:
84
85   /**
86    * Data processing method for the component.
87    * Filters the incoming data descriptors according to the rules and forwards
88    * them into the output.
89    * @return neg. error code if failed 
90    */
91   int DoEvent( const AliHLTComponentEventData& evtData,
92                const AliHLTComponentBlockData* blocks, 
93                AliHLTComponentTriggerData& trigData,
94                AliHLTUInt8_t* outputPtr, 
95                AliHLTUInt32_t& size,
96                AliHLTComponentBlockDataList& outputBlocks );
97   
98   using AliHLTProcessor::DoEvent;
99
100   /**
101    * Component initialisation and argument scan.
102    */
103   int DoInit( int argc, const char** argv );
104
105   /**
106    * Component cleanup.
107    */
108   int DoDeinit();
109
110  private:
111   /** copy constructor prohibited */
112   AliHLTBlockFilterComponent(const AliHLTBlockFilterComponent&);
113   /** assignment operator prohibited */
114   AliHLTBlockFilterComponent& operator=(const AliHLTBlockFilterComponent&);
115
116   /**
117    * Check if the data block is selected by the filter rules.
118    * @return 1 if selected
119    */
120   int IsSelected(const AliHLTComponentBlockData& block);
121
122   /** filtering rules, only the data type and specification members are use */
123   AliHLTComponentBlockDataList fFilterRules;                       //! transient
124
125   ClassDef(AliHLTBlockFilterComponent, 0)
126 };
127 #endif