sl@0: // Copyright David Abrahams 2002. sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: #ifndef INSTANCE_DWA200295_HPP sl@0: # define INSTANCE_DWA200295_HPP sl@0: sl@0: # include sl@0: # include sl@0: # include sl@0: sl@0: namespace boost { namespace python sl@0: { sl@0: struct BOOST_PYTHON_DECL_FORWARD instance_holder; sl@0: }} // namespace boost::python sl@0: sl@0: namespace boost { namespace python { namespace objects { sl@0: sl@0: // Each extension instance will be one of these sl@0: template sl@0: struct instance sl@0: { sl@0: PyObject_VAR_HEAD sl@0: PyObject* dict; sl@0: PyObject* weakrefs; sl@0: instance_holder* objects; sl@0: sl@0: typedef typename type_with_alignment< sl@0: ::boost::alignment_of::value sl@0: >::type align_t; sl@0: sl@0: union sl@0: { sl@0: align_t align; sl@0: char bytes[sizeof(Data)]; sl@0: } storage; sl@0: }; sl@0: sl@0: template sl@0: struct additional_instance_size sl@0: { sl@0: typedef instance instance_data; sl@0: typedef instance instance_char; sl@0: BOOST_STATIC_CONSTANT( sl@0: std::size_t, value = sizeof(instance_data) sl@0: - BOOST_PYTHON_OFFSETOF(instance_char,storage)); sl@0: }; sl@0: sl@0: }}} // namespace boost::python::object sl@0: sl@0: #endif // INSTANCE_DWA200295_HPP