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 | |
75 | struct AliHLTComponentEnvironment |
76 | { |
77 | AliHLTUInt32_t fStructSize; |
78 | void* fParam; |
79 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); |
80 | #if 0 |
81 | int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponent_BlockData* blockLocation ); // future addition already foreseen/envisioned |
82 | #endif |
83 | int (*fMakeOutputDataBlockListFunc)( void* param, const vector<AliHLTComponent_BlockData>& blocks, AliHLTUInt32_t* blockCount, AliHLTComponent_BlockData** outputBlocks ); |
84 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponent_EventDoneData** edd ); |
85 | int (*fLoggingFunc)( void* param, AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* message ); |
86 | }; |
87 | } |
88 | |
71d7c760 |
89 | inline bool operator==( const AliHLTComponent_DataType& dt1, const AliHLTComponent_DataType& dt2 ) |
90 | { |
91 | for ( unsigned i = 0; i < 8; i++ ) |
92 | if ( dt1.fID[i] != dt2.fID[i] ) |
93 | return false; |
94 | for ( unsigned i = 0; i < 4; i++ ) |
95 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) |
96 | return false; |
97 | return true; |
98 | } |
99 | |
100 | inline bool operator!=( const AliHLTComponent_DataType& dt1, const AliHLTComponent_DataType& dt2 ) |
101 | { |
102 | for ( unsigned i = 0; i < 8; i++ ) |
103 | if ( dt1.fID[i] != dt2.fID[i] ) |
104 | return true; |
105 | for ( unsigned i = 0; i < 4; i++ ) |
106 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) |
107 | return true; |
108 | return false; |
109 | } |
110 | |
f23a6e1a |
111 | #endif |