]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataTypes.h
corrections from previous commit
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataTypes.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTDATATYPES_H
4 #define ALIHLTDATATYPES_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTDataTypes.h
9     @author Matthias Richter, Timm Steinbeck
10     @date   
11     @brief  Data type declaration for the HLT module.
12 */
13
14 using namespace std;
15
16 extern "C" {
17
18   typedef unsigned char AliHLTUInt8_t;
19
20   typedef unsigned short AliHLTUInt16_t;
21
22   typedef unsigned int AliHLTUInt32_t;
23
24   typedef unsigned long long AliHLTUInt64_t;
25
26   typedef AliHLTUInt64_t AliHLTEventID_t;
27
28   enum AliHLTComponentLogSeverity { kHLTLogNone=0, kHLTLogBenchmark=1, kHLTLogDebug=2, kHLTLogInfo=4, kHLTLogWarning=8, kHLTLogError=16, kHLTLogFatal=32, kHLTLogAll=0x3f, kHLTLogDefault=0x39 };
29
30   struct AliHLTComponentEventData
31   {
32     AliHLTUInt32_t fStructSize;
33     AliHLTEventID_t fEventID;
34     AliHLTUInt32_t fEventCreation_s;
35     AliHLTUInt32_t fEventCreation_us;
36     AliHLTUInt32_t fBlockCnt;
37   };
38
39   struct AliHLTComponentShmData
40   {
41     AliHLTUInt32_t fStructSize;
42     AliHLTUInt32_t fShmType;
43     AliHLTUInt64_t fShmID;
44   };
45
46     const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
47     const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
48
49   const int kAliHLTComponentDataTypefIDsize=8;
50   const int kAliHLTComponentDataTypefOriginSize=4;
51   struct AliHLTComponentDataType
52   {
53     AliHLTUInt32_t fStructSize;
54     char fID[kAliHLTComponentDataTypefIDsize];
55     char fOrigin[kAliHLTComponentDataTypefOriginSize];
56   };
57
58 # define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
59 # define kAliHLTVoidDataOrigin "\0\0\0"
60   const AliHLTComponentDataType kAliHLTVoidDataType = {sizeof(AliHLTComponentDataType), kAliHLTVoidDataTypeID, kAliHLTVoidDataOrigin};
61   
62   struct AliHLTComponentBlockData
63   {
64     AliHLTUInt32_t fStructSize;
65     AliHLTComponentShmData fShmKey;
66     AliHLTUInt32_t fOffset;
67     void* fPtr;
68     AliHLTUInt32_t fSize;
69     AliHLTComponentDataType fDataType;
70     AliHLTUInt32_t fSpecification;
71   };
72
73   struct AliHLTComponentTriggerData
74   {
75     AliHLTUInt32_t fStructSize;
76     AliHLTUInt32_t fDataSize;
77     void* fData;
78   };
79   
80   struct AliHLTComponentEventDoneData
81   {
82     AliHLTUInt32_t fStructSize;
83     AliHLTUInt32_t fDataSize;
84     void* fData;
85   };
86
87   typedef int (*AliHLTfctLogging)( void* param, AliHLTComponentLogSeverity severity, const char* origin, const char* keyword, const char* message );
88
89   struct AliHLTComponentEnvironment
90   {
91     AliHLTUInt32_t fStructSize;
92     void* fParam;
93     void* (*fAllocMemoryFunc)( void* param, unsigned long size );
94 #if 0
95     int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); // future addition already foreseen/envisioned
96 #endif
97     int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
98     AliHLTfctLogging fLoggingFunc;
99   };
100 }
101
102 inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
103     {
104     for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
105         if ( dt1.fID[i] != dt2.fID[i] )
106             return false;
107     for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
108         if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
109             return false;
110     return true;
111     }
112
113 inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
114     {
115     for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
116         if ( dt1.fID[i] != dt2.fID[i] )
117             return true;
118     for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
119         if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
120             return true;
121     return false;
122     }
123
124 #endif