core/vbl/io/vbl_io_triple.txx
Go to the documentation of this file.
00001 // This is core/vbl/io/vbl_io_triple.txx
00002 #ifndef vbl_io_triple_txx_
00003 #define vbl_io_triple_txx_
00004 //:
00005 // \file
00006 // \brief  binary IO functions for vbl_triple<S, T, U>
00007 // \author Ian Scott
00008 
00009 #include "vbl_io_triple.h"
00010 #include <vsl/vsl_binary_io.h>
00011 
00012 //====================================================================================
00013 //: Write pair to binary stream
00014 template <class S, class T, class U>
00015 void vsl_b_write(vsl_b_ostream& s, const vbl_triple<S, T, U>& 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 }
00023 
00024 //====================================================================================
00025 //: Read pair from binary stream
00026 template <class S, class T, class U>
00027 void vsl_b_read(vsl_b_istream& s, vbl_triple<S, T, U>& v)
00028 {
00029   vsl_b_read(s,v.first);
00030   vsl_b_read(s,v.second);
00031   vsl_b_read(s,v.third);
00032 }
00033 
00034 
00035 //====================================================================================
00036 //: Output a human readable summary to the stream
00037 template <class S, class T, class U>
00038 void vsl_print_summary(vcl_ostream& os, const vbl_triple<S, T, U> &v)
00039 {
00040   os << "(";
00041   vsl_print_summary(os, v.first);
00042   os << ", ";
00043   vsl_print_summary(os, v.second);
00044   os << ", ";
00045   vsl_print_summary(os, v.third);
00046   os << ")";
00047 }
00048 
00049 
00050 #undef VBL_IO_TRIPLE_INSTANTIATE
00051 #define VBL_IO_TRIPLE_INSTANTIATE(S, T, U ) \
00052 template void vsl_print_summary(vcl_ostream& s, const vbl_triple<S, T, U >& v); \
00053 template void vsl_b_write(vsl_b_ostream& s, const vbl_triple<S, T, U > & v); \
00054 template void vsl_b_read(vsl_b_istream& s, vbl_triple<S, T, U > & v)
00055 
00056 #endif // vbl_io_triple_txx_