FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sMbs.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #ifndef MbsStruct
9 #define MbsStruct
10 
11 #define LMD__TYPE_FILE_HEADER_101_1 0x00010065
12 #define LMD__TYPE_EVENT_HEADER_10_1 0x0001000a
13 #define LMD__TYPE_FILE_INDEX_101_2 0x00020065
14 #define LMD__TYPE_BUFFER_HEADER_10_1 0x0001000a
15 #define LMD__TYPE_BUFFER_HEADER_100_1 0x00010064
16 #define LMD__TYPE_TIME_STAMP_11_1 0x0001000b
17 #define LMD__GET_EVENTS NULL
18 #define LMD__STANDARD_HEADER NULL
19 #define LMD__INTERNAL_HEADER NULL
20 #define LMD__INDEX 1
21 #define LMD__OVERWRITE 1
22 #define LMD__LARGE_FILE 1
23 #define LMD__MIN_BUFFER 0
24 #define LMD__BUFFER 1
25 #define LMD__VERBOSE 1
26 #define LMD__NO_VERBOSE 0
27 #define LMD__NO_BUFFER 0
28 #define LMD__NO_INDEX 0
29 #define LMD__NO_OVERWRITE 0
30 #define LMD__NO_LARGE_FILE 0
31 #define LMD__NO_VERBOSE 0
32 #define LMD__VERBOSE 1
33 #define LMD__ENDIAN_LITTLE 1
34 #define LMD__ENDIAN_BIG 2
35 #define LMD__ENDIAN_UNKNOWN 0
36 
37 #include "s_stdint.h"
38 
39 typedef uint64_t lmdoff_t;
40 
41 // must #include <stdint.h>
42 // on Lynx, define int32_t, uint32_t, int16_t
43 // structure used to talk between client and server
44 // Client connects to server (MBS) and reads this structure first
45 
46 //--------------------------------------------------
47 // Structure maps the MBS transport info buffer
48 typedef struct
49 {
50  uint32_t iEndian; // byte order. Set to 1 by sender
51  uint32_t iMaxBytes; // maximum buffer size
52  uint32_t iBuffers; // buffers per stream
53  uint32_t iStreams; // number of streams
55 
56 //--------------------------------------------------
57 // Buffer header, maps s_bufhe, some fields used in different way
58 typedef struct
59 {
60  uint32_t iMaxWords; // compatible with s_bufhe (total buffer size - header)
61  uint32_t iType; // compatible with s_bufhe, low=type (=100), high=subtype
62  uint32_t iUsed; // not used for iMaxWords>MAX__DLEN (16360), low 16bits only
63  uint32_t iBuffer; // compatible with s_bufhe
64  uint32_t iElements; // compatible with s_bufhe
65  uint32_t iTemp; // Used volatile
66  uint32_t iTimeSpecSec; // compatible with s_bufhe (2*32bit)
67  uint32_t iTimeSpecNanoSec; // compatible with s_bufhe (2*32bit)
68  // struct timespec TimeSpec;
69  uint32_t iEndian; // compatible with s_bufhe free[0]
70  uint32_t iWrittenEndian; // one of LMD__ENDIAN_x
71  uint32_t iUsedWords; // total words without header to read for type=100, free[2]
72  uint32_t iFree3; // free[3]
74 
75 //--------------------------------------------------
76 // Buffer header, maps s_bufhe
77 typedef struct
78 {
79  uint32_t iMaxWords; // compatible with s_bufhe (total buffer size - header)
80  uint32_t iType; // compatible with s_bufhe, low=type (=100), high=subtype
81  lmdoff_t iTableOffset; // optional offset to element offset table in file
82  uint32_t iElements; // compatible with s_bufhe
83  uint32_t iOffsetSize; // Offset size, 4 or 8 [bytes]
84  uint32_t iTimeSpecSec; // compatible with s_bufhe (2*32bit)
85  uint32_t iTimeSpecNanoSec; // compatible with s_bufhe (2*32bit)
86  // struct timespec TimeSpec;
87  uint32_t iEndian; // compatible with s_bufhe free[0]
88  uint32_t iWrittenEndian; // one of LMD__ENDIAN_x
89  uint32_t iUsedWords; // total words without header to read for type=100, free[2]
90  uint32_t iFree3; // free[3]
92 
93 //--------------------------------------------------
94 typedef struct
95 {
100 } sMbsTimeStamp;
101 
102 //--------------------------------------------------
103 // maps s_evhe
104 typedef struct
105 {
106  uint32_t iWords; // following data words
107  uint32_t iType; // compatible with s_ve10_1, low=type (=10), high=subtype
108 } sMbsHeader;
109 
110 //--------------------------------------------------
111 // maps s_ve10_1
112 typedef struct
113 {
114  uint32_t iWords; // data words + 4
115  uint32_t iType; // compatible with s_ve10_1, low=type (=10), high=subtype
119 
120 //--------------------------------------------------
121 // maps s_ves10_1
122 typedef struct
123 {
124  uint32_t iWords; // data words + 2
125  uint32_t iType; // compatible with s_ves10_1, low=type (=10), high=subtype
126  uint32_t iSubeventID; // 2 low bytes=procid, next byte=subcrate, high byte control
128 #endif
uint32_t iWords
Definition: sMbs.h:124
uint32_t iFree3
Definition: sMbs.h:90
uint32_t iTimeSpecNanoSec
Definition: sMbs.h:99
uint32_t iTrigger
Definition: sMbs.h:116
uint32_t iElements
Definition: sMbs.h:64
uint32_t iType
Definition: sMbs.h:125
uint32_t iTimeSpecSec
Definition: sMbs.h:66
uint32_t iType
Definition: sMbs.h:80
uint32_t iMaxWords
Definition: sMbs.h:60
uint32_t iWrittenEndian
Definition: sMbs.h:70
uint32_t iBuffer
Definition: sMbs.h:63
lmdoff_t iTableOffset
Definition: sMbs.h:81
uint32_t iWords
Definition: sMbs.h:106
uint32_t iTimeSpecSec
Definition: sMbs.h:84
uint32_t iFree3
Definition: sMbs.h:72
uint32_t iType
Definition: sMbs.h:61
uint32_t iType
Definition: sMbs.h:115
uint32_t iTimeSpecNanoSec
Definition: sMbs.h:85
uint64_t lmdoff_t
Definition: sMbs.h:39
uint32_t iMaxWords
Definition: sMbs.h:79
uint32_t iElements
Definition: sMbs.h:82
uint32_t iType
Definition: sMbs.h:107
uint32_t iTimeSpecSec
Definition: sMbs.h:98
uint32_t iTimeSpecNanoSec
Definition: sMbs.h:67
uint32_t iUsedWords
Definition: sMbs.h:71
uint32_t iEventNumber
Definition: sMbs.h:117
uint32_t iMaxBytes
Definition: sMbs.h:51
uint32_t iEndian
Definition: sMbs.h:69
uint32_t iOffsetSize
Definition: sMbs.h:83
uint32_t iTemp
Definition: sMbs.h:65
uint32_t iUsedWords
Definition: sMbs.h:89
unsigned int uint32_t
uint32_t iWords
Definition: sMbs.h:114
uint32_t iEndian
Definition: sMbs.h:50
uint32_t iEndian
Definition: sMbs.h:87
uint32_t iBuffers
Definition: sMbs.h:52
uint32_t iUsed
Definition: sMbs.h:62
uint32_t iType
Definition: sMbs.h:97
uint32_t iMaxWords
Definition: sMbs.h:96
uint32_t iStreams
Definition: sMbs.h:53
uint32_t iWrittenEndian
Definition: sMbs.h:88
uint32_t iSubeventID
Definition: sMbs.h:126