I think I know what the issue is, and it indeed relates to a piece of code I have not posted yet.<br><br>void Actor::add(const ActorPtr &actor) {<br> assert(actor);<br> assert(!actor->parent);<br> actor->parent = ActorPtr(this);<br>
children.push_back(actor);<br> queue_redraw();<br>}<br><br>Actor is a tree element with children and a parent pointer. I guess that assigning ActorPtr(this) appears to construct a new pointer for an object that is already registered to boost.python.<br>
<br><div class="gmail_quote">On Sat, Nov 15, 2008 at 7:07 PM, Leonard Ritter <span dir="ltr"><<a href="mailto:paniq@paniq.org">paniq@paniq.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
yes, that's what i want. what details do you need? i mean, the problem posted is quite generic. i want to pass shared_ptr's of abstract classes with overridable methods back and forth from c++ to python and back. is this supposed to work, if yes, how?<div>
<div></div><div class="Wj3C7c"><br>
<br><div class="gmail_quote">On Sat, Nov 15, 2008 at 5:20 PM, Stefan Seefeld <span dir="ltr"><<a href="mailto:seefeld@sympatico.ca" target="_blank">seefeld@sympatico.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Leonard Ritter wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
class_<PyActor, ActorPtr, boost::noncopyable("Actor");<br>
<br>
which I did, but that gives me a compiler error if Actor is abstract, and if I declare it non-abstract, calls to wrapping PyActor methods fail in Python. I guess that this approach does not work with wrapper classes, or the syntax is different.<br>
</blockquote></div>
Please post specific code as well as specific error messages. It sounds as if you expect those methods to return references to existing (shared) objects, while boost.python expects by-value passing, i.e. wants to make copies. But without more information this is just a guess.<br>
<br>
Regards,<br>
Stefan<br><font color="#888888">
<br>
-- <br>
<br>
...ich hab' noch einen Koffer in Berlin...<br>
<br>
_______________________________________________<br>
Cplusplus-sig mailing list<br>
<a href="mailto:Cplusplus-sig@python.org" target="_blank">Cplusplus-sig@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/cplusplus-sig" target="_blank">http://mail.python.org/mailman/listinfo/cplusplus-sig</a><br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>