vbl_io_quadruple.hxx
Go to the documentation of this file.
1 // This is core/vbl/io/vbl_io_quadruple.hxx
2 #ifndef vbl_io_quadruple_hxx_
3 #define vbl_io_quadruple_hxx_
4 //:
5 // \file
6 // \brief binary IO functions for vbl_quadruple<S, T, U, V>
7 // \author Ian Scott
8 
9 #include "vbl_io_quadruple.h"
10 #include <vsl/vsl_binary_io.h>
11 
12 //====================================================================================
13 //: Write pair to binary stream
14 template <class S, class T, class U, class V>
15 void vsl_b_write(vsl_b_ostream& s, const vbl_quadruple<S, T, U, V>& v)
16 {
17  // Do not write a version number here for space efficiency reasons.
18  // There is no reason to expect the format to change
19  vsl_b_write(s,v.first);
20  vsl_b_write(s,v.second);
21  vsl_b_write(s,v.third);
22  vsl_b_write(s,v.fourth);
23 }
24 
25 //====================================================================================
26 //: Read pair from binary stream
27 template <class S, class T, class U, class V>
28 void vsl_b_read(vsl_b_istream& s, vbl_quadruple<S, T, U, V>& v)
29 {
30  vsl_b_read(s,v.first);
31  vsl_b_read(s,v.second);
32  vsl_b_read(s,v.third);
33  vsl_b_read(s,v.fourth);
34 }
35 
36 
37 //====================================================================================
38 //: Output a human readable summary to the stream
39 template <class S, class T, class U, class V>
40 void vsl_print_summary(std::ostream& os, const vbl_quadruple<S, T, U, V> &v)
41 {
42  os << "(";
43  vsl_print_summary(os, v.first);
44  os << ", ";
46  os << ", ";
47  vsl_print_summary(os, v.third);
48  os << ", ";
50  os << ")";
51 }
52 
53 
54 #undef VBL_QUADRUPLE_INSTANTIATE
55 #define VBL_QUADRUPLE_INSTANTIATE(S, T, U, V ) \
56 template void vsl_print_summary(std::ostream& s, const vbl_quadruple<S, T, U, V >& v); \
57 template void vsl_b_write(vsl_b_ostream& s, const vbl_quadruple<S, T, U, V > & v); \
58 template void vsl_b_read(vsl_b_istream& s, vbl_quadruple<S, T, U, V > & v)
59 
60 #endif // vbl_io_quadruple_hxx_
void vsl_b_write(vsl_b_ostream &s, const vbl_quadruple< S, T, U, V > &v)
Write pair to binary stream.
void vsl_b_read(vsl_b_istream &s, vbl_quadruple< S, T, U, V > &v)
Read pair from binary stream.
binary IO functions for vbl_quadruple<S, T, U>
void vsl_print_summary(std::ostream &os, const vbl_quadruple< S, T, U, V > &v)
Output a human readable summary to the stream.
a templated 4-tuple.
Definition: vbl_quadruple.h:15