[C++-sig] shared_ptr<> to Boost.Python wrapped object going out ofscope early?

English, Mark Mark.English at rbccm.com
Mon Jun 16 17:57:47 CEST 2008


> -----Original Message-----
> From: c++-sig-bounces at python.org 
> [mailto:c++-sig-bounces at python.org] On Behalf Of Christopher Wicklein
> Sent: 16 June 2008 16:43
> 
> Python code above.  To fill things out a bit, here is the 
> Boost.Python statement used to wrap the Observer:
> 
> class_<ObserverWrap, boost::noncopyable>("Observer")
>     .def("onModify", pure_virtual(&Observer::onModify))
> ;
> 
> Here is the wrapper class:
> 
> struct ObserverWrap : Observer, wrapper<Observer> {
>     onModify(Record record) { 
> this->get_override("onModify")(record); } }
> 

What is the function signature of "onModify()" ?

Should the function signature be based around shared_ptr (I've also
included a void return type) ?
E.g.
struct ObserverWrap : Observer, wrapper<Observer> {
 void onModify(shared_ptr<Record> record) { 
this->get_override("onModify")(record); } }
_______________________________________________________________________

This email is intended only for the use of the individual(s) to whom
it is addressed and may be privileged and confidential.

Unauthorised use or disclosure is prohibited. If you receive this
e-mail in error, please advise immediately and delete the original
message without copying, using, or telling anyone about its contents.

This message may have been altered without your or our knowledge and
the sender does not accept any liability for any errors or omissions
in the message.

This message does not create or change any contract.  Royal Bank of
Canada and its subsidiaries accept no responsibility for damage caused
by any viruses contained in this email or its attachments.  Emails may
be monitored.

RBC Capital Markets is a business name used by branches and
subsidiaries of Royal Bank of Canada, including Royal Bank of Canada,
London branch and Royal Bank of Canada Europe Limited. In accordance
with English law requirements, details regarding Royal Bank of Canada
Europe Limited are set out below:

ROYAL BANK OF CANADA EUROPE LIMITED
Registered in England and Wales 995939
Registered Address: 71 Queen Victoria Street, London, EC4V 4DE.
Authorised and regulated by the Financial Service Authority.
Member of the London Stock Exchange
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT149302.txt
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20080616/5e1e77a8/attachment.txt>


More information about the Cplusplus-sig mailing list