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 |
14 | using namespace std; |
f23a6e1a |
15 | |
16 | extern "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 | |
5f5b708b |
28 | enum AliHLTComponentLogSeverity { kHLTLogNone=0, kHLTLogBenchmark=1, kHLTLogDebug=2, kHLTLogInfo=4, kHLTLogWarning=8, kHLTLogError=16, kHLTLogFatal=32, kHLTLogAll=0x3f, kHLTLogDefault=0x3d }; |
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}; |
a655eae3 |
65 | const AliHLTUInt32_t kAliHLTVoidDataSpec = ~(AliHLTUInt32_t)0; |
f23a6e1a |
66 | |
8ede8717 |
67 | struct AliHLTComponentBlockData |
f23a6e1a |
68 | { |
69 | AliHLTUInt32_t fStructSize; |
8ede8717 |
70 | AliHLTComponentShmData fShmKey; |
f23a6e1a |
71 | AliHLTUInt32_t fOffset; |
72 | void* fPtr; |
73 | AliHLTUInt32_t fSize; |
8ede8717 |
74 | AliHLTComponentDataType fDataType; |
f23a6e1a |
75 | AliHLTUInt32_t fSpecification; |
76 | }; |
77 | |
8ede8717 |
78 | struct AliHLTComponentTriggerData |
f23a6e1a |
79 | { |
80 | AliHLTUInt32_t fStructSize; |
81 | AliHLTUInt32_t fDataSize; |
82 | void* fData; |
83 | }; |
84 | |
8ede8717 |
85 | struct AliHLTComponentEventDoneData |
f23a6e1a |
86 | { |
87 | AliHLTUInt32_t fStructSize; |
88 | AliHLTUInt32_t fDataSize; |
89 | void* fData; |
90 | }; |
91 | |
8ede8717 |
92 | typedef int (*AliHLTfctLogging)( void* param, AliHLTComponentLogSeverity severity, const char* origin, const char* keyword, const char* message ); |
5ec8e281 |
93 | |
f23a6e1a |
94 | struct AliHLTComponentEnvironment |
95 | { |
96 | AliHLTUInt32_t fStructSize; |
97 | void* fParam; |
98 | void* (*fAllocMemoryFunc)( void* param, unsigned long size ); |
99 | #if 0 |
8ede8717 |
100 | int (*fAllocShmMemoryFunc)( void* param, unsigned long size, AliHLTComponentBlockData* blockLocation ); // future addition already foreseen/envisioned |
f23a6e1a |
101 | #endif |
8ede8717 |
102 | int (*fGetEventDoneDataFunc)( void* param, AliHLTEventID_t eventID, unsigned long size, AliHLTComponentEventDoneData** edd ); |
5ec8e281 |
103 | AliHLTfctLogging fLoggingFunc; |
f23a6e1a |
104 | }; |
105 | } |
106 | |
8ede8717 |
107 | inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
71d7c760 |
108 | { |
21745ddc |
109 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) |
71d7c760 |
110 | if ( dt1.fID[i] != dt2.fID[i] ) |
111 | return false; |
21745ddc |
112 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) |
71d7c760 |
113 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) |
114 | return false; |
115 | return true; |
116 | } |
117 | |
8ede8717 |
118 | inline bool operator!=( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 ) |
71d7c760 |
119 | { |
21745ddc |
120 | for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ ) |
71d7c760 |
121 | if ( dt1.fID[i] != dt2.fID[i] ) |
122 | return true; |
21745ddc |
123 | for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) |
71d7c760 |
124 | if ( dt1.fOrigin[i] != dt2.fOrigin[i] ) |
125 | return true; |
126 | return false; |
127 | } |
128 | |
f23a6e1a |
129 | #endif |