ROOT logo
//-*- Mode: C++ -*-
// $Id$

#ifndef ALIHLTDATASOURCE_H
#define ALIHLTDATASOURCE_H
///* This file is property of and copyright by the                          * 
///* ALICE Experiment at CERN, All rights reserved.                         *
///* See cxx source for full Copyright notice                               *

/// @file   AliHLTDataSource.h
/// @author Matthias Richter
/// @date   
/// @brief  Base class declaration for HLT data source components.
/// @note   The class is used in Offline (AliRoot) context
///

#include "AliHLTComponent.h"

/**
 * @class AliHLTDataSource
 * Base class of HLT data source components.
 * The class provides a common interface for the implementation of HLT data
 * source components. The child class must implement the functions:
 * - @ref DoInit (optional)
 * - @ref DoDeinit (optional)
 * - @ref GetEvent
 * - @ref GetComponentID
 * - @ref GetOutputDataType
 * - @ref GetOutputDataSize
 * - @ref Spawn
 *
 * @ingroup alihlt_component
 */
class AliHLTDataSource : public AliHLTComponent {
 public:
  /** standard constructor */
  AliHLTDataSource();
  /** standard destructor */
  virtual ~AliHLTDataSource();

  /**
   * Event processing function.
   * The method is called by the framework to process one event. After 
   * preparation of data structures. The call is redirected to GetEvent.
   * @return neg. error code if failed                                <br>
   *         -ENOSPC      output buffer too small
   */
  int DoProcessing( const AliHLTComponentEventData& evtData,
		    const AliHLTComponentBlockData* blocks, 
		    AliHLTComponentTriggerData& trigData,
		    AliHLTUInt8_t* outputPtr, 
		    AliHLTUInt32_t& size,
		    AliHLTComponentBlockDataList& outputBlocks,
		    AliHLTComponentEventDoneData*& edd );

  // Information member functions for registration.

  /**
   * Return @ref AliHLTComponent::kSource type as component type.
   * @return component type id
   */
  TComponentType GetComponentType() { return AliHLTComponent::kSource;}

  /**
   * Default implementation for all data sources.
   * There are no input data types.
   */
  void GetInputDataTypes( AliHLTComponentDataTypeList& list);

protected:

  /**
   * The low-level data processing method for the component.
   * This is the custom processing method and can be overloaded by 
   * the component.
   * @param [in] evtData       event data structure
   * @param [in] trigData	  trigger data structure
   * @param [in] outputPtr	  pointer to target buffer
   * @param [in,out] size	  <i>input</i>: size of target buffer
   *            	  <i>output</i>:size of produced data
   * @param [in] outputBlocks  list to receive output block descriptors
   * @return neg. error code if failed
   */
  virtual int GetEvent( const AliHLTComponentEventData& evtData,
		AliHLTComponentTriggerData& trigData,
		AliHLTUInt8_t* outputPtr, 
		AliHLTUInt32_t& size,
		AliHLTComponentBlockDataList& outputBlocks );

  /**
   * The high-level data processing method.
   * This is the default processing method; the method is called
   * if no low level @ref GetEvent method is overloaded by the component.
   * @param evtData       event data structure
   * @param trigData	  trigger data structure
   * @return neg. error code if failed
   */
  virtual int GetEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);

private:

  ClassDef(AliHLTDataSource, 3)
};
#endif
 AliHLTDataSource.h:1
 AliHLTDataSource.h:2
 AliHLTDataSource.h:3
 AliHLTDataSource.h:4
 AliHLTDataSource.h:5
 AliHLTDataSource.h:6
 AliHLTDataSource.h:7
 AliHLTDataSource.h:8
 AliHLTDataSource.h:9
 AliHLTDataSource.h:10
 AliHLTDataSource.h:11
 AliHLTDataSource.h:12
 AliHLTDataSource.h:13
 AliHLTDataSource.h:14
 AliHLTDataSource.h:15
 AliHLTDataSource.h:16
 AliHLTDataSource.h:17
 AliHLTDataSource.h:18
 AliHLTDataSource.h:19
 AliHLTDataSource.h:20
 AliHLTDataSource.h:21
 AliHLTDataSource.h:22
 AliHLTDataSource.h:23
 AliHLTDataSource.h:24
 AliHLTDataSource.h:25
 AliHLTDataSource.h:26
 AliHLTDataSource.h:27
 AliHLTDataSource.h:28
 AliHLTDataSource.h:29
 AliHLTDataSource.h:30
 AliHLTDataSource.h:31
 AliHLTDataSource.h:32
 AliHLTDataSource.h:33
 AliHLTDataSource.h:34
 AliHLTDataSource.h:35
 AliHLTDataSource.h:36
 AliHLTDataSource.h:37
 AliHLTDataSource.h:38
 AliHLTDataSource.h:39
 AliHLTDataSource.h:40
 AliHLTDataSource.h:41
 AliHLTDataSource.h:42
 AliHLTDataSource.h:43
 AliHLTDataSource.h:44
 AliHLTDataSource.h:45
 AliHLTDataSource.h:46
 AliHLTDataSource.h:47
 AliHLTDataSource.h:48
 AliHLTDataSource.h:49
 AliHLTDataSource.h:50
 AliHLTDataSource.h:51
 AliHLTDataSource.h:52
 AliHLTDataSource.h:53
 AliHLTDataSource.h:54
 AliHLTDataSource.h:55
 AliHLTDataSource.h:56
 AliHLTDataSource.h:57
 AliHLTDataSource.h:58
 AliHLTDataSource.h:59
 AliHLTDataSource.h:60
 AliHLTDataSource.h:61
 AliHLTDataSource.h:62
 AliHLTDataSource.h:63
 AliHLTDataSource.h:64
 AliHLTDataSource.h:65
 AliHLTDataSource.h:66
 AliHLTDataSource.h:67
 AliHLTDataSource.h:68
 AliHLTDataSource.h:69
 AliHLTDataSource.h:70
 AliHLTDataSource.h:71
 AliHLTDataSource.h:72
 AliHLTDataSource.h:73
 AliHLTDataSource.h:74
 AliHLTDataSource.h:75
 AliHLTDataSource.h:76
 AliHLTDataSource.h:77
 AliHLTDataSource.h:78
 AliHLTDataSource.h:79
 AliHLTDataSource.h:80
 AliHLTDataSource.h:81
 AliHLTDataSource.h:82
 AliHLTDataSource.h:83
 AliHLTDataSource.h:84
 AliHLTDataSource.h:85
 AliHLTDataSource.h:86
 AliHLTDataSource.h:87
 AliHLTDataSource.h:88
 AliHLTDataSource.h:89
 AliHLTDataSource.h:90
 AliHLTDataSource.h:91
 AliHLTDataSource.h:92
 AliHLTDataSource.h:93
 AliHLTDataSource.h:94
 AliHLTDataSource.h:95
 AliHLTDataSource.h:96
 AliHLTDataSource.h:97
 AliHLTDataSource.h:98
 AliHLTDataSource.h:99
 AliHLTDataSource.h:100
 AliHLTDataSource.h:101
 AliHLTDataSource.h:102
 AliHLTDataSource.h:103
 AliHLTDataSource.h:104