00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: Gsc16aiDataV1.cpp 6826 2013-09-24 21:08:01Z salnikov@SLAC.STANFORD.EDU $ 00004 // 00005 // Description: 00006 // Class Gsc16aiDataV1... 00007 // 00008 // Author List: 00009 // Andy Salnikov 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------------- 00014 // This Class's Header -- 00015 //----------------------- 00016 #include "H5DataTypes/Gsc16aiDataV1.h" 00017 00018 //----------------- 00019 // C/C++ Headers -- 00020 //----------------- 00021 #include <algorithm> 00022 00023 //------------------------------- 00024 // Collaborating Class Headers -- 00025 //------------------------------- 00026 #include "hdf5pp/CompoundType.h" 00027 #include "hdf5pp/ArrayType.h" 00028 #include "hdf5pp/TypeTraits.h" 00029 00030 //----------------------------------------------------------------------- 00031 // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- 00032 //----------------------------------------------------------------------- 00033 00034 // ---------------------------------------- 00035 // -- Public Function Member Definitions -- 00036 // ---------------------------------------- 00037 00038 namespace H5DataTypes { 00039 00040 //---------------- 00041 // Constructors -- 00042 //---------------- 00043 Gsc16aiDataV1::Gsc16aiDataV1(const XtcType& data) 00044 { 00045 const ndarray<const uint16_t, 1>& timestamp = data.timestamp(); 00046 std::copy(timestamp.begin(), timestamp.end(), this->_timestamp); 00047 } 00048 00049 hdf5pp::Type 00050 Gsc16aiDataV1::stored_type() 00051 { 00052 return native_type(); 00053 } 00054 00055 hdf5pp::Type 00056 Gsc16aiDataV1::native_type() 00057 { 00058 return hdf5pp::ArrayType::arrayType<uint16_t>(NTimestamps); 00059 } 00060 00061 hdf5pp::Type 00062 Gsc16aiDataV1::stored_data_type(const ConfigXtcType& config) 00063 { 00064 unsigned size = config.lastChan() - config.firstChan() + 1; 00065 return hdf5pp::ArrayType::arrayType<uint16_t>(size); 00066 } 00067 00068 } // namespace H5DataTypes