]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTDataTypes.h
- improvements in AliHLTFilePublisher/Writer
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataTypes.h
CommitLineData
f23a6e1a 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
b22e91eb 8/** @file AliHLTDataTypes.h
9 @author Matthias Richter, Timm Steinbeck
10 @date
11 @brief Data type declaration for the HLT module.
12*/
13
1843b457 14using namespace std;
f23a6e1a 15
16extern "C" {
17
18 typedef unsigned char AliHLTUInt8_t;
19
71d7c760 20 typedef unsigned short AliHLTUInt16_t;
21
f23a6e1a 22 typedef unsigned int AliHLTUInt32_t;
23
24 typedef unsigned long long AliHLTUInt64_t;
25
26 typedef AliHLTUInt64_t AliHLTEventID_t;
27
8ede8717 28 enum AliHLTComponentLogSeverity { kHLTLogNone=0, kHLTLogBenchmark=1, kHLTLogDebug=2, kHLTLogInfo=4, kHLTLogWarning=8, kHLTLogError=16, kHLTLogFatal=32, kHLTLogAll=0x3f, kHLTLogDefault=0x39 };
f23a6e1a 29
8ede8717 30 struct AliHLTComponentEventData
f23a6e1a 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
3cde846d 39 const AliHLTEventID_t kAliHLTVoidEventID=~(AliHLTEventID_t)0;
8ede8717 40 struct AliHLTComponentShmData
f23a6e1a 41 {
42 AliHLTUInt32_t fStructSize;
43 AliHLTUInt32_t fShmType;
44 AliHLTUInt64_t fShmID;
45 };
71d7c760 46
8ede8717 47 const AliHLTUInt32_t gkAliHLTComponentInvalidShmType = 0;
48 const AliHLTUInt64_t gkAliHLTComponentInvalidShmID = ~(AliHLTUInt64_t)0;
49
2d7ff710 50 const int kAliHLTComponentDataTypefIDsize=8;
51 const int kAliHLTComponentDataTypefOriginSize=4;
8ede8717 52 struct AliHLTComponentDataType
f23a6e1a 53 {
54 AliHLTUInt32_t fStructSize;
2d7ff710 55 char fID[kAliHLTComponentDataTypefIDsize];
56 char fOrigin[kAliHLTComponentDataTypefOriginSize];
f23a6e1a 57 };
2d7ff710 58
59# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
60# define kAliHLTVoidDataOrigin "\0\0\0"
9ce4bf4a 61# define kAliHLTAnyDataTypeID "*******"
62# define kAliHLTAnyDataOrigin "***"
2d7ff710 63 const AliHLTComponentDataType kAliHLTVoidDataType = {sizeof(AliHLTComponentDataType), kAliHLTVoidDataTypeID, kAliHLTVoidDataOrigin};
9ce4bf4a 64 const AliHLTComponentDataType kAliHLTAnyDataType = {sizeof(AliHLTComponentDataType), kAliHLTAnyDataTypeID, kAliHLTAnyDataOrigin};
f23a6e1a 65
8ede8717 66 struct AliHLTComponentBlockData
f23a6e1a 67 {
68 AliHLTUInt32_t fStructSize;
8ede8717 69 AliHLTComponentShmData fShmKey;
f23a6e1a 70 AliHLTUInt32_t fOffset;
71 void* fPtr;
72 AliHLTUInt32_t fSize;
8ede8717 73 AliHLTComponentDataType fDataType;
f23a6e1a 74 AliHLTUInt32_t fSpecification;
75 };
76
8ede8717 77 struct AliHLTComponentTriggerData
f23a6e1a 78 {
79 AliHLTUInt32_t fStructSize;
80 AliHLTUInt32_t fDataSize;
81 void* fData;
82 };
83
8ede8717 84 struct AliHLTComponentEventDoneData
f23a6e1a 85 {
86 AliHLTUInt32_t fStructSize;
87 AliHLTUInt32_t fDataSize;
88 void* fData;
89 };
90
8ede8717 91 typedef int (*AliHLTfctLogging)( void* param, AliHLTComponentLogSeverity severity, const char* origin, const char* keyword, const char* message );
5ec8e281 92
f23a6e1a 93 struct AliHLTComponentEnvironment
94 {
95 AliHLTUInt32_t fStructSize;
96 void* fParam;
97 void* (*fAllocMemoryFunc)( void* param, unsigned long size );
98#if 0
8ede8717 99 int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); // future addition already foreseen/envisioned
f23a6e1a 100#endif
8ede8717 101 int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd );
5ec8e281 102 AliHLTfctLogging fLoggingFunc;
f23a6e1a 103 };
104}
105
8ede8717 106inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
71d7c760 107 {
21745ddc 108 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
71d7c760 109 if ( dt1.fID[i] != dt2.fID[i] )
110 return false;
21745ddc 111 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
71d7c760 112 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
113 return false;
114 return true;
115 }
116
8ede8717 117inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
71d7c760 118 {
21745ddc 119 for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
71d7c760 120 if ( dt1.fID[i] != dt2.fID[i] )
121 return true;
21745ddc 122 for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
71d7c760 123 if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
124 return true;
125 return false;
126 }
127
f23a6e1a 128#endif