2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 17:32:55 +00:00

Moved to python_v2_API_restructure branch

[SVN r15354]
This commit is contained in:
Joel de Guzman
2002-09-16 03:01:35 +00:00
parent f355be8ac5
commit 6b96eca21b
22 changed files with 60 additions and 160 deletions

View File

@@ -96,7 +96,7 @@ PyObject* new_simple()
//
// Declare some wrappers/unwrappers to test the low-level conversion
// mechanism.
// mechanism.
//
using boost::python::to_python_converter;
@@ -200,7 +200,7 @@ BOOST_PYTHON_MODULE_INIT(m1)
{
using namespace boost::python;
using boost::shared_ptr;
simple_to_python();
lvalue_from_pytype<int_from_noddy,&NoddyType>();
@@ -208,14 +208,14 @@ BOOST_PYTHON_MODULE_INIT(m1)
lvalue_from_pytype<
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // doesn't support non-type member pointer parameters
extract_member<SimpleObject, simple, &SimpleObject::x>
#else
#else
extract_simple_object
#endif
#endif
, &SimpleType
>();
lvalue_from_pytype<extract_identity<SimpleObject>,&SimpleType>();
def("new_noddy", new_noddy);
def("new_simple", new_simple);
@@ -226,7 +226,7 @@ BOOST_PYTHON_MODULE_INIT(m1)
def("f_const_ptr", f_const_ptr);
def("f2", f2);
// Expose g()
def("g", g , return_value_policy<copy_const_reference>()
);
@@ -249,7 +249,7 @@ BOOST_PYTHON_MODULE_INIT(m1)
class_<B,bases<A>, shared_ptr<B> >("B")
.def("name", &B::name)
;
class_<C,bases<A>, shared_ptr<C> >("C")
.def("name", &C::name)
;
@@ -259,8 +259,8 @@ BOOST_PYTHON_MODULE_INIT(m1)
;
class_<complicated>("complicated",
args<simple const&,int>())
.def_init(args<simple const&>())
init<simple const&,int>())
.def(init<simple const&>())
.def("get_n", &complicated::get_n)
;
}