H5DataTypes/src/LusiDiodeFexConfigV2.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: LusiDiodeFexConfigV2.cpp 6826 2013-09-24 21:08:01Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class LusiDiodeFexConfigV2...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "H5DataTypes/LusiDiodeFexConfigV2.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 #include <algorithm>
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 #include "hdf5pp/ArrayType.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/TypeTraits.h"
00029 #include "H5DataTypes/H5DataUtils.h"
00030 
00031 //-----------------------------------------------------------------------
00032 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00033 //-----------------------------------------------------------------------
00034 
00035 //              ----------------------------------------
00036 //              -- Public Function Member Definitions --
00037 //              ----------------------------------------
00038 
00039 namespace H5DataTypes {
00040 
00041 LusiDiodeFexConfigV2::LusiDiodeFexConfigV2 ( const XtcType& data )
00042 {
00043   const ndarray<const float, 1>& ndbase = data.base();
00044   std::copy( ndbase.begin(), ndbase.end(), base);
00045   const ndarray<const float, 1>& ndscale = data.scale();
00046   std::copy( ndscale.begin(), ndscale.end(), scale);
00047 }
00048 
00049 hdf5pp::Type
00050 LusiDiodeFexConfigV2::stored_type()
00051 {
00052   return native_type() ;
00053 }
00054 
00055 hdf5pp::Type
00056 LusiDiodeFexConfigV2::native_type()
00057 {
00058   hdf5pp::CompoundType confType = hdf5pp::CompoundType::compoundType<LusiDiodeFexConfigV2>() ;
00059   confType.insert_native<float>( "base", offsetof(LusiDiodeFexConfigV2, base), XtcType::NRANGES );
00060   confType.insert_native<float>( "scale", offsetof(LusiDiodeFexConfigV2, scale), XtcType::NRANGES );
00061 
00062   return confType ;
00063 }
00064 
00065 void
00066 LusiDiodeFexConfigV2::store( const XtcType& config, hdf5pp::Group grp )
00067 {
00068   // make scalar data set for main object
00069   LusiDiodeFexConfigV2 data ( config ) ;
00070   storeDataObject ( data, "config", grp ) ;
00071 }
00072 
00073 } // namespace H5DataTypes

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7