File indexing completed on 2023-03-17 11:10:31
0001 #include <cstdint>
0002 #ifndef DaqSource_DTFileReaderHelpers_h
0003 #define DaqSource_DTFileReaderHelpers_h
0004
0005 template <class T>
0006 char* dataPointer(const T* ptr) {
0007 union bPtr {
0008 const T* dataP;
0009 char* fileP;
0010 };
0011 union bPtr buf;
0012 buf.dataP = ptr;
0013 return buf.fileP;
0014 }
0015
0016 template <class T>
0017 T* typePointer(const char* ptr) {
0018 union bPtr {
0019 T* dataP;
0020 const char* fileP;
0021 };
0022 union bPtr buf;
0023 buf.fileP = ptr;
0024 return buf.dataP;
0025 }
0026
0027 struct twoNibble {
0028 uint16_t lsBits;
0029 uint16_t msBits;
0030 };
0031
0032 struct twoNibble64 {
0033 uint32_t lsBits;
0034 uint32_t msBits;
0035 };
0036
0037 #endif