]>
Commit | Line | Data |
---|---|---|
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 | ||
fa2e9b7c | 14 | /* #include <vector> */ |
15 | /* using namespace std; */ | |
f23a6e1a | 16 | |
17 | extern "C" { | |
18 | ||
19 | typedef unsigned char AliHLTUInt8_t; | |
20 | ||
71d7c760 | 21 | typedef unsigned short AliHLTUInt16_t; |
22 | ||
f23a6e1a | 23 | typedef unsigned int AliHLTUInt32_t; |
24 | ||
25 | typedef unsigned long long AliHLTUInt64_t; | |
26 | ||
27 | typedef AliHLTUInt64_t AliHLTEventID_t; | |
28 | ||
85465857 | 29 | enum AliHLTComponent_LogSeverity { kHLTLogNone=0, kHLTLogBenchmark=1, kHLTLogDebug=2, kHLTLogInfo=4, kHLTLogWarning=8, kHLTLogError=16, kHLTLogFatal=32, kHLTLogAll=0x3f, kHLTLogDefault=0x39 }; |
f23a6e1a | 30 | |
31 | struct AliHLTComponent_EventData | |
32 | { | |
33 | AliHLTUInt32_t fStructSize; | |
34 | AliHLTEventID_t fEventID; | |
35 | AliHLTUInt32_t fEventCreation_s; | |
36 | AliHLTUInt32_t fEventCreation_us; | |
37 | AliHLTUInt32_t fBlockCnt; | |
38 | }; | |
39 | ||
40 | struct AliHLTComponent_ShmData | |
41 | { | |
42 | AliHLTUInt32_t fStructSize; | |
43 | AliHLTUInt32_t fShmType; | |
44 | AliHLTUInt64_t fShmID; | |
45 | }; | |
71d7c760 | 46 | const AliHLTUInt32_t gkAliHLTComponent_InvalidShmType = 0; |
47 | const AliHLTUInt64_t gkAliHLTComponent_InvalidShmID = ~(AliHLTUInt64_t)0; | |
48 | ||
f23a6e1a | 49 | struct AliHLTComponent_DataType |
50 | { | |
51 | AliHLTUInt32_t fStructSize; | |
52 | char fID[8]; | |
53 | char fOrigin[4]; | |
54 | }; | |
55 | ||
56 | struct AliHLTComponent_BlockData | |
57 | { | |
58 | AliHLTUInt32_t fStructSize; | |
59 | AliHLTComponent_ShmData fShmKey; | |
60 | AliHLTUInt32_t fOffset; | |
61 | void* fPtr; | |
62 | AliHLTUInt32_t fSize; | |
63 | AliHLTComponent_DataType fDataType; | |
64 | AliHLTUInt32_t fSpecification; | |
65 | }; | |
66 | ||
67 | struct AliHLTComponent_TriggerData | |
68 | { | |
69 | AliHLTUInt32_t fStructSize; | |
70 | AliHLTUInt32_t fDataSize; | |
71 | void* fData; | |
72 | }; | |
73 | ||
74 | struct AliHLTComponent_EventDoneData | |
75 | { | |
76 | AliHLTUInt32_t fStructSize; | |
77 | AliHLTUInt32_t fDataSize; | |
78 | void* fData; | |
79 | }; | |
80 | ||
5ec8e281 | 81 | typedef int (*AliHLTfctLogging)( void* param, AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* message ); |
82 | ||
f23a6e1a | 83 | struct AliHLTComponentEnvironment |
84 | { | |
85 | AliHLTUInt32_t fStructSize; | |
86 | void* fParam; | |
87 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); | |
88 | #if 0 | |
89 | int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponent_BlockData* blockLocation ); // future addition already foreseen/envisioned | |
90 | #endif | |
fa2e9b7c | 91 | /* int (*fMakeOutputDataBlockListFunc)( void* param, const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount, AliHLTComponent_BlockData** outputBlocks ); */ |
f23a6e1a | 92 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponent_EventDoneData** edd ); |
5ec8e281 | 93 | AliHLTfctLogging fLoggingFunc; |
f23a6e1a | 94 | }; |
95 | } | |
96 | ||
71d7c760 | 97 | inline bool operator==( const AliHLTComponent_DataType& dt1, const AliHLTComponent_DataType& dt2 ) |
98 | { | |
99 | for ( unsigned i = 0; i < 8; i++ ) | |
100 | if ( dt1.fID[i] != dt2.fID[i] ) | |
101 | return false; | |
102 | for ( unsigned i = 0; i < 4; i++ ) | |
103 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) | |
104 | return false; | |
105 | return true; | |
106 | } | |
107 | ||
108 | inline bool operator!=( const AliHLTComponent_DataType& dt1, const AliHLTComponent_DataType& dt2 ) | |
109 | { | |
110 | for ( unsigned i = 0; i < 8; i++ ) | |
111 | if ( dt1.fID[i] != dt2.fID[i] ) | |
112 | return true; | |
113 | for ( unsigned i = 0; i < 4; i++ ) | |
114 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) | |
115 | return true; | |
116 | return false; | |
117 | } | |
118 | ||
f23a6e1a | 119 | #endif |