3 #ifndef ALIHLTCONTROLTASK_H
4 #define ALIHLTCONTROLTASK_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 *
9 /** @file AliHLTControlTask.h
10 @author Matthias Richter
12 @brief Special task to produce the control events.
15 #include "AliHLTTask.h"
16 #include "AliHLTDataSource.h"
18 class AliHLTComponentHandler;
19 class AliHLTConfiguration;
22 * @class AliHLTControlTask
23 * This task is automatically added to the beginning of each chain and
24 * produces the special steering events. The first component in every
25 * branch get the special events from the task.
27 * This task gets initialized with data type, specification and payload
28 * of the control event to be sent. It produces the data block if data
29 * type differs from fAliHLTVoidDataType. The guard class can be used to
32 * AliHLTControlEventGuard(task, kAliHLTDataTypeSOR, 0, payload, size);
35 * @ingroup alihlt_system
37 class AliHLTControlTask : public AliHLTTask {
41 /** standard destructor */
42 virtual ~AliHLTControlTask();
44 // AliHLTTask interface function
45 int CreateComponent(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH, AliHLTComponent*& pComponent) const;
47 class AliHLTControlEventGuard {
49 AliHLTControlEventGuard(AliHLTControlTask* me, AliHLTComponentDataType dt, AliHLTUInt32_t spec, AliHLTUInt8_t* pData, AliHLTUInt32_t size) :
53 fTask->fSpecification=spec;
57 ~AliHLTControlEventGuard() {
59 fTask->fEvent=kAliHLTVoidDataType;
60 fTask->fSpecification=kAliHLTVoidDataSpec;
66 /** standard constructor prohibited */
67 AliHLTControlEventGuard();
68 /** copy constructor prohibited */
69 AliHLTControlEventGuard(const AliHLTControlEventGuard&);
70 /** assignment operator prohibited */
71 AliHLTControlEventGuard& operator=(const AliHLTControlEventGuard&);
73 /** by the guard controlled task */
74 AliHLTControlTask* fTask; //! transient
78 * Source component producing the data blocks
80 class AliHLTControlEventComponent : public AliHLTDataSource {
82 AliHLTControlEventComponent(const AliHLTControlTask* pParent);
83 ~AliHLTControlEventComponent();
85 // AliHLTComponent interface functions
86 const char* GetComponentID() {return "__priv_AliHLTControlTask";}
87 AliHLTComponentDataType GetOutputDataType();
88 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
89 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
90 AliHLTComponent* Spawn() {return NULL;}
93 /** standard constructor prohibited */
94 AliHLTControlEventComponent();
95 /** copy constructor prohibited */
96 AliHLTControlEventComponent(const AliHLTControlEventComponent&);
97 /** assignment operator prohibited */
98 AliHLTControlEventComponent& operator=(const AliHLTControlEventComponent&);
100 // AliHLTDataSource interface function
101 int GetEvent(const AliHLTComponentEventData& evtData,
102 AliHLTComponentTriggerData& trigData,
103 AliHLTUInt8_t* outputPtr,
104 AliHLTUInt32_t& size,
105 vector<AliHLTComponentBlockData>& outputBlocks );
107 const AliHLTControlTask* fpParent; //! transient
113 /** copy constructor prohibited */
114 AliHLTControlTask(const AliHLTControlTask&);
115 /** assignment operator prohibited */
116 AliHLTControlTask& operator=(const AliHLTControlTask&);
118 /** data type of the control event */
119 AliHLTComponentDataType fEvent; //! transient
120 /** specification of the control evtent */
121 AliHLTUInt32_t fSpecification; //! transient
122 /** payload to be sent with the control event */
123 AliHLTUInt8_t* fpData; //! transient
125 AliHLTUInt32_t fSize; //!transient
127 ClassDef(AliHLTControlTask, 0)