]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTDataSource.cxx
Ignoring temporary files
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataSource.cxx
index ad053ca299701acf550964ef7b3a153643ccb8e9..bca288bfc4575e90dd3c0552147e2b850daa5fa6 100644 (file)
@@ -1,10 +1,11 @@
 // $Id$
 
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
  *                                                                        *
- * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
- *          for The ALICE Off-line Project.                               *
+ * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
+ *                  for The ALICE HLT Project.                            *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
@@ -31,30 +32,96 @@ ClassImp(AliHLTDataSource)
 
 AliHLTDataSource::AliHLTDataSource()
 { 
+  // see header file for class documentation
+  // or
+  // refer to README to build package
+  // or
+  // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 }
 
+void* AliHLTDataSource::fgpSpecialEvent=NULL;
+int AliHLTDataSource::fgSpecialEventSize=0;
+AliHLTComponentDataType AliHLTDataSource::fgSpecialEventDataType=kAliHLTVoidDataType;
+AliHLTUInt32_t AliHLTDataSource::fgSpecialEventSpecification=kAliHLTVoidDataSpec;
+
 AliHLTDataSource::~AliHLTDataSource()
 { 
+  // see header file for class documentation
 }
 
-int AliHLTDataSource::ProcessEvent( const AliHLTComponent_EventData& evtData,
-                                   const AliHLTComponent_BlockData* blocks, 
-                                   AliHLTComponent_TriggerData& trigData,
+void AliHLTDataSource::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
+{
+  // see header file for class documentation
+  list.clear(); // there are no input data types
+}
+
+
+int AliHLTDataSource::DoProcessing( const AliHLTComponentEventData& evtData,
+                                   const AliHLTComponentBlockData* /*blocks*/, 
+                                   AliHLTComponentTriggerData& trigData,
                                    AliHLTUInt8_t* outputPtr, 
                                    AliHLTUInt32_t& size,
-                                   AliHLTUInt32_t& outputBlockCnt, 
-                                   AliHLTComponent_BlockData*& outputBlocks,
-                                   AliHLTComponent_EventDoneData*& edd )
+                                   vector<AliHLTComponentBlockData>& outputBlocks,
+                                   AliHLTComponentEventDoneData*& edd )
 {
+  // see header file for class documentation
   int iResult=0;
-  vector<AliHLTComponent_BlockData> blockData;
   if (evtData.fBlockCnt > 0) {
-    HLTWarning("Data source component skips imput data blocks");
+    HLTWarning("Data source component skips input data blocks");
   }
-  iResult=GetEvent(evtData, trigData, outputPtr, size, blockData);
-  if (iResult>=0) {
-    iResult=MakeOutputDataBlockList(blockData, &outputBlockCnt, &outputBlocks);
+  if (fgpSpecialEvent==NULL || fgSpecialEventSize==0) {
+    // normal event publishing
+    iResult=GetEvent(evtData, trigData, outputPtr, size, outputBlocks);
+    HLTDebug("component %s (%p) GetEvent finished (%d)", GetComponentID(), this, iResult);
+  } else {
+    // publish special event
+    if (size>=(unsigned)fgSpecialEventSize) {
+      memcpy(outputPtr, fgpSpecialEvent, fgSpecialEventSize);
+      AliHLTComponentBlockData bd;
+      FillBlockData(bd);
+      bd.fOffset=0;
+      bd.fSize=fgSpecialEventSize;
+      bd.fDataType=fgSpecialEventDataType;
+      bd.fSpecification=fgSpecialEventSpecification;
+      outputBlocks.push_back(bd);
+      size=bd.fSize;
+    } else {
+      iResult=-ENOSPC;
+    }
   }
   edd = NULL;
   return iResult;
 }
+
+int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
+                               AliHLTComponentTriggerData& trigData,
+                               AliHLTUInt8_t* /*outputPtr*/, 
+                               AliHLTUInt32_t& /*size*/,
+                               vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
+{
+  // we just forward to the high level method, all other parameters already
+  // have been stored internally
+  return GetEvent(evtData, trigData);
+}
+
+int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
+{
+  HLTFatal("no processing method implemented");
+  return -ENOSYS;
+}
+
+AliHLTDataSource::AliSpecialEventGuard::AliSpecialEventGuard(AliHLTRunDesc* pDesc, AliHLTComponentDataType dt, AliHLTUInt32_t spec)
+{
+  AliHLTDataSource::fgpSpecialEvent=pDesc; 
+  AliHLTDataSource::fgSpecialEventSize=sizeof(AliHLTRunDesc); 
+  AliHLTDataSource::fgSpecialEventDataType=dt; 
+  AliHLTDataSource::fgSpecialEventSpecification=spec;
+}
+
+AliHLTDataSource::AliSpecialEventGuard::~AliSpecialEventGuard()
+{
+  AliHLTDataSource::fgpSpecialEvent=NULL; 
+  AliHLTDataSource::fgSpecialEventSize=0; 
+  AliHLTDataSource::fgSpecialEventDataType=kAliHLTVoidDataType;
+  AliHLTDataSource::fgSpecialEventSpecification=kAliHLTVoidDataSpec;
+}