Go to the documentation of this file.00001
00002 #ifndef vgl_io_conic_txx_
00003 #define vgl_io_conic_txx_
00004
00005
00006
00007 #include "vgl_io_conic.h"
00008 #include <vgl/vgl_conic.h>
00009 #include <vsl/vsl_binary_io.h>
00010
00011
00012
00013 template<class T>
00014 void vsl_b_write(vsl_b_ostream &os, vgl_conic<T> const& conic)
00015 {
00016 const short io_version_no = 1;
00017 vsl_b_write(os, io_version_no);
00018 vsl_b_write(os, conic.a());
00019 vsl_b_write(os, conic.b());
00020 vsl_b_write(os, conic.c());
00021 vsl_b_write(os, conic.d());
00022 vsl_b_write(os, conic.e());
00023 vsl_b_write(os, conic.f());
00024 }
00025
00026
00027
00028 template<class T>
00029 void vsl_b_read(vsl_b_istream &is, vgl_conic<T> & conic)
00030 {
00031 if (!is) return;
00032
00033 short v;
00034 vsl_b_read(is, v);
00035 switch (v)
00036 {
00037 case 1:
00038 T a, b, c, d, e, f;
00039 vsl_b_read(is, a);
00040 vsl_b_read(is, b);
00041 vsl_b_read(is, c);
00042 vsl_b_read(is, d);
00043 vsl_b_read(is, e);
00044 vsl_b_read(is, f);
00045 conic.set(a,b,c,d,e,f);
00046 break;
00047
00048 default:
00049 vcl_cerr << "I/O ERROR: vsl_b_read(vsl_b_istream&, vgl_conic<T>&)\n"
00050 << " Unknown version number "<< v << '\n';
00051 is.is().clear(vcl_ios::badbit);
00052 return;
00053 }
00054 }
00055
00056
00057
00058
00059 template<class T>
00060 void vsl_print_summary(vcl_ostream& os, vgl_conic<T> const& conic)
00061 {
00062 os<<conic;
00063 }
00064
00065 #undef VGL_IO_CONIC_INSTANTIATE
00066 #define VGL_IO_CONIC_INSTANTIATE(T) \
00067 template void vsl_print_summary(vcl_ostream &, vgl_conic<T > const&); \
00068 template void vsl_b_read(vsl_b_istream &, vgl_conic<T > &); \
00069 template void vsl_b_write(vsl_b_ostream &, vgl_conic<T > const&)
00070
00071 #endif // vgl_io_conic_txx_