1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/tuple.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,70 @@
1.4 +// Copyright David Abrahams 2002.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef TUPLE_20020706_HPP
1.9 +#define TUPLE_20020706_HPP
1.10 +
1.11 +# include <boost/python/detail/prefix.hpp>
1.12 +
1.13 +#include <boost/python/object.hpp>
1.14 +#include <boost/python/converter/pytype_object_mgr_traits.hpp>
1.15 +#include <boost/preprocessor/enum_params.hpp>
1.16 +#include <boost/preprocessor/repetition/enum_binary_params.hpp>
1.17 +
1.18 +namespace boost { namespace python {
1.19 +
1.20 +namespace detail
1.21 +{
1.22 + struct BOOST_PYTHON_DECL tuple_base : object
1.23 + {
1.24 + protected:
1.25 + tuple_base();
1.26 + tuple_base(object_cref sequence);
1.27 +
1.28 + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple_base, object)
1.29 +
1.30 + private:
1.31 + static detail::new_reference call(object const&);
1.32 + };
1.33 +}
1.34 +
1.35 +class tuple : public detail::tuple_base
1.36 +{
1.37 + typedef detail::tuple_base base;
1.38 + public:
1.39 + tuple() {}
1.40 +
1.41 + template <class T>
1.42 + explicit tuple(T const& sequence)
1.43 + : base(object(sequence))
1.44 + {
1.45 + }
1.46 +
1.47 + public: // implementation detail -- for internal use only
1.48 + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple, base)
1.49 +};
1.50 +
1.51 +//
1.52 +// Converter Specializations // $$$ JDG $$$ moved here to prevent
1.53 +// // G++ bug complaining specialization
1.54 + // provided after instantiation
1.55 +namespace converter
1.56 +{
1.57 + template <>
1.58 + struct object_manager_traits<tuple>
1.59 + : pytype_object_manager_traits<&PyTuple_Type,tuple>
1.60 + {
1.61 + };
1.62 +}
1.63 +
1.64 +// for completeness
1.65 +inline tuple make_tuple() { return tuple(); }
1.66 +
1.67 +# define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/make_tuple.hpp>))
1.68 +# include BOOST_PP_ITERATE()
1.69 +
1.70 +}} // namespace boost::python
1.71 +
1.72 +#endif
1.73 +