26 namespace astrotypes {
31 template<
typename IteratorType,
typename IteratorTag,
typename ValueType>
33 static void exec(IteratorType begin, IteratorType
const end, std::ostream& os) {
35 os.write(reinterpret_cast<const char*>(&(*begin)),
sizeof(ValueType));
42 template<
typename IteratorType,
typename ValueType>
43 struct do_write<IteratorType,
std::random_access_iterator_tag, ValueType>
46 static void exec(IteratorType begin, IteratorType
const end, std::ostream& os) {
47 os.write(reinterpret_cast<const char*>(&(*begin)), std::distance(begin, end) *
sizeof(ValueType));
51 template<
typename IteratorType,
typename IteratorTag,
typename ValueType>
53 static void exec(IteratorType begin, IteratorType
const end, std::istream& is) {
55 is.read(reinterpret_cast<char*>(&(*begin)),
sizeof(ValueType));
61 template<
typename IteratorType,
typename ValueType>
62 struct do_read<IteratorType,
std::random_access_iterator_tag, ValueType>
64 static void exec(IteratorType begin, IteratorType
const end, std::istream& is) {
65 is.read(reinterpret_cast<char*>(&(*begin)), std::distance(begin, end) *
sizeof(ValueType));
70 template<
typename IteratorType>
71 void write(IteratorType begin, IteratorType
const end, std::ostream& os) {
73 ,
typename std::iterator_traits<typename std::remove_reference<IteratorType>::type>::iterator_category
74 ,
typename std::iterator_traits<typename std::remove_reference<IteratorType>::type>::value_type
75 >::exec(begin, end, os);
78 template<
typename IteratorType>
79 void read(IteratorType begin, IteratorType
const end, std::istream& is) {
81 ,
typename std::iterator_traits<typename std::remove_reference<IteratorType>::type>::iterator_category
82 ,
typename std::iterator_traits<typename std::remove_reference<IteratorType>::type>::value_type
83 >::exec(begin, end, is);
88 typename std::enable_if<has_exact_dimensions<T, units::Time, units::Frequency>::value, SigProcFormat<units::Time, units::Frequency>::ISigProcFormat
const&>::type
91 read(d.begin(), d.end(), _is);
99 read(d.begin(), d.end(), _is);
107 write(d.cbegin(), d.cend(), _os);
117 auto spectrum = d[spectrum_num];
118 read(spectrum.begin(), spectrum.end(), _is);
127 write(d.cbegin(), d.cend(), _os);
135 write(d.cbegin(), d.cend(), _os);
145 auto const spectrum = d[spectrum_num];
146 write(spectrum.cbegin(), spectrum.cend(), _os);
151 template<
typename T,
typename Alloc>
156 auto const& channel = d.
channel(channel_num);
157 write(channel.cbegin(), channel.cend(), _os);
162 template<
typename T,
typename Alloc>
175 auto channel = d.channel(channel_num);
176 read(channel.begin(), channel.end(), _is);
185 read(d.begin(), d.end(), _is);
193 write(d.cbegin(), d.cend(), _os);
201 write(d.cbegin(), d.cend(), _os);
207 return OSigProcFormat(os);
212 return ISigProcFormat(is);
217 return OSigProcFormat(os);
222 return ISigProcFormat(is);
225 template<
typename Dimension1,
typename Dimension2>
231 template<
typename Dimension1,
typename Dimension2>
const_iterator cend() const
A tagged dimensionIndex variable.
const_iterator cbegin() const
A template class representing values associated with a time and frequecny such as Stokes values or vo...
SigProcFormat< Dimension1, Dimension2 >::ISigProcFormat operator>>(std::istream &is, SigProcFormat< Dimension1, Dimension2 > const &f)
A template class representing values associated with a time and frequecny such as Stokes values or vo...
std::istream & operator>>(std::istream &stream, HeaderBase< Derived > &headers)
Channel channel(std::size_t channel_number)
retrun a single channel across all time samples
SigProcFormat< Dimension1, Dimension2 >::OSigProcFormat operator<<(std::ostream &os, SigProcFormat< Dimension1, Dimension2 > const &f)