]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTFilePublisher.h
- AliHLTFileWriter added
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTFilePublisher.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTFILEPUBLISHER_H
4 #define ALIHLTFILEPUBLISHER_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTFilePublisher.h
9     @author Matthias Richter
10     @date   
11     @brief  An HLT file publishing (data source) component.
12     @note   The class is used in Offline (AliRoot) context
13 */
14
15 #include "AliHLTDataSource.h"
16 #include <TList.h>
17
18 /**
19  * @class AliHLTFilePublisher
20  * An HLT data source component which publishes data from one or a sequence
21  * of files.<br>
22  * Mandatory arguments: <br>
23  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
24  * \li -datafile     <i> filename      </i>
25  * \li -datafilelist <i> file pattern  </i>
26  * \li -datatype     <i> data type     </i>
27  * \li -dataspec     <i> specification </i>
28  * \li -dataorigin   <i> origin        </i>
29  *
30  * Optional arguments:<br>
31  *
32  * The component needs at least one argument \em -datafile or \em -datafilelist.
33  * Both can occur multiple times.
34  * @ingroup alihlt_component
35  */
36 class AliHLTFilePublisher : public AliHLTDataSource  {
37  public:
38   /** standard constructor */
39   AliHLTFilePublisher();
40   /** not a valid copy constructor, defined according to effective C++ style */
41   AliHLTFilePublisher(const AliHLTFilePublisher&);
42   /** not a valid assignment op, but defined according to effective C++ style */
43   AliHLTFilePublisher& operator=(const AliHLTFilePublisher&);
44   /** destructor */
45   virtual ~AliHLTFilePublisher();
46
47   const char* GetComponentID();
48   AliHLTComponentDataType GetOutputDataType();
49   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
50   AliHLTComponent* Spawn();
51
52   /**
53    * Open all files.
54    * Opens all files from the file name list @ref fFileNames and adds TFile
55    * opjects to the TFiles list.
56    */
57   int OpenFiles();
58
59  protected:
60   /**
61    * Init method.
62    */
63   int DoInit( int argc, const char** argv );
64
65   /**
66    * Deinit method.
67    */
68   int DoDeinit();
69
70   /**
71    * Data processing method for the component.
72    * @param evtData       event data structure
73    * @param trigData      trigger data structure
74    * @param outputPtr     pointer to target buffer
75    * @param size          <i>input</i>: size of target buffer
76    *                      <i>output</i>:size of produced data
77    * @param outputBlocks  list to receive output block descriptors
78    * @return
79    */
80   int GetEvent( const AliHLTComponentEventData& evtData,
81                         AliHLTComponentTriggerData& trigData,
82                         AliHLTUInt8_t* outputPtr, 
83                         AliHLTUInt32_t& size,
84                         vector<AliHLTComponentBlockData>& outputBlocks );
85
86   /**
87    * Scan one argument and adjacent parameters.
88    * Can be overloaded by child classes in order to add additional arguments
89    * beyond the standard arguments of the file publisher. The method is called
90    * whenever a non-standard argument is recognized.
91    * @param argc           size of the argument array
92    * @param argv           agument array for component initialization
93    * @return number of processed members of the argv <br>
94    *         -EINVAL unknown argument <br>
95    *         -EPROTO parameter for argument missing <br>
96    */
97   virtual int ScanArgument(int argc, const char** argv);
98
99  private:
100   TList                   fFileNames;
101   TList                   fFiles;
102   TObjLink*               fpCurrent; //! transient value
103   AliHLTComponentDataType fDataType;
104   AliHLTUInt32_t          fSpecification;
105   Int_t                   fMaxSize;
106
107   ClassDef(AliHLTFilePublisher, 0)
108 };
109 #endif