]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added the DataType2Text function to convert a datatype structure into
authortimms <timms@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Sep 2005 07:03:15 +0000 (07:03 +0000)
committertimms <timms@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Sep 2005 07:03:15 +0000 (07:03 +0000)
a string representation.

Moved the MakeOutputDataBlockList out of the environment structure
so that the vector class will not be needed inside 'extern "C"'
sections.

HLT/BASE/AliHLTComponent.cxx
HLT/BASE/AliHLTComponent.h
HLT/BASE/AliHLTComponentHandler.h
HLT/BASE/AliHLTDataTypes.h

index ef5983bcb3783967683ac2a1cac70894f22141f8..71da40f4ddc156b27d60bec2b93270afb753dc04 100644 (file)
@@ -64,3 +64,31 @@ int AliHLTComponent::Deinit()
   iResult=DoDeinit();
   return iResult;
 }
+
+void AliHLTComponent::DataType2Text( const AliHLTComponent_DataType& type, char output[14] ) {
+memset( output, 0, 14 );
+strncat( output, type.fOrigin, 4 );
+strcat( output, ":" );
+strncat( output, type.fID, 8 );
+}
+
+int AliHLTComponent::MakeOutputDataBlockList( const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount,
+                                             AliHLTComponent_BlockData** outputBlocks ) {
+    if ( !blockCount || !outputBlocks )
+       return EFAULT;
+    AliHLTUInt32_t count = blocks.size();
+    if ( !count )
+       {
+       *blockCount = 0;
+       *outputBlocks = NULL;
+       return 0;
+       }
+    *outputBlocks = reinterpret_cast<AliHLTComponent_BlockData*>( AllocMemory( sizeof(AliHLTComponent_BlockData)*count ) );
+    if ( !*outputBlocks )
+       return ENOMEM;
+    for ( unsigned long i = 0; i < count; i++ )
+       (*outputBlocks)[i] = blocks[i];
+    *blockCount = count;
+    return 0;
+
+}
index 62ab2df00f728bec56a5f1b1b325a96551fb5b8d..e10ca1e3a1e529e174741fe418058d0192b65bf8 100644 (file)
@@ -90,11 +90,12 @@ class AliHLTComponent : public AliHLTLogging {
   }
 
   int MakeOutputDataBlockList( const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount,
-                              AliHLTComponent_BlockData** outputBlocks ) {
-    if (fEnvironment.fMakeOutputDataBlockListFunc)
-      return (*fEnvironment.fMakeOutputDataBlockListFunc)(fEnvironment.fParam, blocks, blockCount, outputBlocks );
-    return -ENOSYS;
-  }
+                              AliHLTComponent_BlockData** outputBlocks );
+/*  { */
+/*     if (fEnvironment.fMakeOutputDataBlockListFunc) */
+/*       return (*fEnvironment.fMakeOutputDataBlockListFunc)(fEnvironment.fParam, blocks, blockCount, outputBlocks ); */
+/*     return -ENOSYS; */
+/*   } */
 
   int GetEventDoneData( unsigned long size, AliHLTComponent_EventDoneData** edd ) {
     if (fEnvironment.fGetEventDoneDataFunc)
@@ -103,6 +104,8 @@ class AliHLTComponent : public AliHLTLogging {
   }
 
 
+  void DataType2Text( const AliHLTComponent_DataType& type, char output[14] );
+
  private:
   static AliHLTComponentHandler* fpComponentHandler;
   AliHLTComponentEnvironment fEnvironment;
index c853f5520a357466040dbd24ef4a778e180bdbd7..205fba9f1a628997ef7fea3733822d7b496d0715 100644 (file)
@@ -88,6 +88,7 @@ class AliHLTComponentHandler : public AliHLTLogging {
   AliHLTComponentEnvironment fEnvironment;
 
   ClassDef(AliHLTComponentHandler, 0)
+
     };
 #endif
 
index 93249b17c6e0c029b30d7d8bb852c8e9d39989e0..ea2324835abb0b62488a1b7c4a0e125f7a9df477 100644 (file)
@@ -5,8 +5,8 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-#include <vector>
-using namespace std;
+/* #include <vector> */
+/* using namespace std; */
 
 extern "C" {
 
@@ -82,7 +82,7 @@ extern "C" {
 #if 0
     int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponent_BlockData* blockLocation ); // future addition already foreseen/envisioned
 #endif
-    int (*fMakeOutputDataBlockListFunc)( void* param, const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount, AliHLTComponent_BlockData** outputBlocks );
+/*     int (*fMakeOutputDataBlockListFunc)( void* param, const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount, AliHLTComponent_BlockData** outputBlocks ); */
     int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponent_EventDoneData** edd );
     AliHLTfctLogging fLoggingFunc;
   };