// // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifndef SOCI_BOOST_TUPLE_H_INCLUDED #define SOCI_BOOST_TUPLE_H_INCLUDED #include "values.h" #include "type-conversion-traits.h" #include namespace soci { template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out) >> boost::tuples::get<5>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in) << boost::tuples::get<5>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out) >> boost::tuples::get<5>(out) >> boost::tuples::get<6>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in) << boost::tuples::get<5>(in) << boost::tuples::get<6>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out) >> boost::tuples::get<5>(out) >> boost::tuples::get<6>(out) >> boost::tuples::get<7>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in) << boost::tuples::get<5>(in) << boost::tuples::get<6>(in) << boost::tuples::get<7>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out) >> boost::tuples::get<5>(out) >> boost::tuples::get<6>(out) >> boost::tuples::get<7>(out) >> boost::tuples::get<8>(out); } static void to_base(boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in) << boost::tuples::get<5>(in) << boost::tuples::get<6>(in) << boost::tuples::get<7>(in) << boost::tuples::get<8>(in); } }; template struct type_conversion > { typedef values base_type; static void from_base(base_type const & in, indicator ind, boost::tuple & out) { in >> boost::tuples::get<0>(out) >> boost::tuples::get<1>(out) >> boost::tuples::get<2>(out) >> boost::tuples::get<3>(out) >> boost::tuples::get<4>(out) >> boost::tuples::get<5>(out) >> boost::tuples::get<6>(out) >> boost::tuples::get<7>(out) >> boost::tuples::get<8>(out) >> boost::tuples::get<9>(out); } static void to_base( boost::tuple & in, base_type & out, indicator & ind) { out << boost::tuples::get<0>(in) << boost::tuples::get<1>(in) << boost::tuples::get<2>(in) << boost::tuples::get<3>(in) << boost::tuples::get<4>(in) << boost::tuples::get<5>(in) << boost::tuples::get<6>(in) << boost::tuples::get<7>(in) << boost::tuples::get<8>(in) << boost::tuples::get<9>(in); } }; } // namespace soci #endif // SOCI_BOOST_TUPLE_H_INCLUDED