28 namespace astrotypes {
32 template<
typename HeaderType>
33 FileWriter<HeaderType>::FileWriter(std::string
const& file_name)
38 template<
typename HeaderType>
39 FileWriter<HeaderType>::FileWriter(std::string
const& file_name, HeaderType
const& header)
45 template<
typename HeaderType>
46 FileWriter<HeaderType>::~FileWriter()
50 template<
typename HeaderType>
51 void FileWriter<HeaderType>::open(std::string
const& file_name)
53 if(_stream.is_open()) _stream.close();
57 template<
typename HeaderType>
58 void FileWriter<HeaderType>::do_open(std::string
const& file_name)
60 _file_name = file_name;
61 _stream.open(_file_name, std::ios::out | std::ios::binary);
62 if(!_stream)
throw std::runtime_error(file_name +
" failed to open");
66 template<
typename HeaderType>
67 template<
typename DataType>
68 typename std::enable_if<has_dimensions<DataType, units::Time, units::Frequency>::value, FileWriter<HeaderType>>::type &
71 BaseT::write(_stream, data);
std::ostream & operator<<(std::ostream &os, SlicePosition< Rank > const &pos)
void do_open(std::string const &file_name)