]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTTask.h
handling of steering events
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTOUTTask.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTOUTTASK_H
4 #define ALIHLTOUTTASK_H
5 //* This file is property of and copyright by the ALICE HLT Project        * 
6 //* ALICE Experiment at CERN, All rights reserved.                         *
7 //* See cxx source for full Copyright notice                               *
8
9 /** @file   AliHLTOUTTask.h
10     @author Matthias Richter
11     @date   
12     @brief  A special HLTOUT sibling working as a data sink in chains
13 */
14
15 #include "AliHLTOUT.h"
16 #include "AliHLTTask.h"
17
18 /**
19  * @class AliHLTOUTTask
20  * A special HLTOUT sibling implementing AliHLTDataSink functionality in
21  * order to be run at the end of a reconstruction chain and generation of
22  * an HLTOUT sub-collection.
23  * 
24  * The constructor takes the chains as a blank separated list of chain ids.
25  */
26 class AliHLTOUTTask : public AliHLTOUT, public AliHLTTask {
27  public:
28   /** constructor */
29   AliHLTOUTTask(const char* chains);
30   /** standard destructor */
31   virtual ~AliHLTOUTTask();
32
33   /**
34    * Get string of the source chains.
35    */
36   const char* GetSourceChains() const;
37
38  protected:
39
40  private:
41   /** standard constructor prohibited */
42   AliHLTOUTTask();
43   /** copy constructor prohibited */
44   AliHLTOUTTask(const AliHLTOUTTask&);
45   /** assignment operator prohibited */
46   AliHLTOUTTask& operator=(const AliHLTOUTTask&);
47
48   /**
49    * Custom initialization for child tasks.
50    * Create and init the dummy task.
51    */
52   int CustomInit(AliHLTComponentHandler* pCH);
53
54   /**
55    * Custom clean up for child tasks.
56    */
57   int CustomCleanup();
58
59   /**
60    * Generate the index of the HLTOUT data.
61    * Must be implemented by the child classes.
62    */
63   int GenerateIndex();
64
65   /**
66    * Cleanup and reset the data input.
67    */
68   int ResetInput();
69
70   /**
71    * Get the data buffer
72    * @param index   [in]  index of the block
73    * @param pBuffer [out] buffer of the selected data block
74    * @param size    [out] size of the selected data block
75    */
76   int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, 
77                             AliHLTUInt32_t& size);
78
79   /**
80    * Check byte order of data block
81    */
82   AliHLTOUTByteOrder CheckBlockByteOrder(AliHLTUInt32_t index);
83
84   /**
85    * Check alignment of data block
86    */
87   int CheckBlockAlignment(AliHLTUInt32_t index, AliHLTOUT::AliHLTOUTDataType type);
88
89   /** a dummy task to pretend existence of a consumer */
90   AliHLTTask* fpDummyTask; //!transient
91
92   /** the configuration for the dummy task */
93   AliHLTConfiguration* fpDummyConfiguration; //!transient
94
95   /** list of block descriptors of the output */
96   AliHLTComponentBlockDataList fBlockDescList;
97
98   ClassDef(AliHLTOUTTask, 0)
99 };
100 #endif