|
Boost : |
From: ¿ÂÃÍ (k.meng_at_[hidden])
Date: 2002-11-07 02:52:10
Hi:
I'm now use the boost.python,and want to write my own converter.
In the last version,I can write like this:
#include <boost/python/class_builder.hpp>
namespace python = boost::python;
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
inline AsnInt from_python(PyObject* p, python::type<const AsnInt&>)
{
return AsnInt(from_python(p, python::type<int>()));
}
inline AsnInt from_python(PyObject* p, python::type<AsnInt>)
{
return from_python(p, python::type<const AsnInt&>());
}
inline PyObject* to_python(const AsnInt& ai)
{
return PyInt_FromLong((AsnIntType)ai);
}
BOOST_PYTHON_END_CONVERSION_NAMESPACE
In this new version, what can I do for the same work? Please give me some examples,
Thank you very much!
kemeng
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk