template class tuple; #undef IDENTITY #define IDENTITY(...) __VA_ARGS__ #undef TUPLE #define TUPLE(ID, types) \ template <> class tuple : public boost::tuple \ { \ public: \ tuple(const boost::tuple &t) \ : boost::tuple(t) {} \ \ tuple(const std::string &data) \ { \ std::istringstream is(data); \ process::tuples::deserializer d(is); \ deserialize(d, *this); \ } \ \ operator std::string () const \ { \ std::ostringstream os; \ process::tuples::serializer s(os); \ serialize(s, *this); \ return os.str(); \ } \ } inline void serialize(process::tuples::serializer &s, const boost::tuples::null_type &) { } template inline void serialize(process::tuples::serializer &s, const boost::tuples::cons &c) { s & c.get_head(); serialize(s, c.get_tail()); } inline void deserialize(process::tuples::deserializer &d, const boost::tuples::null_type &) { } template inline void deserialize(process::tuples::deserializer &d, boost::tuples::cons &c) { d & c.get_head(); deserialize(d, c.get_tail()); } template tuple pack() { return tuple(::boost::make_tuple()); } template tuple pack(const T0 &t0) { return tuple(::boost::make_tuple(t0)); } template tuple pack(const T0 &t0, const T1 &t1) { return tuple(::boost::make_tuple(t0, t1)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2) { return tuple(::boost::make_tuple(t0, t1, t2)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3) { return tuple(::boost::make_tuple(t0, t1, t2, t3)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4, t5)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4, t5, t6)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7, t8)); } template tuple pack(const T0 &t0, const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8, const T9 &t9) { return tuple(::boost::make_tuple(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9)); } template tuple unpack(const std::string &data) { return tuple(data); } template typename boost::tuples::element >::type unpack( const std::string &data) { return boost::tuples::get(unpack(data)); }