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, AliHLTComponentBlockDataList& list) :
52 fTask->SetBlocks(list);
54 ~AliHLTControlEventGuard() {
60 /** standard constructor prohibited */
61 AliHLTControlEventGuard();
62 /** copy constructor prohibited */
63 AliHLTControlEventGuard(const AliHLTControlEventGuard&);
64 /** assignment operator prohibited */
65 AliHLTControlEventGuard& operator=(const AliHLTControlEventGuard&);
67 /** by the guard controlled task */
68 AliHLTControlTask* fTask; //! transient
72 * Source component producing the data blocks
74 class AliHLTControlEventComponent : public AliHLTDataSource {
76 AliHLTControlEventComponent(const AliHLTControlTask* pParent);
77 ~AliHLTControlEventComponent();
79 // AliHLTComponent interface functions
80 const char* GetComponentID() {return "__priv_AliHLTControlTask";}
81 AliHLTComponentDataType GetOutputDataType();
82 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
83 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
84 AliHLTComponent* Spawn() {return NULL;}
87 /** standard constructor prohibited */
88 AliHLTControlEventComponent();
89 /** copy constructor prohibited */
90 AliHLTControlEventComponent(const AliHLTControlEventComponent&);
91 /** assignment operator prohibited */
92 AliHLTControlEventComponent& operator=(const AliHLTControlEventComponent&);
94 // AliHLTDataSource interface function
95 int GetEvent(const AliHLTComponentEventData& evtData,
96 AliHLTComponentTriggerData& trigData,
97 AliHLTUInt8_t* outputPtr,
99 vector<AliHLTComponentBlockData>& outputBlocks );
101 const AliHLTControlTask* fpParent; //! transient
105 /// to be used from the guard
106 void SetBlocks(const AliHLTComponentBlockDataList& list);
107 /// to be used from the guard
111 /** copy constructor prohibited */
112 AliHLTControlTask(const AliHLTControlTask&);
113 /** assignment operator prohibited */
114 AliHLTControlTask& operator=(const AliHLTControlTask&);
116 /** list of control blocks */
117 AliHLTComponentBlockDataList fBlocks; //! transient
118 /** payload buffer for all control blocks */
119 AliHLTUInt8_t* fpData; //! transient
121 AliHLTUInt32_t fSize; //!transient
123 ClassDef(AliHLTControlTask, 0)