Re: [pygccxml-development] argument policies
Brought to you by:
mbaas,
roman_yakovenko
|
From: Neal B. <ndb...@gm...> - 2006-05-02 11:35:28
|
On Tuesday 02 May 2006 2:26 am, Roman Yakovenko wrote:
> Hi. Matthias I am ready to start working on argument policies.
> I think we should start with "array" argument policies.
>
> What do you think?
>
> --
Personally, I don't need argument policies much. The one I do need is:
typedef boost::mt19937 rng_t;
class_<WrappedClass> (python_typename, desc,
python::init<rng_t&, double>((python::arg("rng"),python::arg("var")),
"__init__(r,var)\n"
"Construct a normal deviate generator\n"
"@param r: Mersenne Twister\n"
"@type r: L{rng}\n"
"@param var: variance\n"
"@type var: float\n"
)
[python::with_custodian_and_ward<1,2>()])
Here, rng_t is boost::mersenne_twister. The wrapped object needs to hold a
reference to a rng_t object, so we need "with_custodian_and_ward".
|