]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTHandler.h
- workaround for copying and merging of ESDs: The HLTOUT contains ESDs for every...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTOUTHandler.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTOUTHANDLER_H
5 #define ALIHLTOUTHANDLER_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   AliHLTOUTHandler.h
11     @author Matthias Richter
12     @date   
13     @brief  Base class declaration of HLTOUT handlers
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 "AliHLTLogging.h"
22
23 class AliHLTOUT;
24
25 /**
26  * @class AliHLTOUTHandler
27  * Base class declaration of HLT output handlers.
28  * The library implementation of the AliHLTModuleAgent allows to generate
29  * handlers for data blocks of the HLT output. This can be the output of
30  * the real HLT coming from the HLTOUT nodes, or simulated HLT output.   <br>
31  * \em Note: The created instance of AliHLTOUTHandler is
32  * deleted by the framework.
33  */
34 class AliHLTOUTHandler : public AliHLTLogging {
35  public:
36   /** standard constructor */
37   AliHLTOUTHandler();
38   /** standard destructor */
39   virtual ~AliHLTOUTHandler();
40
41   /**
42    * Process the data.
43    * The data and it's properties can be retrieved by the following member
44    * functions of AliHLTOUT:
45    * - AliHLTOUT::GetDataBlockDescription(AliHLTComponentDataType& dt, AliHLTUInt32_t& spec)
46    * - AliHLTOUT::GetDataBlockIndex()
47    * - AliHLTOUT::GetDataBuffer(const AliHLTUInt8_t* &pBuffer, AliHLTUInt32_t& size)
48    * - AliHLTOUT::ReleaseDataBuffer(const AliHLTUInt8_t* pBuffer)
49    *
50    * The handler might decode the data block and produce new data as a
51    * replacement, see GetProcessedData()
52    * @param pData     instance of the AliHLTOUT data
53    * @return depending on the overloaded function, neg. error code if failed
54    */
55   virtual int ProcessData(AliHLTOUT* pData) = 0;
56
57   /**
58    * Get the output data, if available.
59    * Some of the handlers might produce data to replace the original data
60    * block. The handler must ensure the internal storage of the buffer and
61    * is also responsible for cleaning the buffer. The buffer must be valid
62    * until the next call of ProcessData() or ReleaseProcessedData().
63    *
64    * The default implementation just returns a NULL pointer to indicate
65    * 'no data'.
66    * @param pData     target to receive data pointer
67    * @return size of the buffer
68    */
69   virtual int GetProcessedData(const AliHLTUInt8_t* &pData);
70
71   /**
72    * Release the buffer of processed data.
73    * The handler implementation can do cleanup here.
74    * @param pData     pointer to buffer
75    * @param size      size of the buffer
76    * @return neg. error code if failed
77    */
78   virtual int ReleaseProcessedData(const AliHLTUInt8_t* pData, int size);
79
80  protected:
81
82  private:
83   /** copy constructor prohibited */
84   AliHLTOUTHandler(const AliHLTOUTHandler&);
85   /** assignment operator prohibited */
86   AliHLTOUTHandler& operator=(const AliHLTOUTHandler&);
87
88   ClassDef(AliHLTOUTHandler, 0)
89 };
90 #endif