]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTTask.h
bugfixes in HLT build system: /prog/versions_AliRoot/AliRoot_HEAD_2008-07-17/PHOS...
[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  protected:
34
35  private:
36   /** standard constructor prohibited */
37   AliHLTOUTTask();
38   /** copy constructor prohibited */
39   AliHLTOUTTask(const AliHLTOUTTask&);
40   /** assignment operator prohibited */
41   AliHLTOUTTask& operator=(const AliHLTOUTTask&);
42
43   /**
44    * Custom initialization for child tasks.
45    * Create and init the dummy task.
46    */
47   int CustomInit(AliHLTComponentHandler* pCH);
48
49   /**
50    * Custom clean up for child tasks.
51    */
52   int CustomCleanup();
53
54   /**
55    * Generate the index of the HLTOUT data.
56    * Must be implemented by the child classes.
57    */
58   int GenerateIndex();
59
60   /**
61    * Cleanup and reset the data input.
62    */
63   int ResetInput();
64
65   /**
66    * Get the data buffer
67    * @param index   [in]  index of the block
68    * @param pBuffer [out] buffer of the selected data block
69    * @param size    [out] size of the selected data block
70    */
71   int GetDataBuffer(AliHLTUInt32_t index, const AliHLTUInt8_t* &pBuffer, 
72                             AliHLTUInt32_t& size);
73
74   /**
75    * Check byte order of data block
76    */
77   AliHLTOUTByteOrder CheckBlockByteOrder(AliHLTUInt32_t index);
78
79   /**
80    * Check alignment of data block
81    */
82   int CheckBlockAlignment(AliHLTUInt32_t index, AliHLTOUT::AliHLTOUTDataType type);
83
84   /** a dummy task to pretend existence of a consumer */
85   AliHLTTask* fpDummyTask; //!transient
86
87   /** the configuration for the dummy task */
88   AliHLTConfiguration* fpDummyConfiguration; //!transient
89
90   /** list of block descriptors of the output */
91   AliHLTComponentBlockDataList fBlockDescList;
92
93   ClassDef(AliHLTOUTTask, 0)
94 };
95 #endif