core/vbl/io/vbl_io_quadruple.txx
Go to the documentation of this file.
00001 // This is core/vbl/io/vbl_io_quadruple.txx
00002 #ifndef vbl_io_quadruple_txx_
00003 #define vbl_io_quadruple_txx_
00004 //:
00005 // \file
00006 // \brief  binary IO functions for vbl_quadruple<S, T, U, V>
00007 // \author Ian Scott
00008 
00009 #include "vbl_io_quadruple.h"
00010 #include <vsl/vsl_binary_io.h>
00011 
00012 //====================================================================================
00013 //: Write pair to binary stream
00014 template <class S, class T, class U, class V>
00015 void vsl_b_write(vsl_b_ostream& s, const vbl_quadruple<S, T, U, V>& v)
00016 {
00017   // Do not write a version number here for space efficiency reasons.
00018   // There is no reason to expect the format to change
00019   vsl_b_write(s,v.first);
00020   vsl_b_write(s,v.second);
00021   vsl_b_write(s,v.third);
00022   vsl_b_write(s,v.fourth);
00023 }
00024 
00025 //====================================================================================
00026 //: Read pair from binary stream
00027 template <class S, class T, class U, class V>
00028 void vsl_b_read(vsl_b_istream& s, vbl_quadruple<S, T, U, V>& v)
00029 {
00030   vsl_b_read(s,v.first);
00031   vsl_b_read(s,v.second);
00032   vsl_b_read(s,v.third);
00033   vsl_b_read(s,v.fourth);
00034 }
00035 
00036 
00037 //====================================================================================
00038 //: Output a human readable summary to the stream
00039 template <class S, class T, class U, class V>
00040 void vsl_print_summary(vcl_ostream& os, const vbl_quadruple<S, T, U, V> &v)
00041 {
00042   os << "(";
00043   vsl_print_summary(os, v.first);
00044   os << ", ";
00045   vsl_print_summary(os, v.second);
00046   os << ", ";
00047   vsl_print_summary(os, v.third);
00048   os << ", ";
00049   vsl_print_summary(os, v.fourth);
00050   os << ")";
00051 }
00052 
00053 
00054 #undef VBL_QUADRUPLE_INSTANTIATE
00055 #define VBL_QUADRUPLE_INSTANTIATE(S, T, U, V ) \
00056 template void vsl_print_summary(vcl_ostream& s, const vbl_quadruple<S, T, U, V >& v); \
00057 template void vsl_b_write(vsl_b_ostream& s, const vbl_quadruple<S, T, U, V > & v); \
00058 template void vsl_b_read(vsl_b_istream& s, vbl_quadruple<S, T, U, V > & v)
00059 
00060 #endif // vbl_io_quadruple_txx_