//-*- Mode: C++ -*-
// @(#) $Id$
#ifndef ALIHLTSAMPLECOMPONENT1_H
#define ALIHLTSAMPLECOMPONENT1_H
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
//* See cxx source for full Copyright notice */
/** @file AliHLTSampleComponent1.h
@author Matthias Richter, Timm Steinbeck
@date
@brief A sample processing component for the HLT.
*/
#include "AliHLTProcessor.h"
/**
* @class AliHLTSampleComponent1
* An HLT sample component.
* This component does not any data processing at all. It just
* illustrates the existence of several components in ine library and
* allows to set up a very simple chain with different components.
*
*
General properties:
*
* Component ID: \b Sample-component1
* Library: \b libAliHLTSample.so
* Input Data Types: @ref kAliHLTAnyDataType
* Output Data Types: none
*
* Mandatory arguments:
*
* \li -mandatory1 teststring
* an argument with one parameter
* \li -mandatory2
* an argument without parameters
*
* Optional arguments:
*
* \li -optional1 teststring
* an argument with one parameter
* \li -optional2
* an argument without parameters
*
* Configuration:
*
* \li -config1 teststring
* a configuration argument with one parameter
* \li -config2
* a configuration argument without parameters
*
* Default CDB entries:
* The component has just one default CDB entry in
* HLT/ConfigSample/SampleComponent1.
* It does not load any configuration from the global ConfigHLT
* folder.
* \li -TObjString object holding a string with the configuration parameters
* explained above
*
* Performance:
* The component does not any event data processing.
*
* Memory consumption:
* The component does not any event data processing.
*
* Output size:
* The component has no output data.
*
* Furthermore it illustrates the component argument scanning and the
* component configuration. There are actually two methods to init/
* configure a component:
* - via command line arguments. The arguments are specified in the HLT
* chain configuration and are passed to the component during
* initialization in @ref DoInit()
* - from a CDB entry. The CDB can contain configuration objects for a
* component and the component can implement the handling
*
* The component implements the @ref alihltcomponent-low-level-interface.
* for data processing.
*
* Using the latter case, a component can also be reconfigured. Special
* events are propageted through the chain in order to trigger the re-
* configuration. The component needs to implement the function
* @ref Reconfigure(). The simplest version of a configuration object is
* a string object (TObjString) containing configuration arguments.
*
* @ingroup alihlt_tutorial
*/
class AliHLTSampleComponent1 : public AliHLTProcessor {
public:
AliHLTSampleComponent1();
virtual ~AliHLTSampleComponent1();
// AliHLTComponent interface functions
const char* GetComponentID() { return "Sample-component1";}
void GetInputDataTypes( vector& list) {
list.push_back(kAliHLTAnyDataType);
}
AliHLTComponentDataType GetOutputDataType() {return kAliHLTVoidDataType;}
virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) {constBase = 0;inputMultiplier = 0;};
// Spawn function, return new class instance
AliHLTComponent* Spawn() {return new AliHLTSampleComponent1;};
protected:
// AliHLTComponent interface functions
int DoInit( int argc, const char** argv );
int DoDeinit();
int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size, vector& outputBlocks );
int Reconfigure(const char* cdbEntry, const char* chainId);
int ReadPreprocessorValues(const char* modules);
using AliHLTProcessor::DoEvent;
private:
/**
* Configure the component.
* Parse a string for the configuration arguments and set the component
* properties.
*
* This function illustrates the scanning of an argument string. The string
* was presumably fetched from the CDB.
*/
int Configure(const char* arguments);
ClassDef(AliHLTSampleComponent1, 1)
};
#endif