CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/IORawData/DTCommissioning/src/DTFileReaderHelpers.h

Go to the documentation of this file.
00001 #ifndef DaqSource_DTFileReaderHelpers_h
00002 #define DaqSource_DTFileReaderHelpers_h
00003 
00004 #include <boost/cstdint.hpp>
00005 
00006 template<class T> char* dataPointer( const T* ptr ) {
00007   union bPtr {
00008     const T* dataP;
00009     char*    fileP;
00010   };
00011   union bPtr buf;
00012   buf.dataP = ptr;
00013   return buf.fileP;
00014 }
00015 
00016 
00017 template<class T> T* typePointer( const char* ptr ) {
00018   union bPtr {
00019     T*          dataP;
00020     const char* fileP;
00021   };
00022   union bPtr buf;
00023   buf.fileP = ptr;
00024   return buf.dataP;
00025 }
00026 
00027 struct twoNibble {
00028   uint16_t lsBits;
00029   uint16_t msBits;
00030 };
00031 
00032 struct twoNibble64 {
00033   uint32_t lsBits;
00034   uint32_t msBits;
00035 };
00036 
00037 #endif