CMS 3D CMS Logo

DTFileReaderHelpers.h
Go to the documentation of this file.
1 #include <cstdint>
2 #ifndef DaqSource_DTFileReaderHelpers_h
3 #define DaqSource_DTFileReaderHelpers_h
4 
5 template <class T>
6 char* dataPointer(const T* ptr) {
7  union bPtr {
8  const T* dataP;
9  char* fileP;
10  };
11  union bPtr buf;
12  buf.dataP = ptr;
13  return buf.fileP;
14 }
15 
16 template <class T>
17 T* typePointer(const char* ptr) {
18  union bPtr {
19  T* dataP;
20  const char* fileP;
21  };
22  union bPtr buf;
23  buf.fileP = ptr;
24  return buf.dataP;
25 }
26 
27 struct twoNibble {
28  uint16_t lsBits;
29  uint16_t msBits;
30 };
31 
32 struct twoNibble64 {
33  uint32_t lsBits;
34  uint32_t msBits;
35 };
36 
37 #endif
T * typePointer(const char *ptr)
long double T
char * dataPointer(const T *ptr)