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